I am trying to make my robot move along a predefined path. Before starting the simulation the robot is always in the same position. When I start the simulation, the robot "jumps" to the beginning of the path, moves along the path, and jumps back as soon as the simulation ends. I want it to move to the path at the beginning and move back at the end.
That's why I thought I'd insert the current position of the robot's tip to the path once in the beginning and once in the end.
Two questions came up:
1. I get the position like that:
Code: Select all
spitze=simGetObjectHandle('tip') --extend path to current position akpos=simGetObjectPosition(spitze,-1) akor=simGetObjectOrientation(spitze,-1)
But this does not give me the position, that the robot is in before I start the simulation. The path now begins somewhere else, but not where I want it to begin. What is the reason for that?
2. How can I get the number of ctrl-points in a path or how can I add a ctrl-point to the end of a path?