Skip to content

This package is designed to quickly and easily run micro-ROS on a Nucleo-F446RE board.

License

Notifications You must be signed in to change notification settings

uhobeike/micro-ros-st-nucleo-f446re

Repository files navigation

micro-ros-st-nucleo-f446re-galactic-ci

banner micro-ROS-F446RE

Intoroduction

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!

Required Environment

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

Quick start

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
STM32CubeIDE
  • Install stm32cubeide

Please download from this site. stm32cubeide-download

2. How to use this repository
git clone
git clone --recursive https://github.com/uhobeike/micro-ros-st-nucleo-f446re.git
Import your project in STM32CubeIDE
  • Launch of STM32CubeIDE
/opt/st/stm32cubeide_1.9.0/stm32cubeide

launch-stm32cubeide

  • Import project (micro-ros-st-nucleo-f446re)

import-project1

import-project2

import-project3

  • Import Complete

import-complete

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

build-project1

build-project2

build-project3

Flush

To flush the executable binary generated by Build to NUCLEO-F446RE, connect the PC to NUCLEO-F446RE via USB or other means.

  • Flushsing executable binaries to NUCLEO-F446RE

flush-1

flush-2

flush-3

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.

reset-button-push

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!

Reference

About

This package is designed to quickly and easily run micro-ROS on a Nucleo-F446RE board.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published