Page 1 of 1

Object Path Planning

Posted: 23 May 2015, 15:28
by DannyYeong
Hi,

I'm trying to make a cuboid follow a specific path. Currently, the cuboid carries a script that lifts itself up a specific height and then balances from a P controller. I'm trying to set the cuboid to move on an XY direction following the dummy without affecting the height balancing process.

Attached file:
http://www.filedropper.com/thrustpathplanningcuboidtest

The simulation error said simFollowPath can only be called from a thread, what does this mean? I've tried putting it under a IF ELSE command but gives the same error.

Side question: Are there any other suitable commands that allows an object to move according to the path without affecting the balancing P controller? My path planning is a simple XY direction.

Re: Object Path Planning

Posted: 24 May 2015, 17:22
by coppelia
This means that the script executing the command is not a threaded child script.

But you cannot use that function anyways for what you want to do. For what you want to do, simply read successive positions from the path with simGetPositionOnPath. Then, check the current position of your cube and compute a force that brings your cube closer to the read position. Apply then that force to the cube with simAddForceAndTorque. You will probably also need some kind of controller for that, for a good curve following result.

Cheers