Check out my first novel, midnight's simulacra!
ROS: Difference between revisions
From dankwiki
(→Names) |
|||
Line 24: | Line 24: | ||
* ~private (the node's name replaces the tilde) | * ~private (the node's name replaces the tilde) | ||
Names can furthermore be [http://wiki.ros.org/Remapping%20Arguments remapped] when a node is started by e.g. rosrun. | Names can furthermore be [http://wiki.ros.org/Remapping%20Arguments remapped] when a node is started by e.g. <code>rosrun</code>. | ||
* Special case: launch node into namespace with <code>__ns</code> | * Special case: launch node into namespace with <code>__ns</code> | ||
* Special case: change node name with variable <code>__name</code> | * Special case: change node name with variable <code>__name</code> | ||
** To launch barnode with the name barnode3: | ** To launch barnode with the name barnode3: <code>roslaunch foopkg barnode __name:=barnode3</code> | ||
==Executables== | ==Executables== |
Revision as of 03:32, 21 February 2019
ROS is a network-capable software platform for robotics, capable of managing processes (nodes), and exchanging information between them.
Concepts
- Package: defined by a directory containing a file package.xml (REP-0127)
- msg/MyMessageType.msg defines messages for the package, published to topics
- srv/MyServiceType.srv defines services for the package, supporting request/reply semantics
- Node: a named process that performs computation
- A running node has a type and a graph resource name
- A node is typically launched standalone using rosrun
- If a node is started with the name of an existing node, the existing node is stopped
- Master: implemented by the rosmaster package, usually started via
roscore
- Topic: a named bus on which messages of a single type are published
- A topic can be latched, meaning that new subscribers get the last message published
- Service: a named synchronous procedure, implemented by some Node
- Connections can be persistent according to the client's choice
- Parameter: a key in the global configuration dictionary
- XMLRPC data types
Names
Names aka graph resource names are unique for each topic, parameter, node, and service in the ros graph. It is a shared namespace; a topic cannot share a name with a node. The ROS_NAMESPACE environment variable can be used to scope the ros graph namespace. Names can be:
- relative,
- /global, and
- ~private (the node's name replaces the tilde)
Names can furthermore be remapped when a node is started by e.g. rosrun
.
- Special case: launch node into namespace with
__ns
- Special case: change node name with variable
__name
- To launch barnode with the name barnode3:
roslaunch foopkg barnode __name:=barnode3
- To launch barnode with the name barnode3:
Executables
- rosrun: launch an executable from a package
- roslaunch: starts collections of nodes specified in a launch XML file
- roscore: roslaunch to start core ros functionality
- rosnode: manage running nodes
rosnode list
lists running nodesrosndoe info
displays information about a running node
- rostopic: interact with topics using YAML
rostopic list
will list active topics on a running rosmasterrostopic echo
echoes messages from the topic
- rosservice: interact with services using YAML
- rosmsg: display information about message types
- rossrv: display information about services