RoverOS is a application implemented in Java, with which one can navigate a Turtlebot in a given map with the help of a client. Basically it acts as an agent between clients and the ROS system, forwarding messages between clients and the ROS system via ROS topics.
ROS System
(hardware drivers, SLAM, navigation, etc.)
^
|
| ROS Communication Mechanism
|
v
+-----------------------------------------+---+
| | |
| ROS node (implemented using rosjava) | |
| | |
+-----------------------------------------+ R |
| | o |
| representation handling | v |
| (encoding, message translation, etc.) | e |
| | r |
+-----------------------------------------+ O |
| | S |
| WebSocket Servers | |
| | |
+-----------------------------------------+---+
^
|
| WebSocket
|
v
Client
First, make sure the ROS system is up and running. RoverOS publishes on the following topics:
/cmd_vel_mux/input/teleop
(telecontrol)/initialpose
(estimating initial pose)/move_base_simple/goal
(setting navigation goal)
and subscribes to the following topics:
/map_metadata
(retrieving map metadata)/amcl_pose
(retrieving real-time pose estimation)/camera/rgb/image_color
(monitoring through camera)
After that, start RoverOS:
java -jar <roveros .jar artifact> <.properties file>
Notice that RoverOS expects the path of .properties
file
as argument. The .properties
file contains all essential
configurations and is not optional. The properties
required are:
host
: host addressmasterURI
: URI of masternavigationServerPort
: port of navigation servervideoServerPort
: port of video servercontrolServerPort
: port of control server
The host
field can be quite confusing. Keep in mind that
it is used by other ROS nodes to reach the ROS node
of RoverOS. Therefore the other parts of ROS system
should be able to reach the host serving RoverOS using
the host
field (either an IP address or a host name).
One common mistake is to give it the value of 127.0.0.1
while some parts of ROS system is on another host.
If the whole ROS system as long as RoverOS are running
on the same host, 127.0.0.1
would be fine.
The server starts at <ip>:controlServerPort
. Once there's
at least one client connected, the server fires ROS messages
at a constant rate to control the robot. The client can send
messages to modify the speed. Notice that the client's messages
simply change the values RoverOS send to ROS system. The rate
at which RoverOS send ROS messages to ROS system is constant
and is not affected by how fast client sends messages.
- format:
{
type: "control",
linear: <double>,
angular: <double>,
}
- fields:
- type: constant value
"control"
used for dispatching - linear: floating point number as linear speed
- angular: floating point number as angular speed
- type: constant value
- Description:
- Set linear speed and angular speed. A positive linear speed makes the robot go forward and a negative one makes the robot go backward. A positive angular speed makes the robot turn left and a negative one makes the robot turn right.
- The absolute value of linear and angular speed is supposed to be less than 1.
The server starts at <ip>:navigationServerPort
.
- format:
{
type: "pose_estimate",
x: <double>,
y: <double>,
angle: <double>,
}
- fields:
- type: constant value
"pose_estimate"
used for dispatching - x: relative x coordinate (0.0 to 1.0) to left of the map
- y: relative y coordinate (0.0 to 1.0) to right of the map
- angle: direction to which robot is facing
- type: constant value
- Description:
- Estimate robot's current pose on the map, used by navigation modules. One should make estimation as close to the real pose as possible.
- The value of angle is supposed to be between 0.0 and 1.0. It corresponds to direction as follows:
0.25
^
|
0.5 <-- * --> 0.0/1.0
|
v
0.75
- format:
{
type: "navigation_goal",
x: <double>,
y: <double>,
angle: <double>,
}
- fields:
- type: constant value
"navigation_goal"
used for dispatching - x: relative x coordinate (0.0 to 1.0) to left of the map
- y: relative y coordinate (0.0 to 1.0) to right of the map
- angle: direction to which robot is facing
- type: constant value
- Description:
- Give robot a goal towards which it will navigate to.
- The robot will always follow the latest goal.
- The robot will keep trying for an impossible goal until it bumps into an obstacle for long enough to give up.
- format:
{
x: <double>,
y: <double>,
angle: <double>,
}
- fields:
- x: relative x coordinate (0.0 to 1.0) to left of the map
- y: relative y coordinate (0.0 to 1.0) to right of the map
- angle: direction to which robot is facing
- Description:
- Estimated robot's pose on the map.
The server starts at <ip>:videoServerPort
.
- format:
{
base64EncodedImageStr: <string>,
}
- fields:
- base64EncodedImageStr: base64 encoded string representing an image
- Description:
- Latest image captured by robot's camera.
- The image's encoding is JPEG.
- Implement a client (like rviz).
- Add additional functionality like map management, task management, etc.
- Implement adapter for more robot models.
- Perfect the protocol and documentation.