Difference between revisions of "Getting Started with ROS on Embedded Systems/User Guide/C++/Names"

From RidgeRun Developer Connection
Jump to: navigation, search
(Created page with "Name manipulation is an important section for ROS, in here you can find useful commands that work well when doing this manipulation An useful command is the resolve, which le...")
 
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Name manipulation is an important section for ROS, in here you can find useful commands that work well when doing this manipulation
+
{{Getting Started with ROS on Embedded Systems/Head|previous=User Guide/C++/Messages|next=User Guide/C++/Publishers_and_subscribers|metakeywords=ROS}}
  
An useful command is the resolve, which lets you create a name with the namespace of the node and a given name, resulting in node_namespace/name
+
== Introduction ==
 +
This wiki is based on the following page: http://wiki.ros.org/roscpp/Overview/Names%20and%20Node%20Information
 +
 
 +
Name manipulation is an important section for ROS, in here you can find useful functions that work well when doing this manipulation
 +
 
 +
== Functions ==
 +
 
 +
A useful function is a resolve, which lets you create a name with the namespace of the node and a given name, resulting in node_namespace/name
  
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
Line 7: Line 14:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Another useful command, is the append, which simply appends two strings resulting in left/right
+
This is useful when you don't want to have the node name pre-appended to your topic names.
 +
 
 +
Another function is the append, which simply appends two strings resulting in left/right
  
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
std::string ros::names::append(const std::string& left, const std::string& right);
 
std::string ros::names::append(const std::string& left, const std::string& right);
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
{{Getting Started with ROS on Embedded Systems/Foot|User Guide/C++/Messages|User Guide/C++/Publishers_and_subscribers}}

Latest revision as of 13:15, 8 March 2023




Previous: User Guide/C++/Messages Index Next: User Guide/C++/Publishers_and_subscribers




Introduction

This wiki is based on the following page: http://wiki.ros.org/roscpp/Overview/Names%20and%20Node%20Information

Name manipulation is an important section for ROS, in here you can find useful functions that work well when doing this manipulation

Functions

A useful function is a resolve, which lets you create a name with the namespace of the node and a given name, resulting in node_namespace/name

std::string ros::names::resolve(const std::string& name, bool remap = true);

This is useful when you don't want to have the node name pre-appended to your topic names.

Another function is the append, which simply appends two strings resulting in left/right

std::string ros::names::append(const std::string& left, const std::string& right);


Previous: User Guide/C++/Messages Index Next: User Guide/C++/Publishers_and_subscribers