grafikzeug Posted November 22, 2017 Share Posted November 22, 2017 (edited) 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! Cheers, Felix Robot_movement_issue.hiplc Edited November 23, 2017 by grafikzeug Quote Link to comment Share on other sites More sharing options...
f1480187 Posted November 28, 2017 Share Posted November 28, 2017 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. 1 1 Quote Link to comment Share on other sites More sharing options...
grafikzeug Posted November 29, 2017 Author Share Posted November 29, 2017 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. 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). Cheers, Felix Ant_v14.hiplc 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.