Package Summary
Firmware binary releases and update script for Leo Rover
- Maintainer status: maintained
- Maintainer: Fictionlab <support AT fictionlab DOT pl>
- Author: Błażej Sowa <blazej AT fictionlab DOT pl>
- License: MIT
- Bug / feature tracker: https://github.com/LeoRover/leo_robot/issues
- Source: git https://github.com/LeoRover/leo_robot.git (branch: melodic)
Package Summary
Binary releases of Leo Rover firmware and related utilities
- Maintainer status: maintained
- Maintainer: Fictionlab <support AT fictionlab DOT pl>
- Author: Błażej Sowa <blazej AT fictionlab DOT pl>, Aleksander Szymański <aleks AT fictionlab DOT pl>
- License: MIT
- Bug / feature tracker: https://github.com/LeoRover/leo_robot/issues
- Source: git https://github.com/LeoRover/leo_robot.git (branch: master)
Contents
Overview
This package contains the newest binary releases of leocore_firmware and core2_firmware and the script which flashes it to the LeoCore or 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.
Usage
Flashing firmware
To flash the newest firmware, simply type:
rosrun leo_fw update
To flash the firmware from file, use the flash script:
rosrun leo_fw flash firmware.bin
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.
The ROS API differs between the firmwares released for Noetic and Melodic distributions. Make sure you read the correct section.
ROS API (Noetic)
firmware
Subscribed Topics
cmd_vel (geometry_msgs/Twist)- Target velocity of the Rover. Only linear.x (m/s) and angular.z (r/s) are used.
- Sets the PWM duty cycle (in %) of the individual wheel.
- Sets the target velocity (in rad/s) of the individual wheel.
Available only in the firmware for the CORE2 board:
- Angular position (in user-defined units) of servo X.
- 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
firmware/wheel_odom (leo_msgs/WheelOdom)- Odometry calculated from encoder readings.
- Current battery voltage reading.
- Battery voltage estimated from averaging readings from last 30 seconds.
- Current states of the wheels (position, velocity, torque, PWM duty cycle).
- Current IMU gyroscope readings in radians per second.
Services
firmware/reset_odometry (std_srvs/Trigger)- Resets the pose published on the firmware/wheel_odom topic.
- Performs software reset of the board.
- Returns the board type codename (either leocore or core2).
- Returns the current firmware version.
Parameters
firmware/diff_drive/wheel_radius (float, default: 0.0625)- The radius of the wheel in meters.
- The distance (in meters) between the centers of the left and right wheels.
- 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.
- 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.
- The resolution of the wheel encoders in counts per rotation.
- P constant of the motor's PID regulators.
- I constant of the motor's PID regulators.
- D constant of the motor's PID regulators.
- Limit of the PWM duty cycle (in %) applied to the motors. The value should be between 0.0 and 100.0.
- If the battery voltage drops below this value, the firmware will signal it by flickering the battery LED.
Available only in the firmware for the CORE2 board:
- 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
- The period (in nanoseconds) of the PWM wave for servo X.
- The minimal angle (in user-defined units) for servo X.
- The maximal angle (in user-defined units) for servo X.
- The width of the pulse (in nanoseconds) corresponding to the minimal angle for servo X.
- The width of the pulse (in nanoseconds) corresponding to the maximal angle for servo X.
firmware_message_converter
A node that subscribes for the messages published by the firmware and converts them to message types commonly used in ROS.Subscribed Topics
firmware/wheel_states (leo_msgs/WheelStates)Published Topics
joint_states (sensor_msgs/JointState)- Converted from firmware/wheel_states.
- Converted from firmware/wheel_odom.
- Converted from firmware/imu.
Parameters
robot_frame_id (string, default: "base_link")- The TF frame id representing the robot. Used in the child_frame_id field of the wheel_odom_with_covariance messages.
- The odom TF frame id. Used in the header.frame_id field of the wheel_odom_with_covariance messages.
- The TF frame id representing the IMU sensor. Used in the header.frame_id field of the imu/data_raw messages.
- The prefix added to each published TF frame id.
- Names of the wheel joints. Used in the name field of joint_states messages.
- The diagonal of the twist.covariance matrix used in the wheel_odom_with_covariance messages.
- The diagonal of the angular_velocity_covariance matrix used in the imu/data_raw messages.
- The diagonal of the linear_acceleration_covariance matrix used in the imu/data_raw messages.
ROS API (Melodic)
firmware
Subscribed Topics
cmd_vel (geometry_msgs/Twist)- Target velocity of the Rover. Only linear.x (m/s) and angular.z (r/s) are used.
- Angular position (in user-defined units) of servo X.
- 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.
- A 2D pose of the robot estimated from the wheel velocities.
- Current battery voltage reading.
- 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:
- Current IMU gyroscope readings in radians per second.
- Current IMU accelerometer readings in meters per second squared.
- Current IMU magnetometer readings in Gauss. The axes represent the North-West-Up world frame.
Only if GPS is enabled:
- A Navigation Satellite fix returned by the GPS sensor.
Services
core2/reset_odometry (std_srvs/Trigger)- Resets the pose published on the wheel_pose topic.
- Performs software reset on the CORE2 board.
- Loads the default config and saves it to persistant storage.
- Returns the current firmware version.
- Enables or disables the IMU sensor and saves the configuration to persistent storage. Requires a reset to apply.
- Enables or disables the GPS sensor and saves the configuration to persistent storage. Requires a reset to apply.
- 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:
- Calibrates gyroscope and accelerometer biases and stores them in persistent storage. The IMU should lay perfectly still, parallel to the ground.
- Calibrates magnetometer scale and biases and stores them in persistent storage. Wave the IMU in a figure eight until done.
Parameters
core2/diff_drive/wheel_radius (float, default: 0.0625)- The radius of the wheel in meters.
- The distance (in meters) between the centers of the left and right wheels.
- 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.
- 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.
- The resolution of the wheel encoders in counts per rotation.
- Whether to use internal pull-up for the encoder logic pins. Value of 1 means yes, any other value means no.
- The maximum reachable speed of the motors in encoder counts per second. Used for limiting the value passed to the wheel controllers.
- P constant of the motor's PID regulators.
- I constant of the motor's PID regulators.
- D constant of the motor's PID regulators.
- Limit of the PWM duty applied to the motors. The value should be between 0.0 (0% duty) and 1000.0 (100% duty).
- 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
- 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
- The period (in nanoseconds) of the PWM wave for servo X.
- The minimal angle (in user-defined units) for servo X.
- The maximal angle (in user-defined units) for servo X.
- The width of the pulse (in nanoseconds) corresponding to the minimal angle for servo X.
- The width of the pulse (in nanoseconds) corresponding to the maximal angle for servo X.
- The value of the frame_id field sent in the header of wheel_odom messages.
- The value of the frame_id field sent in the header of wheel_pose messages.
Only if IMU is enabled:
- The value of the frame_id field sent in the header of IMU messages.
Only if GPS is enabled:
- The value of the frame_id field sent in the header of GPS messages.