How to write a custom control plugin for Gazebo-Ros using Python ?

asked 2019-02-20 09:09:37 -0500

microbot gravatar image

Helllo, I have been trying to write a custom control plugin for gazebo using python interpreter. I want to use ros to fetch the joint states and publish joint commands for my robot in the gazebo. I have been searching for what kind of packages do I need to import in my python script file in order to read the joint states from gazebo model. Can you please help me pointing me out in the right direction? All the tutorials I have been searching are for the plugin in C++. If available can you please give me any link of sample custom control plugin in python. Also I have come across Osrf_msgs package , I am not sure about what that package comprises of. Can you please help me with this. Thank you.

edit retag flag offensive close merge delete

Comments

pmuthu2s gravatar image pmuthu2s  ( 2019-02-20 09:14:41 -0500 )edit

Yea I have come across that, although I could not understand what Osrf_msg package is and then the scope of JointState() function whether this function gives the joint states of all the joints together or how the function is supposed to be used.

microbot gravatar image microbot  ( 2019-02-20 09:32:31 -0500 )edit

Also the whole tutorial is a bit raw when trying to understand what the code is supposed to do , like what he tried to do with having the Kp, Ki and Kd gain values and etc, if you could give me a brief explanation, it would be very much appreciated. Thanks in advance.

microbot gravatar image microbot  ( 2019-02-20 09:34:14 -0500 )edit

I guess joint states are from sensor msgs check this link They will provide all the joint states.

pmuthu2s gravatar image pmuthu2s  ( 2019-02-20 09:40:15 -0500 )edit
pmuthu2s gravatar image pmuthu2s  ( 2019-02-20 09:41:31 -0500 )edit

I donot think The Post for altas robot is for a gazebo plugin. The post is about a ros node subscribing the JointState topic and publish JointCommand. A gazebo plugin should be referenced in SDF file and work in "OnLoad->OnUpdate" loop within the simulation loop of gazebo itself. The altas robot should have a plugin controller already and this plugin will subscribe the JointCommand and response to it.

frzybo gravatar image frzybo  ( 2021-08-18 19:13:59 -0500 )edit