Skip to content

robotont/robotont_driver

Repository files navigation

robotont_driver

ROS driver package for robotont.

This package handles low-level communication between ROS and robotont hardware.

CI License

1. Starting the driver

Real robot

On a real robot, the driver is started automatically via a system service. You can perform several checks to verify that the driver is running properly.

To check the status of the service:

systemctl status robotont.service

If the driver node is running you should also see '/driver_node' in the output of:

rosnode list

In case any of the above checks should fail try restarting the service (see the robotont_support package) or launch the driver node manually:

roslaunch robotont_driver driver_basic.launch

Fake driver

In case you don't have a real robot nearby, you can run this simple dummy node that subscribes to velocity commands and publishes odometry. This driver does not know anything about physics and performs a simple integration. To start the fake driver with RViz visualization:

roslaunch robotont_driver fake_driver.launch

Gazebo simulation

For a more physics-based experience, the real robot can be replaced with a Gazebo simulation. Please see the robotont_gazebo package for further information.

2. Moving the robot using a keyboard

The drivers for the simulated and the real robot both subscribe to a cmd_vel topic. To move the robot, we have to publish velocity messages to this exact topic.

Here we use the teleop_twist_keyboard node, which translates command line keypresses to velocity messages and published these by default on cmd_vel topic. Run the node

rosrun teleop_twist_keyboard teleop_twist_keyboard.py
  • If teleop twist keyboard is not installed:
sudo apt-get install ros-noetic-teleop-twist-keyboard
  • Follow the printout in the console to learn how to control the robot. Enjoy the ride!

3. Moving the robot using an Android device

  • Find out your computer's IP address:
ifconfig
  • From your Android device, go to Google Play Store and install the ROS Control app.
  • Open the ROS Control app on your phone.
  • Add a new robot using the plus sign in the top right corner and give it a desired name.
  • Insert your computer's IP address into the Master URI field by entering the following:
http://IP_address:11311
  • Click on "Show advanced options" in the prompted window and fill in "Joystick" and "Odometry" topic names with "/robotont/cmd_vel" and "/robotont/odom", respectively.
  • Click OK to add the robot.
  • Now you can select the robot from the list and teleoperate it using the touch joystick button.

4. About the driver architecture

Communication protocol

PACKET_ID:ARG1:ARG2:...:ARGN\r\n

Available plugins

plugin_motors

This plugin subscribes to cmd_vel (<geometry_msgs::Twist>) topic and sends the RS (Robot Speed) packet with lin_vel_x, lin_vel_y, and ang_vel_z arguments to the robot.

plugin_odom

This plugin receives the ODOM packet from the robot and publishes the data on /odom (<nav_msgs::Odometry>) topic. This plugin also broadcasts an odom frame via TF.

plugin_power_supply

This plugin is responsible for publishing information about battery levels, current consumption, and other hardware status indicators. The messages are published on /robotont/power_supply (<robotont_msgs::PowerSupply>) topic.

plugin_range

A plugin for ToF range sensor addon. Publishes messages on /robotont/range (<sensor_msgs::Range>) topic.

plugin_led

A plugin for controlling the led strip addon. The plugin subscribes to /robotont/led_pixel (<robotont_msgs::LedModulePixel>) and /robotont/led_segment (<robotont_msgs::LedModuleSegment>) topics, which can be used to set the color of an individual pixel or a segment of pixels.