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
Link to comment
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
Link to comment
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 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...