Jump to content

VEX Robot: movement & rotation issue

Recommended Posts

Hey guys, new here, nice to meet y'all!

I'm new to Houdini and have been dabbling with VEX recently. It's a love hate thing.

Being interested in social insects I got the idea to build a little "ant robot" that could follow a trail. It has a body (point) and three points that serve as sensors. These sensors sample the ground's trail attribute (red, works), compare their values, find the "winner" (works) and then the whole thing should rotate accordingly and move along a vector that goes from the body to the best sensor point to stay on track. (Works not so well).


That's the status and at least it's doing some following the path, but I can't get the robot thing to rotate around a custom position. Instead, the matrix rotation always uses the world origin as a pivot which looks increasingly bad with distance and at a certain stage just breaks. Also, the body promptly severs itself from the rest, which is a tad unfortunate, as I wanted it to follow the sensors (stay attached) and serve as a the pivot for the rotate().

I know this is a little messy but maybe one of you would like to have a look at the hip and point me to the obvious mistakes I made.

Much appreciated!




Edited by grafikzeug

Share this post

Link to post
Share on other sites

Split it into two wrangles. First will operate in Detail mode and contain code necessary to compute bestsensorpt_pos and rotation. Second is a Point Wrangle doing rotation and velocity update. Pivoting transformation is easy:

new_position = (old_position - pivot) * transform_matrix + pivot

You can use antbody_pos as a pivot.

  • Like 1
  • Thanks 1

Share this post

Link to post
Share on other sites

Thanks a bunch, f1!

I just read this after making it (sort of) work. Your approach is definitely more straighforward, even though I did end up using the detail attributes to store the data for the whole creature on. It took me a while to understand that the thing was ripped apart because not all of its points had meaningful values on the necessary attributes that I was trying to use for locomotion.

Since this is a project in order to get going with VEX, so I'm always thankful for feedback or hints!

Here is the current status. I've included the hip if someone is interested.

v14.gif.718648feacc2f240d2d0e63a8a8685a8.gif  v14_C.gif.19ba690ee3a92c88df08ded72f1f8b33.gif  v14_nogoal.gif.f7738fc977a4fd5ef103e4b0758d5cb2.gif

Right now I'm happy that it moves at all; the next steps being a general sense of direction (so it doesn't just turn back when it looses the trail, but is a little more determined ;)) and then see if I can make it avoid obstacles (and other ants).




  • Like 4

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now