leo_robot: leo | leo_bringup | leo_fw

Package Summary

Firmware binary releases and update script for Leo Rover


This package contains the newest binary release of leo_firmware and the script which flashes it to the CORE2 board connected to the Raspberry Pi. The script uses a modified version of stm32loader python package, so it has to be installed on the system.


To flash the newest firmware, simply type:

rosrun leo_fw update

The script will guide you through the flashing process.

The firmware uses rosserial protocol to communicate with ROS nodes. This requires a running host-side rosserial implementation which should be already started by leo_bringup, but it can also be started manually:

rosrun rosserial_python serial_node.py _port:=/dev/serial0 _baud:=250000


Once the serial_node connects to the firmware, the firmware's ROS API should be available on the system.


Subscribed Topics

cmd_vel (geometry_msgs/Twist)
  • Target velocity of the Rover. Only linear.x (m/s) and angular.z (r/s) are used.
servoX/angle (std_msgs/Int16)
  • Angular position (in user-defined units) of servo X.
servoX/pwm (std_msgs/UInt16MultiArray)
  • Pulse duration and period (in nanoseconds) of servo X. The values are passed through data array. Publishing to pwm topic overrides angle value and vice versa.

Published Topics

wheel_odom (geometry_msgs/TwistStamped)
  • Current linear and angular velocities estimated from encoder readings.
battery (std_msgs/Float32)
  • Current battery voltage reading.
joint_states (sensor_msgs/JointState)
  • Current state of the wheel joints. The units of measurements are as follows: position in radians, velocity in radians per second, effort in the PWM duty cycle (percent).
Only if IMU is enabled:
imu/gyro (geometry_msgs/Vector3Stamped)
  • Current IMU gyroscope readings in radians per second.
imu/accel (geometry_msgs/Vector3Stamped)
  • Current IMU accelerometer readings in meters per second squared.
imu/mag (geometry_msgs/Vector3Stamped)
  • Current IMU magnetometer readings in Gauss. The axes represent the North-West-Up world frame.
Only if GPS is enabled:
gps_fix (sensor_msgs/NavSatFix)
  • A Navigation Satellite fix returned by the GPS sensor.


core2/reset_board (std_srvs/Empty)
  • Performs software reset on the CORE2 board.
core2/reset_config (std_srvs/Trigger)
  • Loads the default config and saves it to persistant storage.
core2/get_firmware_version (std_srvs/Trigger)
  • Returns the current firmware version.
core2/set_imu (std_srvs/SetBool)
  • Enables or disables the IMU sensor and saves the configuration to persistent storage. Requires a reset to apply.
core2/set_gps (std_srvs/SetBool)
  • Enables or disables the GPS sensor and saves the configuration to persistent storage. Requires a reset to apply.
core2/set_debug (std_srvs/SetBool)
  • Enables or disables debug messages. For the messages to be sent to rosout, you also need to set the logger level of rosserial node to Debug. When enabled, it can cause issues with the rosserial communication due to high throughput.
Only if IMU is enabled:
imu/calibrate_gyro_accel (std_srvs/Trigger)
  • Calibrates gyroscope and accelerometer biases and stores them in persistent storage. The IMU should lay perfectly still, parallel to the ground.
imu/calibrate_mag (std_srvs/Trigger)
  • Calibrates magnetometer scale and biases and stores them in persistent storage. Wave the IMU in a figure eight until done.


core2/diff_drive/wheel_radius (float, default: 0.0625)
  • The radius of the wheel in meters.
core2/diff_drive/wheel_separation (float, default: 0.33)
  • The distance (in meters) between the centers of the left and right wheels.
core2/diff_drive/angular_velocity_multiplier (float, default: 0.0625)
  • Upon receiving a cmd_vel command, the angular velocity is multiplied by this parameter and the calculated odometry has its angular velocity divided by this parameter. This is done to account for a difference between a two-wheel robot model and the real robot.
core2/diff_drive/input_timeout (int, default: 500)
  • The timeout (in milliseconds) for the cmd_vel commands. The differential drive controller will stop the motors if it does not receive a command within the specified time. Set it to 0 to disable the timeout.
core2/motors/encoder_resolution (float, default: 878.4)
  • The resolution of the wheel encoders in counts per rotation.
core2/motors/encoder_pullup (int, default: 1)
  • Whether to use internal pull-up for the encoder logic pins. Value of 1 means yes, any other value means no.
core2/motors/max_speed (float, default: 800.0)
  • The maximum reachable speed of the motors in encoder counts per second. Used for limiting the value passed to the wheel controllers.
core2/motors/pid/p (float, default: 0.0)
  • P constant of the motor's PID regulators.
core2/motors/pid/i (float, default: 0.005)
  • I constant of the motor's PID regulators.
core2/motors/pid/d (float, default: 0.0)
  • D constant of the motor's PID regulators.
core2/motors/power_limit (float, default: 1000.0)
  • Limit of the PWM duty applied to the motors. The value should be between 0.0 (0% duty) and 1000.0 (100% duty).
core2/motors/torque_limit (float, default: 1000.0)
  • This value applies an additional power limit depending on the current speed of the motors. The formula is as follows: power_limit = (current_speed / max_speed) * 1000.0 + torque_limit
core2/servo_voltage (int, default: 2)
  • The number describing the servo power line voltage to set. The mapping of the values and corresponding voltages is as follows: 0 - 5V, 1 - 6V, 2 - 7.4V, 3 - 8.6V
core2/servoX/period (int, default: 20000)
  • The period (in nanoseconds) of the PWM wave for servo X.
core2/servoX/angle_min (int, default: -90)
  • The minimal angle (in user-defined units) for servo X.
core2/servoX/angle_max (int, default: 90)
  • The maximal angle (in user-defined units) for servo X.
core2/servoX/width_min (int, default: 1000)
  • The width of the pulse (in nanoseconds) corresponding to the minimal angle for servo X.
core2/servoX/width_max (int, default: 2000)
  • The width of the pulse (in nanoseconds) corresponding to the maximal angle for servo X.
Only if IMU is enabled:
core2/imu_frame_id (string, default: imu)
  • The value of the frame_id field sent in the header of IMU messages.
Only if GPS is enabled:
core2/gps_frame_id (string, default: gps)
  • The value of the frame_id field sent in the header of GPS messages.

Wiki: leo_fw (last edited 2020-12-04 17:42:38 by BlazejSowa)