Gazebo model plugin for ROS2
Hi All,
I would like to create a model plugin for Gazebo 11 and ROS2 (Foxy). The robot would be a manipulator arm which would get commands via ROS topic and use a custom controller to calculate the joint torques to be passed to Gazebo. The robot model is given in URDF, which I have turned into SDF for Gazebo use.
I already can load the URDF in ROS2 node, I have the necessary Python launch file.
so I can do ros2 launch src/link-intersection-brute-force/launch/link-intersection-brute-force.py
and it starts.
I also have a minimal stub for Gazebo plugin called gazebo-plugin.cpp which compiles.
I know there are some official ROS2 / Gazebo examples but I could not put them together. My problem is I can't go forward from here. Could you please give an example with a launcy.py file and perhaps other needed stuff, which lets me fire up Gazebo with my plugin and my SDF file?
Thank you in advance. Best regards: Balázs Bámer
What you are describing sounds more like it would be better accomplished in ROS2 than as a Gazebo plugin...
Have you considered trying gazebo_ros2_control for the gazebo joint interfaces? Then you can write a custom controller if you want as a ROS2 package. This library has some tutorials and examples that could help you get started.
I've seen this package, but I have very little background in ROS and Gazebo, and did not realize why it is good for me. I need the physics from Gazebo. On the other hand, once I've found a CDPR example as a Gazebo plugin (for ROS1) and used it in an older project.I know this works and wanted something similar.