Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AntonioViscomi opened this issue Apr 13, 2024 · 5 comments
Open

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

AntonioViscomi opened this issue Apr 13, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@AntonioViscomi
Copy link

AntonioViscomi commented Apr 13, 2024

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 AntonioViscomi added the enhancement New feature or request label Apr 13, 2024
@ahcorde
Copy link
Collaborator

ahcorde commented Apr 15, 2024

@AntonioViscomi
Copy link
Author

Thanks a lot.
I've been able to solve this issue by myself, sharing the solution could be useful?

@yschulz
Copy link

yschulz commented Apr 26, 2024

I would be more than happy to open another issue for this, but I think this fits here and since this issue is still open:

I am actually very interested in custom message mappings. With the ease of protobuf message generation, both in ros and in gazebo, it feels necessary that I should be able to generate my own custom mappings by configuration instead of programmatically. Even programmatically it seems necessary to fork this repo and inject the mappings directly like @AntonioViscomi has suggested in his first comment. Is there any intent of adding a plugin like api or cmake generations or a cli tool to make this process easier?

@azeey
Copy link
Contributor

azeey commented Apr 26, 2024

Is there any intent of adding a plugin like api or cmake generations or a cli tool to make this process easier?

Yes, we would like to add this at some point, but I don't think there's an actual issue for it. I know for sure we've had discussions about it. The code was adapted from https://github.com/ros2/ros1_bridge/ which I've been told has a way to add custom messages, but I haven't tried it myself. If anyone would be willing to figure out how it's done for ros1_bridge and adapt it to ros_gz_bridge, it would be fantastic!

@yschulz
Copy link

yschulz commented Apr 26, 2024

Thanks for the quick reply and the link, I can see the resemblance.

I would gladly take a look into it and see how this can be integrated here in the gz bridge. When I have a better overview I'd open a new issue!

@azeey azeey moved this from Inbox to To do in Core development Jul 15, 2024
@azeey azeey added the help wanted Extra attention is needed label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: To do
Development

No branches or pull requests

4 participants