Note: It's recommended to run each command one line at a time to avoid errors and make debugging easier.
Run the following commands to install required packages:
sudo apt install build-essential
sudo apt install cmake
sudo apt install gcc-arm-none-eabi
sudo apt install libnewlib-arm-none-eabi
sudo apt install doxygen
sudo apt install git
sudo apt install python3-
Visit the micro-ROS Pico GitHub page.
-
Scroll to the Dependencies section and find the GCC ARM Embedded Toolchain (version 9.3.1 or similar).
-
Download the archive (e.g.,
.bz2file) by right-clicking and saving it. -
Extract the archive.
-
Move the extracted folder to your home directory:
mv gcc-arm-none-eabi-9-2020-q2-update ~/ -
Add the toolchain path to your
~/.bashrc:export PICO_TOOLCHAIN_PATH=$HOME/gcc-arm-none-eabi-9-2020-q2-update/
-
Apply the changes:
source ~/.bashrc
-
Download the SDK:
cd ~ git clone --recurse-submodules https://github.com/raspberrypi/pico-sdk.git
-
Add the SDK path to your
~/.bashrc:export PICO_SDK_PATH=$HOME/pico-sdk
-
Apply the changes:
source ~/.bashrc
-
Run the following commands:
cd ~ git clone https://github.com/raspberrypi/picotool.git cd picotool mkdir build cd build cmake .. make sudo make install
-
Verify the installation:
picotool
If installed correctly, this command will display usage information.
Create a new directory and clone the project repository:
mkdir -p ~/micro_ros_ws/src
cd ~/micro_ros_ws/src
git clone https://github.com/RIPLaboratoryUH/PicoMicroROSBNO055.gitThis will create a workspace directory and download the project files you'll use to build and flash micro-ROS on the Raspberry Pi Pico.
Now navigate to your micro-ROS folder, create a build directory, and compile the project.
Important: Make any necessary changes to this setup before running the build commands in this step.
The three main files you may want to edit are:
CMakeLists.txtpico_micro_ros_example.cpicow_udp_transports.hFor example, if you're using a Raspberry Pi Pico 2W instead of a Pico W, you need to modify line 2 of
CMakeLists.txttoset(PICO_BOARD pico2_w)fromset(PICO_BOARD pico_w).You also need to update your SSID and WiFi password in
pico_micro_ros_example.c. This is also where you include how your sensor operates.Also you need to update your IP address in
picow_udp_transports.txt.
Run the following commands to build your project:
cd ~/micro_ros_ws/src/PicoMicroRos/
mkdir build
cd build
cmake ..
makeTo flash the compiled program to your Pico:
-
Hold down the BOOTSEL button on the Pico as you plug it into your computer via USB.
The Pico should mount as a USB mass storage device. -
Run the appropriate command based on your device:
cd ~/micro_ros_ws/src/PicoMicroRos/build/
cp ./pico_micro_ros_example.uf2 /media/$USER/RPI-RP2cd ~/micro_ros_ws/src/PicoMicroRos/build/
cp ./pico_micro_ros_example.uf2 /media/$USER/RP2350This will copy the compiled .uf2 binary to your Pico, flashing the firmware.
To build static libraries for micro-ROS, you'll need Docker.
-
Follow the official Docker installation guide for Ubuntu:
👉 Install Docker on Ubuntu -
Once Docker is successfully installed, pull the micro-ROS static library builder image by running:
sudo docker pull microros/micro_ros_static_library_builder:jazzyYou’re now ready to run the micro-ROS agent and communicate with your Pico.
- Disconnect the Pico from USB and power it externally.
- Then run the following command to launch the micro-ROS agent on your host machine:
sudo docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:jazzy udp4 --dev -p 8891⏱️ Note: The Pico is programmed to search for the host agent for 1 minute after startup. You can change this duration in the source code if needed.
- If you have ROS 2 installed, verify communication by listing active topics:
ros2 topic listYou should now see your micro-ROS topic in the list.