ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How can I get currently used rmw_implementation of running nodes?

asked 2020-01-26 07:22:15 -0500

masat gravatar image

I would like to check what rmw_implementation is used for running nodes. Anyone knows how to do it?

Thanks,

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2020-01-27 11:48:31 -0500

Dirk Thomas gravatar image

Since the question was asking for "running nodes" you can check which shared libraries that process is using. On Linux you can run:

lsof -p <PID> | grep rmw

The list will contain one of the RMW libraries (e.g. librmw_fastrtps_cpp.so) beside generic ones like librmw.so and librmw_implementation.so.

edit flag offensive delete link more

Comments

Great! That is what I wanted. Thank you Dirk and Steve!

masat gravatar image masat  ( 2020-02-01 01:12:29 -0500 )edit
0

answered 2020-01-26 14:53:55 -0500

Great question. I assumed when I looked at the RCL or RCLCPP API I'd find something direct to point you to, I was wrong. That sounds like a fabulous feature request for RCL if we are correct that there is indeed no straightforward way to determine that from C++.

Otherwise, there are other ways to easily find this information. https://github.com/ros2/rcl/blob/mast.... In particular, when you set an RMW, you set the environmental variable of RMW_IMPLEMENTATION to the value. That should give you which implementation is in the environment.

I agree however that it would make alot of sense to get a "what is being used currently" rather than a "what is being set to use" in case of some failure or if the environment changed since launch.

edit flag offensive delete link more

Comments

Dear Steve,

Thank you for your response.

Yes, I agree that we need "what is used" than "what is set". We can use RMW_IMPLEMENTATION to set RMW as we like. However, I would like to know current RMW of running nodes.

masat gravatar image masat  ( 2020-01-27 08:22:40 -0500 )edit

For now, you can use the environmental variable.

stevemacenski gravatar image stevemacenski  ( 2020-01-27 11:01:12 -0500 )edit

See Dirks answer, that's by far better.

stevemacenski gravatar image stevemacenski  ( 2020-01-27 14:38:10 -0500 )edit

Thanks Steve!

masat gravatar image masat  ( 2020-02-01 01:12:44 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-01-26 07:22:15 -0500

Seen: 448 times

Last updated: Jan 27 '20