API for joint force/torque control mode, something like simSetJointTargetForce

Requests or suggestions for new features
Post Reply
mahmudali
Posts: 1
Joined: 09 Jul 2020, 03:34

API for joint force/torque control mode, something like simSetJointTargetForce

Post by mahmudali »

I have noticed that we only can set joint target velocity/position based on which mode is used to control the joint. But what if we want to control the joint by sending effort commands; something like simSetJointTargetForce. The only way to control joint using external force/torque controller is this controller: https://studywolf.wordpress.com/2016/04 ... ed-models/. AFAIK, we can only set the maximum force/torque for a joint but not the target one. I am using ros_control pkg to control robots in coppeliasim, so far velocity & position joint HW interfaces work properly, but cant implement the effort HW interface.

Please, let me know if there is any way to control the joint externally by sending force/torque command.

thanks in advance,
Mahmoud

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

Re: API for joint force/torque control mode, something like simSetJointTargetForce

Post by coppelia »

Hello Mahmoud,

not sure I understand what you mean. If you set the maximum force/torque for a joint, that joint will exert that force/torque as the target force/torque, unless the target velocity is reached, in which case the exerted force/torque will be reduced to keep the target velocity:

Create a dynamic cube, set its mass at 1kg, and place it at position (1,0,1). Then add a revolute joint, set its alpha-beta-gamma orientation as (90,0,0), and position it at (0,0,1). Then attach the cube to the joint, and the joint to a static item (e.g. ResizableFloor_5_25_element, in a default scene). Enable the motor for that joint, set its target velocity at 100 deg/seg, and the maximum torque at 9.81 Nm. Run the simulation. The cube won't move, since the applied torque is exactly compensating the gravity. Now reduce the maximum torque for the joint: the cube vill start oscillating around a specific position. But if you look at the graph of the torque exerted by that joint, you'll see that it is constant (i.e. same as target torque).

Cheers

Post Reply