ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# How to define(in URDF) a joint to stay at the desired position even when external torques are applied.

So, I defined a setup in gazebo using URDF. It consists of 2 links(both cylinders) and a joint. When I'm applying a force on the link, its generating torque at the joint and it moves. Though I'm publishing a position of the joint through an effort control interface, the joint bends. And when the force is removed, the joint returns to the set position.

So, my question is - How do I make it more robust to these forces by defining properties in the URDF file?

Like, applying brake to the joint or a servo motor, which (atleast try to) hold on to their set position. I think my joint is trying to hold onto the position too but failing miserably. Is there a parameter to be included/amplified in URDF to achieve this scenario?

I have looked at other answers but none of them talk URDF. Wondering if there is a URDF way. Like defining something in the gazebo tags, etc...

Thankz fellaz!

edit retag close merge delete

Is there a parameter to be included/amplified in URDF to achieve this scenario?

No, I don't think so. But if you're using an effort controller, then that means it runs a PID loop. That means you need to tweak the gains.

( 2018-12-29 04:18:14 -0600 )edit

But PID defines the dynamics of the joint but not the effort/force it exerts, rit?

( 2018-12-29 05:18:45 -0600 )edit

A PID effort controller by definition sets the force/effort applied to the joint.

( 2018-12-29 05:47:44 -0600 )edit

True. But how can we make it exert more force/torque? I tried it by increasing gains. There doesn't seem to be any effect.

( 2018-12-29 05:52:53 -0600 )edit

Also, just for clarification, I have defined PID params in a gazebo reference tag and also in a .yaml file. Which overwrites the other?

( 2018-12-29 06:07:44 -0600 )edit

Sort by » oldest newest most voted

Increasing gains can increase the torque applied, however the URDF joint definition may define force limits. If these limits are defined and are being reached then increasing the PID gains not result in the behaviour you expect. It should be noted that tuning a PID controller to behave the way the want is a complex process worthy of significant study itself.

Regarding defining a parameter twice, don't do it. This is bad practice and makes for terrible code to maintain and debug. My advice would be to keep the controller configurations just in the YAML and remove them from the launch file.

To summarise this with reference to your original question: You want to check the URDF doesn't define torque limits for the joint and increase or remove the limits if they're there. Then you'll want to tune your controllers PID gains to increase the correctional force the joint applies. There is a method described here to use the dynamic reconfigure interface to tune the gains while a simulation is running, this is far easier than re-running the simulation with different gains many times.

Hope this helps.

more

Please note that the PID gains I referred to are those of the gazebo_ros_control effort controller that I assumed the OP is/was using.

The page you link is from the pid package, which is a stand-alone ROS node, which is not typically used with Gazebo.

( 2018-12-29 10:28:46 -0600 )edit

That's true, I was looking for a relevant PID tuning guide, is there one specifically for gazebo_ros_control ?

( 2018-12-31 09:46:56 -0600 )edit

My apologies for the delayed reply. I will look into the dynamic reconfigure. And increasing limits on effort controller showed some change. Guess I'll have to work in this direction. Yet, little oscillations exist. And seems like there isn't a way to lock a joint without having some oscillations.

( 2019-01-04 12:36:16 -0600 )edit