How do i write a custom Gazebo plugin that uses ROS2
I need to manipulate some joints on a gazebo model and also publish some model properties. I would like to do this using a ROS2 node.
I was able to write a custom model plugin for gazebo that does the needed model manipulations.
I am also able to write a basic ROS2 node that publishes & subscribes.
I don't know how to integrate the two, ROS2 + gazebo. I basically need a model plugin that spawns a ROS2 node. There seem to be different build systems for each of them, i cannot find any documentation on how they go together.
gazeboros2control seems to be close to what i need, but that project does not build for me either, and I would prefer a custom plugin so I am able to control everything i need better.
thanks
Asked by Mihai D on 2021-11-18 16:14:26 UTC
Answers
Finally found a solution, after failing to build a plugin from scratch.
I built gazebo_ros_pkgs from scratch and started my custom plugin by modifying an existing one, in my case gazebo_ros_pkgs/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_diff_drive.cpp.
Instructions on how to build it are here http://gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros
Asked by Mihai D on 2021-11-20 08:10:39 UTC
Comments