This package is designed to quickly and easily run micro-ROS on a Nucleo-F446RE board!
Sample code is provided as well as environment construction. Once the environment has been built, you can immediately get it running and try it out.
The sample code is ready to run publish and subscribe on std_msgs/string
and sensor_msgs/imu
!
Software | Required Version |
---|---|
STM32CubeIDE | 1.9.0 |
Linux distribution | Ubuntu 18.04 LTS or later |
Docker | 20.10.14 or later |
Hardware | URL |
---|---|
NUCLEO-F446RE | https://www.st.com/ja/evaluation-tools/nucleo-f446re.html |
1. Install required software
Docker
- Install docker
sudo apt-get update
sudo apt-get install -y curl
curl -fsSL https://get.docker.com/ | sh
docker --version
- Setup docker
sudo groupadd docker
sudo gpasswd -a $USER docker
sudo systemctl restart docker
2. How to use this repository
git clone
git clone --recursive https://github.com/uhobeike/micro-ros-st-nucleo-f446re.git
3. Build and flush
Build
Perhaps you can use this package to build on the command line, but this time we will build on the STM32CubeIDE.
- Build project
4. Execute (Welcome to the world of micro-ROS!)
Execute
ROS2 communication between PC and microcontroller using Docker environment.
- Execute micro-ROS!
docker run -it --privileged --net=host --name micro-ros ubeike/micro-ros-agent:galactic
# Executed at each terminal.
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
# If you successfully subscribe, the LED(LD2) on the F446RE will flash!
# std_msgs/string pub/sub
ros2 topic echo /f446re_string_publisher
ros2 topic pub --once /f446re_string_subscriber std_msgs/msg/String "{data: Hello! micro-ROS}"
# sensor_msgs/imu pub/sub
ros2 topic echo /f446re_imu_publisher
ros2 topic pub --once /imu/data_raw sensor_msgs/msg/Imu
- Important point
It is necessary to press the reset button on the NUCLEO-F446RE after the execution of ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
for normal communication between the NUCLEO-F446RE and the PC.
5. Let's develop
This is the part of the micro-ROS code that serves as the F446RE node. Update this one to do what you want!