Skip to content

BuggyROS (High Level Software) Getting Started

Joseph Wang edited this page Dec 3, 2016 · 9 revisions

So you want to code an autonomous buggy....

This page presents three topics; What BuggyROS is, a bit of Why BuggyROS is how it is, and How to use this knowledge to write something useful.

What BuggyROS is

BuggyROS is at the system-software layer. BuggyROS is a high-speed message passing system.

We will begin by defining some common vocabulary. Note that, because this code is written in Java, all of the following concepts are objects. Note that a User is a programmer who uses BuggyROS to write Robotics code.

Messages are packets of data that are passed between Nodes. Each message has a type; for example, GpsMeasurement, or BrakeCommand.

A Subscriber is an object that runs User-specified code whenever a message is received.

A Publisher is an object that takes a message and publishes it to a channel.

A Channel is a string that acts as an address that the publisher can publish messages to, or a subscriber listens to. Multiple subscribers can listen on the same channel, and multiple publishers can publish to the same channel. Only a single type of messages can be published on each channel; for example, only BrakeCommands should be published on the "Actuator.Brake" channel.

A Node contains zero or more Publishers, and zero or more Subscribers. A node can be started up by the system, and can be shutdown by the system when necessary. Nodes are 'long-lived'; at the beginning of time, when the program is just starting, all of the nodes are brought up. At the end of time, when the program is shutting down, all of the nodes are shut down.

Before you continue, make sure that the following sentences completely make sense to you:

  • A Publisher publishes messages to a channel; all of the subscribers who listen on this channel will receive the messages.
  • Multiple subscribers can listen to one channel, and multiple publishers can publish to a channel.
  • Source nodes have only publishers and no subscribers; an example of a source node is the GPS node. It receives a string message from the serial port, decodes the format into a GpsMessage, and publishes that to the "Sensors.GPS" channel.
  • Sink nodes have only subscribers and no publishers; an example of a sink node is the Steering node. It receives a message with the steering angle, and outputs bytes over serial to low-level software corresponding to this command.

Why BuggyROS is how it is

To write an Autonomous robot, you need to write multiple genres of software.

One is robotics software. Robotics software is theoretical and algorithmic in nature, but rather than being interested in the fastest ways to sort a list or the cost of rebalancing a tree in the worst case, it is interested in transforming measurements in coordinate frames, or using measurements of multiple sensors to yield a composite measurement better than any one.

Another is systems software. Systems software is written as a platform to be used by other programmers, in our case, the ones who write robotics software. System software deals with the harsh realities of computing; that data has to be operated on by different pieces of Robotics code, that operations can fail, and that we live in a world where every device has 2 or more cores. BuggyROS is systems code.

The last is embedded software. Embedded software interfaces with sensors and actuators that sense and act on the physical world. Embedded also reads and acts on messages from higher level software or other embedded components. These messages are received through physical mediums, like I2C or Serial (which RoboBuggy uses).

It is possible to write all of these sorts of softwares at the same time, but it is not efficient for the programmer. By writing each layer individually, with a clear interface or abstraction between each, we make programmers more efficient by limiting what they have to worry about at any point in time.

How to write your own Node

The below assumes a cursory knowledge of object-oriented programming (a post 15-112 knowledge is completely sufficient).

Here are the Java types of the concepts we talked about above.

String topicName;
Message

Note that these concepts are not new; They are seen in everything from real ROS, to ZeroMQ to Windows.