Coder Social home page Coder Social logo

Comments (9)

mikaelarguedas avatar mikaelarguedas commented on September 3, 2024 1

As there is no equivalent type for ROS1 time in ROS 2 (and won't be, by design). Adding mapping rules will not be enough to solve this issue.
Though being able to bridge these messages is valuable. The path forward would be to add a special handling in the bridge itself to match the fields to their equivalent in builtin_interfaces/Time (and perfomr the necessary conversions):
int32 sec -> int32 sec
int32 nsec -> uint32 nsec

from ros1_bridge.

gavanderhoorn avatar gavanderhoorn commented on September 3, 2024

Could this perhaps be solved by specifying a custom mapping rule?

from ros1_bridge.

matt-attack avatar matt-attack commented on September 3, 2024

Where could I put the remapping aside from having to modify a core ros package? It appears it would need to be added to the builtin_interfaces package for the bridge to accept it otherwise I get an error similar to this one:
Ignoring rule which affects a different ROS 2 package (builtin_interfaces) then the one it is defined in (my_msgs)

EDIT:
I tried adding the remapping to a source build of builtin_interfaces and it didn't appear to work, likely because there isn't a one to one mapping of the fields of each message.

from ros1_bridge.

dirk-thomas avatar dirk-thomas commented on September 3, 2024

The problem is not related to the differences in the duration or time types. Those are already being handled in the ros_bridge`: see https://github.com/ros2/ros1_bridge/blob/03f95fea565c2eb28057df8f7b1595bdeac995bc/include/ros1_bridge/convert_builtin_interfaces.hpp

The bridge simply can't bridge a message definition which is not available on both side. And Clock doesn't exist in ROS 2 atm. Please see ros2/common_interfaces#50 which add the Clock message for ROS 2. With that being present bridging the message will work.

from ros1_bridge.

ernestmc avatar ernestmc commented on September 3, 2024

I believe this issue still persists. I'm getting the same error than @matt-attack:

failed to create 1to2 bridge for topic '/clock' with ROS 1 type 'rosgraph_msgs/Clock' and ROS 2 type 'builtin_interfaces/Time': No template specialization for the pair
check the list of supported pairs with the `--print-pairs` option

I've also tried the manual mapping but it seems to be ignored. Printing the mapping shows no instance of the required mapping. Also the mapping needs to be done in the 'builtin_interfaces' package.
I suspect that creating the rosgraph_msgs/Clock message for ros2 is not enough because the ros2 nodes are already subscribing to the /clock topic using the ros2 builtin_interfaces/Time message.

from ros1_bridge.

dirk-thomas avatar dirk-thomas commented on September 3, 2024

This is not a bug on the ros1_bridge anymore. In ROS 1 the clock topic is documented to have the type rosgraph_msgs/Clock (see http://wiki.ros.org/Clock#Clock_Message).

@tfoote Can you please follow up on this since you added the clock topic to rclcpp.

from ros1_bridge.

dirk-thomas avatar dirk-thomas commented on September 3, 2024

I created ros2/rclcpp#473 to track this.

from ros1_bridge.

ernestmc avatar ernestmc commented on September 3, 2024

Thank you @dirk-thomas . While this is being worked, is there a temporary solution maybe creating a mapping for this topic?

from ros1_bridge.

dirk-thomas avatar dirk-thomas commented on September 3, 2024

Yes, you can temporarily work around it by defining a remapping rule.

from ros1_bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.