ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

This is a late reply, but I hope this can be useful to others. As suggested by gvdhoorn, the problem is on Gazebo's side when you are using Gazebo's ODE default physics engine. Here is a quick fix that works for me.

In the sdf file describing your Gazebo simulation environment, you need to set the "physics-->ode-->constraints-->contact_max_correcting_vel" parameter to correspond to the maximum angular speed (rad/s) of any joint you wish to simulate. For instance, for a maximum angular speed of 10000.0 rad/s, a simple working example of an sdf file would be

<?xml version="1.0" ?>
<sdf version="1.5">
    <world name="default">
        <physics name='default_physics' default='0' type='ode'>
            <max_step_size>0.001</max_step_size>
            <real_time_factor>1</real_time_factor>
            <real_time_update_rate>1000</real_time_update_rate>
            <ode>
                <constraints>
                <contact_max_correcting_vel>10000.0</contact_max_correcting_vel>
                </constraints>
            </ode>
        </physics>
        <!-- A global light source -->
        <include>
            <uri>model://sun</uri>
        </include>
        <!-- A ground plane -->
        <include>
            <uri>model://ground_plane</uri>
        </include>
    </world>
</sdf>

This is a weird workaround, because according to the SDFormat specifications , the "contact_max_correcting_vel" parameter corresponds to the maximum correcting velocities allowed when resolving contacts (and has a default value of 100). This has arguably nothing to do with the maximum angular speed of the joints in a model.

Then in Gazebo's documentation, it is pointed out that

contact_max_correcting_vel This is the same parameter as the max_vel under collision->surface->contact. contact_max_correcting_vel sets max_vel globally.

Again, setting contact_max_correcting_vel should have nothing to do with the maximum angular speed of joints in the model, but I suspect that the global value set for max_vel is also used by ODE's physics engine as the default maximum angular speed for new bodies. For more details, check out the "dWorldSetMaxAngularSpeed" function in ODE's manual.