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

ROS2 official parameter monitor example doesn't compile

asked 2022-04-26 10:55:39 -0600

dottant gravatar image

Hi, I tried on two different Ubuntu 20 machines with ROS2 Galactic and Foxy full desktop versions, but the official example about parameters monitoring highlighted here doesn't compile.
Relevant part of the output is the following

/home/white/ros2_ws/src/parameters/src/parameters_monitor.cpp:32:29: error: ‘ParameterEventHandler’ is not a member of ‘rclcpp’; did you mean ‘ParameterEventsQoS’?

I didn't find issue tickets or something about on the web. Does anyone know anything about or I miss something??

edit retag flag offensive close merge delete

Comments

ParameterEventHandler exists only in Galactic and later distributions. It looks like your rclcpp library may be setup incorrectly and the Foxy version is present in the underlay you're building on top of. Mind posting the full error trace from the compiler?

aprotyas gravatar image aprotyas  ( 2022-04-27 15:04:39 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-04-28 07:52:21 -0600

ijnek gravatar image

Did you happen to use #include "rclcpp/node.hpp" in your parameters_monitor.cpp, as opposed to the #include "rclcpp/rclcpp.hpp" that's used in the tutorials? (I managed to reproduce your issue by using #include "rclcpp/node.hpp.)

As @aprotyas explained, the feature only seems available for ROS2 Galactic onwards.

Using #include rclcpp/rclcpp.hppwill call #include "rclcpp/parameter_event_handler.hpp".

edit flag offensive delete link more

Comments

Thank you guys. I investigated and unfortunately I didn't find anything on the official DOC and repo about the accessibility of the Parameter Monitor in other versions different than Galactic, so your answer is right and yes, on my Galactic platfom I was sourcing Foxy, that's why I got the error.
I guess it is better to update the DOC section of Galactic about the Parameter Monitor saying that is exclusively available for Galactic because it's not mentioned (or I didnt see it....sorry if it's that)

dottant gravatar image dottant  ( 2022-04-28 11:08:22 -0600 )edit

It's probably not as visible as it should be, but: the tutorial you link to is not available for Foxy. If you search for it on the Foxy version of the documentation (selectable from the popup menu in the left bottom corner), you won't find it.

The indications you're looking at the "Galactic version":

image description

and:

image description

gvdhoorn gravatar image gvdhoorn  ( 2022-04-28 11:28:19 -0600 )edit

@gvdhoom sure, I wrote it in my answer, I know that the link points to Galactic and I tried to find it within the Foxy stuff and it's not available. Maybe just a line in the Galactic doc about this thing could be useful, just a suggestion. Anyway thank you so much about the speedy response, that's why I love this community.

dottant gravatar image dottant  ( 2022-04-28 11:37:49 -0600 )edit

I agree that sometimes you don't end up on the docs for the distro that your looking for. May I suggest you make a PR against ros2_documentation with the additional note, I'm sure it won't hurt anyone.

ijnek gravatar image ijnek  ( 2022-04-28 20:08:21 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-04-26 10:55:39 -0600

Seen: 312 times

Last updated: Apr 28 '22