Difference between revisions of "ROS"
(→Nodes) |
(→Topics) |
||
Line 20: | Line 20: | ||
== Topics == | == Topics == | ||
+ | A topic is a name that is used to identify the contents of a message. Messages are routed using a publish/subscribe model. A node sends out messages by ''publishing'' it to a given topic, and a node that is interested in the specific kind of data will ''subscribe'' to the appropriate topic. | ||
(what's a topic?)<br /> | (what's a topic?)<br /> | ||
(how can I interact with topics from the command line using the rostopic tool?)<br /> | (how can I interact with topics from the command line using the rostopic tool?)<br /> |
Revision as of 22:39, 10 May 2019
We use ROS to send messages between the Pi and the Due. As of April 2019, we use the Indigo Igloo version, released in 2014, on the Pi.
Starting ROS and roscore
(how do I start ROS? what is roscore?)
Nodes
A node is a process that performs computation. Each node is an independent part of your application, and they can be combined together into a graph. A robot control system will usually comprise many nodes.
Nodes can communicate with other nodes through ROS communication tools (topics, services, and actions).
Nodes provide several benefits. For one, there is fault tolerance - crashes are isolated to individual nodes. Code complexity is also reduced compared to monolithic systems. Finally, implementation details are well hidden as the nodes expose a minimal API to the rest of the graph.
How do I start a new node?
There are two levels of initialization for a roscpp Node.
First, you can initialize a node through a call to one of the ros::init()
functions.
Second, the node is started through the creation of a ros::NodeHandle
.
(how do I interact with nodes? how do I start a new node? how do I shut down a node? all nodes?)
rosserial_arduino
(what's special about this node?)
Topics
A topic is a name that is used to identify the contents of a message. Messages are routed using a publish/subscribe model. A node sends out messages by publishing it to a given topic, and a node that is interested in the specific kind of data will subscribe to the appropriate topic.
(what's a topic?)
(how can I interact with topics from the command line using the rostopic tool?)
(how can I interact with topics using nodes?)
Messages
(what's a message (aka a data type for a topic, service, etc)?)
(what are the most helpful available message types?)
(how do I work with Float32MultiArrays in Python and C++, since that's the most frequently used message?)
(how do I create my own message?)