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

Run micro-ros-agent on top of rmw_fastrtps_dynamic_cpp, using introspection typesupport #202

Open
henriksod opened this issue Aug 1, 2023 · 2 comments

Comments

@henriksod
Copy link

henriksod commented Aug 1, 2023

Issue template

I am getting segmentation fault at

callbacks_ = static_cast<const message_type_support_callbacks_t *>(type_support_->data);

due to the type_support_ object being erased from memory somewhere in

type_support_ = get_message_typesupport_handle(type_support_,

type_support_->typesupport_identifier is rosidl_typesupport_introspection_cpp since I am using rmw_fastrtps_dynamic_cpp as middleware. I see that L33 in graph_typesupport.cpp compares with rosidl_typesupport_fastrtps_cpp, which is why I assume micro-ros-agent requires rmw_fastrtps_cpp as middleware. I would like to stick with rmw_fastrtps_dynamic_cpp.

Changing this line from rmw_fastrtps_dynamic_cpp to rosidl_typesupport_introspection_cpp causes the segmentation error to go away and the program can proceed:

However, then it fails at this line instead with a segmentation fault:

return static_cast<uint32_t>(4 + callbacks_->get_serialized_size(data));

My question is, can micro-ros-agent support introspection, i.e. rmw_fastrtps_dynamic_cpp?
What are the necessary changes if not?

@henriksod henriksod changed the title Run micro-ros-agent under rmw_fastrtps_dynamic_cpp, using introspection Run micro-ros-agent on top of rmw_fastrtps_dynamic_cpp, using introspection Aug 1, 2023
@henriksod henriksod changed the title Run micro-ros-agent on top of rmw_fastrtps_dynamic_cpp, using introspection Run micro-ros-agent on top of rmw_fastrtps_dynamic_cpp, using introspection typesupport Aug 1, 2023
@pablogs9
Copy link
Member

pablogs9 commented Aug 2, 2023

Hello, not sure why you need introspection in the micro-ROS Agent.

In any case, if there is a solution that fits your requirements, please feel free to contribute with a PR. Maybe we can make those type support to be selected by means of an environment variable.

@henriksod
Copy link
Author

I am using this repo https://github.com/mvukov/rules_ros2 to build ROS2 nodes using the Bazel build system. They currently have support for CycloneDDS which uses rosidl_typesupport_introspection. I have made a PR to add FastDDS and since there is already generator rules implemented for rosidl_typesupport_introspection, it makes sense to use rmw_fastrtps_dynamic.

Maybe I am too new to ROS2 to understand, why would I not want to use introspection? It reduces complexity in the projects and makes switching between DDS middlewares more seamless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants