[ros-users] [Discourse.ros.org] [Next Generation ROS] How to use namespaces?

mch ros.discourse at gmail.com
Tue Jul 18 19:48:54 UTC 2017

Operating System: Linux Mint = Ubuntu 16.04
Installation type: from source
Version or commit hash: release-beta2
DDS implementation: Fast-RTPS
Client library (if applicable): boost, restcpp

I've read this article http://design.ros2.org/articles/topic_and_service_names.html#fully-qualified-names and generally I realized how namespaces works.

However some practical questions are unclear. Do I need to add namespace manually when I crate a client for the lifecycle service OR system does that for me?

e.g. previously I had
communicationNode.createClient<lifecycle_msgs::srv::GetState>(nodeName + "__get_state");
in ROS2 beta2 it doesn't work any more  (rclcpp::client::ClientBase::wait_for_service() always ended by timeout).

I tried those options
communicationNode.createClient<lifecycle_msgs::srv::GetState>('/' + namespace + '/' + nodeName + "__get_state");
communicationNode.createClient<lifecycle_msgs::srv::GetState>("/rq/" + namespace + '/' + nodeName + "__get_state");
none of them doesn't seem to work as well.

Could you hint me what is the right way to call lifecycle "__get_state" service now?

[Visit Topic](https://discourse.ros.org/t/how-to-use-namespaces/2236/1) or reply to this email to respond.

More information about the ros-users mailing list