The firmware for the Husarion CORE2 board running inside Leo Rover.
The main functionalities include:
- velocity commands for the robot,
- velocity and PWM commands for individual wheels,
- battery voltage feedback,
- wheel states (position, velocity, PWM duty) feedback,
- odometry feedback (calculated from wheel encoders).
The project is written for PlatformIO and uses Mbed OS as the RTOS. It also uses rcl+rclc as a client library with Micro XRCE-DDS as a middleware to expose its functionalities on ROS topics, services and parameters.
For the documentation of the ROS API, visit leo_fw on the ROS wiki.
To build the project, all you'll need is Visual Studio Code with the PlatformIO IDE extension.
Open the project in PlatformIO IDE, then run the PlatformIO: Build
task.
Connect the ST-Link to the pins on Husarion CORE2 debug pin header, then run the PlatformIO: Upload
task.
You can also run the GDB debugger by running the PIO Debug
launch configuration (or just clicking F5
).
Upload the .pio/build/core2/firmware.bin
to Leo Rover, then, on the robot, run:
ros2 run leo_fw flash firmware.bin
To expose the Micro-ROS node to the ROS2 network, you need to run the Micro-ROS Agent on RPi. Build the package using colcon and then run:
ros2 run micro_ros_agent micro_ros_agent serial -D /dev/serial0 -b 460800