Skip to content

Rosserial based firmware for the LeoCore controller running inside Leo Rover.

License

Notifications You must be signed in to change notification settings

LeoRover/leocore_firmware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c744f56 · Jul 5, 2024

History

93 Commits
Aug 3, 2023
Feb 17, 2022
Aug 4, 2023
Aug 3, 2023
Jul 5, 2024
Mar 4, 2022
Oct 22, 2021
Feb 21, 2022
Feb 21, 2022
Feb 17, 2022
Dec 21, 2021
Jul 5, 2024
Dec 21, 2021

Repository files navigation

leocore_firmware

The firmware for the LeoCore controller 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, torque, PWM duty) feedback,
  • odometry feedback (calculated from wheel encoders),
  • feedback from the IMU sensor.

The project is written for PlatformIO and uses the STM32Cube embedded software libraries. The low-level code is generated by the STM32CubeMX tool.

The firmware also uses rosserial client library to expose its functionalities on ROS topics, services and parameters. For the documentation of the ROS API, visit leo_fw on the ROS wiki.

Prerequisites

To build the project, all you'll need is Visual Studio Code with the PlatformIO IDE extension.

To change the STM32CubeMX configuration, you will also need the stm32pio tool in order to properly regenerate the code.

Building

Open the project in PlatformIO IDE, then run the PlatformIO: Build task.

Flashing

Using ST-Link programmer

Connect the ST-Link to the pins on the LeoCore 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).

Using RPi on Leo Rover

Upload the .pio/build/genericSTM32F401RC/firmware.bin to Leo Rover, then, on the robot, run:

rosrun leo_fw flash firmware.bin

Modifying STM32CubeMX configuration\

Open the leocore.ioc project in STM32CubeMX, make the changes and save the project.

Don't click GENERATE CODE. Instead, type:

stm32pio generate

The current configuration assumes that STM32CubeMX is installed under /opt/STM32CubeMX. You can change the path in the stm32pio.ini file.