Change robot joint mode through script

Typically: "How do I... ", "How can I... " questions
Post Reply
Eggplant6753
Posts: 4
Joined: 24 Sep 2023, 19:54

Change robot joint mode through script

Post by Eggplant6753 »

I have a robot that undergoes visual servoing towards a particular object. The robot joints during this motion is in dynamic velocity control mode.

On reaching close to the object, I want to program the robot to reach out and grab the object with the gripper. This is best done by giving trajectory inputs to the robot. And for this the joints must be in position controlled mode.

Is it possible to change the joint mode through script? So that the robot starts responding to position inputs and not velocity inputs after some trigger condition.

Thanks

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: Change robot joint mode through script

Post by fferri »

Yes:

Code: Select all

sim.setObjectInt32Param(jointHandle, sim.jointintparam_dynctrlmode, sim.jointdynctrl_position)
sim.setObjectInt32Param(jointHandle, sim.jointintparam_dynctrlmode, sim.jointdynctrl_velocity)
sim.setObjectInt32Param(jointHandle, sim.jointintparam_dynctrlmode, sim.jointdynctrl_force)

Post Reply