Assing Target and Move Khepera to That Position

Typically: "How do I... ", "How can I... " questions
Post Reply
hande
Posts: 1
Joined: 06 Dec 2017, 23:57

Assing Target and Move Khepera to That Position

Post by hande » 08 Dec 2017, 05:20

Hello;
I am new to LUA programming language. I am looking for a solution that enables set a target to Khepara and Move the robot this target and stop ? Which functions should I use ? I tried simSetJointTargetPosition(0.3,1.72) but it just rotates my robots around it. ?
Thanks

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

Re: Assing Target and Move Khepera to That Position

Post by coppelia » 10 Dec 2017, 21:50

Hello,

you will have to code an algorithm. The algorithm will:
  • Read the current robot position
  • Compare it to the goal position. If the position difference is small enough, you have reached the goal and should leave the loop
  • Actuate the wheels appropriately, in order to move closer to the goal position.
Above should be executed in a loop (or on a regular basis), until you have reached the goal position.

Cheers

Post Reply