Ask Your Question
0

How can I get currently used rmw_implementation of running nodes?

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

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
3

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

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 imagemasat ( 2020-02-01 01:12:29 -0600 )edit
0

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

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 imagemasat ( 2020-01-27 08:22:40 -0600 )edit

For now, you can use the environmental variable.

stevemacenski gravatar imagestevemacenski ( 2020-01-27 11:01:12 -0600 )edit

See Dirks answer, that's by far better.

stevemacenski gravatar imagestevemacenski ( 2020-01-27 14:38:10 -0600 )edit

Thanks Steve!

masat gravatar imagemasat ( 2020-02-01 01:12:44 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 34 times

Last updated: Jan 27