Object Path Planning

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 44
Joined: 24 Feb 2015, 17:06

Object Path Planning

Post by DannyYeong »


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:

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.

Site Admin
Posts: 8067
Joined: 14 Dec 2012, 00:25

Re: Object Path Planning

Post 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.


Post Reply