ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

Add custom GZ -> ROS mapping (Humble/Garden)

Open AntonioViscomi opened this issue 2 months ago • 6 comments

Hi all, I need to use Gazebo Garden alongside ROS 2 Humble . I want to use the ros_gz_bridge to obtain measurements from virtual sensors on my robot and process them in ROS.
In my ros_gz version (this one ) there is no mapping between gz.msgs.NavSat and gps_msgs/msg/GPSFix.
I need this mapping because I want to transport also the ENU velocity in ROS, which is not possible using sensor_msgs/msg/NavSatFix

Desired behavior

A map betweem gz.msgs.NavSat and gps_msgs/msg/GPSFix in ros_gz_bridge (ros-humble-ros-gzgarden).

Alternatives considered

I've cloned the "humble" branch (which should correspond to my installed version of ros_gz_bridge) and:

  1. I've included gps_msgs.hpp in ros_gz/ ros_gz_bridge/include/ros_gz_bridge/convert
  2. Added #include <ros_gz_bridge/convert/gps_msgs.hpp> to convert.hpp
  3. Added gps_msgs.cpp in ros_gz/ros_gz_bridge/src/convert
  4. Added inside ros_gz/ros_gz_bridge/mappings.py:
  'gps_msgs': [
        Mapping('GPSFix', 'NavSat'),
    ], 
  1. Added gps_msgs in package.xml

I am unsure if this will work because I've installed gps_msgs as a custom interface inside my custom interfaces package and I also need to ffigure out how to install this "new package" I've created. Am I missing anything?

Additional context:

OS: Ubuntu 22.04.

AntonioViscomi avatar Apr 13 '24 14:04 AntonioViscomi