ROS2 packages for a 4 legged robot dog.
walking_gait_servos_off_center.MP4
This video shows a use of the
walking_gait
package, which lets you control the robot using a keyboard (to stand up, move forward, stop and possibly turn).
- Click here to see more videos of the robot in action.
SMOV can be seen as a starting point for entering the Spot Micro environment using ROS2. This is a sort of layer that allows developers to build on top of it, as most packages only deal with controlling the board, LCD and servos, leaving a small SDK to allow the user to do what they want with their robot (motion, etc...).
Join the Discord server to stay tuned.
Control of the robot is centralised in a single executable, the States package. This package, when running, listens to any message sent by a third-party package and applies it to the actual robot. In other words, this modular architecture makes it easy to control the robot and run any application.
The user can easily create another package, use the minimal SDK to control the servos through another executable, and choose what he wants his robot to do, without having to worry about numerical values, LCD control, etc... You can create your own package to control the robot according to your needs. You might even be able to publish it and share it with your colleagues and other four-legged robot creators.
You can take a look at the example and demos to get a better idea.
You can find the SMOV documentation in the documentation/ subdirectory.
Check out documentation/README.md for a quick overview.
The documentation is divided into several sections:
- Collect all the things
- Install ROS2
- Install libraries
- Configure ports
- Build the project
- Calibrate servos
- Build a Spot Micro
- Test demos
- Create your own State package
This package is designed and tested to be compatible with ROS2 Humble and ROS2 Foxy running on a Raspberry Pi. However, the project should be able to run on any platform that ROS2 supports.
Note: x86_64 systems may not be supported as this project has been designed to run on a Raspberry Pi.
Platform | Hardware | Software | Notes |
---|---|---|---|
Raspberry Pi | Pi 3 Model B+ Pi 4 Model B |
Ubuntu 22.04 LTS Ubuntu 20.04 LTS |
For the time being, the project is only being tested on the Raspberry Pi 3 Model B+ and the Raspberry Pi 4 Model B, but it should be possible to run it on other Raspberry Pis. |
Here's a simple example showing how the minimal SDK work, inspired by the State template:
#include <smov/base.h>
#include <template/template.h>
void State::on_start() {
smov::delay(2000); // Delay of 2 seconds (2000ms).
// Set all servos to 60° angle.
for (int i = 0; i < SERVO_MAX_SIZE; i++) {
front_servos.value[i] = 60.0f;
back_servos.value[i] = 60.0f;
}
// Then publishing to the States package to apply them to the real robot.
front_state_publisher->publish(front_servos);
back_state_publisher->publish(back_servos);
// You can end the program manually.
end_program();
}
// This is called every 500ms (But you can change the timeout at DECLARE_STATE_NODE_CLASS).
void State::on_loop() {}
// This is called when the program gets shutdown.
void State::on_quit() {}
// This macro creates the node and the main() input, which spins the node.
DECLARE_STATE_NODE_CLASS("template_state", State, 500ms)
There are many ways in which you can participate in this project, for example:
- Submit bugs and feature requests
- Review source code changes
- Review the documentation and make pull requests for anything from typos to additional and new content
To be able to contribute, you need to take a look at CONTRIBUTING.md to find out the conditions.
This project has adopted a Code of Conduct adapted from the Contributor Covenant to maintain cohesion. Please read the full text so that you can understand what actions will and will not be tolerated.
- The I²C PWM Board repository:
- SMOV Demos repository:
- SMOV State Template repository:
- Spot Micro AI's website: