## How to move a robot using regular API?

Typically: "How do I... ", "How can I... " questions
suri
Posts: 35
Joined: 07 Apr 2020, 17:24

### How to move a robot using regular API?

I need to move the robot using regular API(currently using sim.setObjectPosition, if any other options is there kindly let me know). When I tried to set the position of robot during simulation on, robot breaks apart.

Code: Select all

RoboHandle = sim.getObjectHandle("kira_b50")
sim.setObjectPosition(RoboHandle,-1,{1,1,0})

When I use the above code, robot breaks apart. I tested the same code for KUKA YouBot robot, same thing happened.

How can I move my robot using regular API without breaking it?

I went through design consideration for dynamic simulation. I didn't find any error in the robot design(which are critical ).

https://www.coppeliarobotics.com/helpFi ... ations.htm.

Kindly have a look into my robot design consideration and breaking of robot when moving using regular API.

Currently kira_b50 is a base model. I set the robot_base(convex shape) as a model, it works without ros velocity command, but not with ros velocity command.

I need to make base_ref(dummy) as a base of model and also I need to move the robot using setObjectPosition without breaking robot.

Hope for a hint or suggestion.

coppelia
Posts: 7928
Joined: 14 Dec 2012, 00:25

### Re: How to move a robot using regular API?

Hello,

if your robot is dynamically enabled, i.e. has a mass, will fall, etc., then you can't instantaneously change its position. It would be like teleportation in real life. You need to drive to robot towards the position you wish, via a controller that actuates the wheels of the robot.
Of course, if you need to reset your robot, that's another story, but I guess that's not what you want to do.

Cheers

suri
Posts: 35
Joined: 07 Apr 2020, 17:24