ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Scope Resolution problem in the ROS2 migration guide

asked 2018-05-18 05:19:16 -0600

aks gravatar image

updated 2018-05-18 07:09:14 -0600

While trying to migrate from ROS1 to ROS2 using the migration guide there is a problem of scope declaration.

while compilation many of the classes of the rclcpp are said as not declared.

e.g. auto node = rclcpp::node::Node::make_shared("talker");, here rclcpp::node has not been declared.

Similarly in rclcpp::rate::Rate loop_rate(10);, here rclcpp::rate has not been declared.

I already have the #include "rclcpp/rclcpp.hpp" What else am i missing ?

edit retag flag offensive close merge delete


It's possible that line in the guide is out of date. Does rclcpp::Node::make_shared("talker") work?

sloretz gravatar image sloretz  ( 2018-05-18 09:38:20 -0600 )edit

Yes, I also thought the same and changed it to rclcpp::Node::make_shared("talker"). This works. As i also saw in the rclcpp::Node class and there is no mention of node. I am just creating a node by using auto node. Also does that mean I should change rclcpp::rate::Rateto rclcpp::Rate ?

aks gravatar image aks  ( 2018-05-18 09:55:17 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-18 10:02:53 -0600

sloretz gravatar image

updated 2018-05-18 10:03:16 -0600

The extra namespaces rclcpp::node and rclcpp::rate were removed in this pull request

Thanks for reporting it. I've updated the migration guide.

edit flag offensive delete link more


Thanks for the information :)

aks gravatar image aks  ( 2018-05-18 10:09:42 -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



Asked: 2018-05-18 05:19:16 -0600

Seen: 413 times

Last updated: May 18 '18