Force control: sending effort commands to the robot


#1

Hi,

As far as I understand there are two main ways to do force control:

  • Using the gazebo service /gazebo/apply_joint_effort
  • Directly publishing in the /joint_states topic the desired effort

The first option does not allow me to send the effort of multiple joints in one message so I need to make a call of the service for every joint.

I tried to use the second option but /gazebo is subscribe to the /joint_states topic and has preference in publishing messages since my messages are being ignored.

Is it possible to overcome this issue to be able to use the /joint_states topic to send effort commands?

Kind regards,

Carlos


#2

Hello, @ccmir!

There are multiple ways of applying forces/torques to robot models in Gazebo:

  • Using the /gazebo/apply_joint_effort (command) topic is one of them
  • Another, usually preferred way in the NRP however is to use the robot model-specific command topics that are created by Gazebo plugins that are intended to be used alongside specific robot models. The “/joint_states” topic is a read-only topic where Gazebo publishes positions/velocities/forces/torques for joint instances in the active simulation, but if you try to publish to it, Gazebo won’t evaluate your requests.
  • Then there is also ros_control: http://gazebosim.org/tutorials/?tut=ros_control, which serves as a common control abstraction layer for both simulated and real robot hardware, and is used e. g. by MoveIt! There is no experiment in the NRP that currently uses ros_control, however.

Thank you very much!
With best regards,
Fabian