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

Pass ROS/ROS2 messages across all available middleware #35

Open
fabawi opened this issue Nov 19, 2022 · 0 comments
Open

Pass ROS/ROS2 messages across all available middleware #35

fabawi opened this issue Nov 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@fabawi
Copy link
Member

fabawi commented Nov 19, 2022

Currently, ROS messages (std_msgs, geometry_msgs ..., + custom message types following the ROS topic/package mapping convention) can be published and received using ROS by setting the data structure to ROSMessage. There are multiple ways to make this happen, for example:

  1. Add an argument e.g. (convert_to_native_object=True) to the ROSMessage publisher to convert the ROS messages to native objects. For non-ROS publishers, we can have a common lookup dictionart to identify supported type names across all middleware, and fallback to NativeObject when detected. This can cause problems, one being due to ROS nodes expecting messages of specific form can no longer deserialize the new types. Another issue occurs when convert_to_native_object is not set to True, meaning the object cannot be deserialized
  2. Add ROSMessage listeners to all middleware. This would assume that the listener has ROS installed but would use the corresponding middleware for communication. The first issue with this approach is that it violates the goal of middleware separation and interdependence avoidance. Second, the objects would need to be deserialized locally (a huge issue with ROS2 since the serialization follows CDR, and messages need to be compiled), adding more overhead
  3. Clone the message types and convert them to native Python/NumPy objects within classes. These class types would override ROS messages only when a non-ROS middleware is being used and default to ROS messages when used with ROS. This is probably the cleanest approach but requires much more effort to achieve since such classes need to be tested to not fail with all ROS message types. ROS2 is even more to design complex since most of the definitions are in the rcl C API
  4. The quick and dirty approach is to install add-ons which do not necessarily install a fully functional ROS but just the parts needed for deserializing message types like rospypi/simple, which are not fully functional as ROS APIs. Still, could not find a ROS2 equivalent
  5. Rely on websocket bridges? Don't think this is a good idea
@fabawi fabawi added the enhancement New feature or request label Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant