Running Gazebo 7.14 on Ubuntu 16.04
http://gazebosim.org/tutorials?cat=guided_i&tut=guided_i5
I tried implementing this tutorial and it works fine. In the plugin code used in this tutorial, a function from Gazebo API called GetJointController() is used to get a handle to the controller for the joints in the model. In my particular project, I am trying to apply a torque to Polaris Ranger XP900 (http://models.gazebosim.org/polaris_ranger_xp900/) to the rear wheel link. Similar to the GetJointController() function, I wasn't able to find a GetLinkController() function to handle control to the links in the API documentation. Is there any similar function which serves this purpose?
Originally posted by rmv24 on Gazebo Answers with karma: 3 on 2019-03-26
Post score: 0
Original comments
Comment by kumpakri on 2019-03-28:
Attach a joint to your link and control it through the joint. There is no justification from physics point of view for having a link controller. In the real world you need some kind of actuator to move things. A joint is the actuator.
Comment by rmv24 on 2019-03-28:
Thank you for your reply. In that case, how do you apply a torque? From a physics point of view, it wouldn't be possible to apply torque to a joint
Comment by kumpakri on 2019-03-29:
There is no method in the API documentation that seems to do this. But the documentation is very bad, so either there is no such method or one of the methods do what you need but is documented and named badly. If you only need to apply some forces to the joint to test something, you can also use the terminal command gz joint -m <model_name> -j <joint_name> -f <force>
Comment by rmv24 on 2019-04-03:
Thank you, but I'm trying to apply a torque to a wheel (link) via a plugin, and not applying directly via the terminal. Hence I wanted to know if there's any specific function called GetLinkController() to handle control to the links!
Comment by kumpakri on 2019-04-09:
In that case look at the SetForce and SetTorque methods in Link and Joint objects API.