Object Path Planning

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

Object Path Planning

Post by DannyYeong » 23 May 2015, 15:28

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.

coppelia
Site Admin
Posts: 7330
Joined: 14 Dec 2012, 00:25

Re: Object Path Planning

Post by coppelia » 24 May 2015, 17:22

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

Post Reply