Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

WARNING: Development of this repository is taken over by the micro-ROS team. Please go to the micro-ROS/micro_ros_raspberrypi_pico_sdk repository that is actively maintained.

Raspberry Pi Pico and ROS 2

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Getting Started

Here is a quick way to compile the example given in this repository.

1. Install Pico SDK

First, make sure the Pico SDK is properly installed and configured:

# Install dependencies
sudo apt install cmake gcc-arm-none-eabi doxygen libnewlib-arm-none-eabi
git clone --recurse-submodules https://github.com/raspberrypi/pico-sdk.git $HOME/pico-sdk

# Configure environment
echo "export PICO_SDK_PATH=$HOME/pico-sdk" >> ~/.bashrc
source ~/.bashrc

2. Compile Example

Once the Pico SDK is ready compile the example:

mkdir build
cd build
cmake ..
make

To flash, hold the boot button, plug the USB and run:

cp pico_micro_ros_example.uf2 /media/$USER/RPI-RP2

3. Start Micro-ROS Agent

Micro-ROS follows the client-server architecture, so you need to start the Micro-ROS Agent:

docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:foxy serial --dev /dev/ttyACM0 -b 115200

What files are relevant?

  • pico_ros.c: Contains the board specific implementation of the serial transport (no change needed).
  • CMakeLists.txt: CMake file.
  • pico_micro_ros_example.c: The actual ROS 2 publisher.

How Micro-ROS is compiled?

Micro-ROS is precompiled for Raspberry Pi Pico in uros_ws/firmware/build. If you want to compile it by yourself then check the uros_ws directory.

How to use Pico SDK?

Here is a Raspberry Pi Pico C/C++ SDK documentation:
https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-c-sdk.pdf

Owner
Darko Lukić
Robotics Software Engineer
Darko Lukić
Similar Resources

Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

Nov 10, 2021

Using a RP2040 Pico as a basic logic analyzer, exporting CSV data to read in sigrok / Pulseview

rp2040-logic-analyzer This project modified the PIO logic analyzer example that that was part of the Raspberry Pi Pico examples. The example now allow

Dec 29, 2022

I add my Pi Pico (RP2040) stuff here.

Pico Stuff I add my Pi Pico (RP2040) stuff here. There are complete apps and libraries for sensors or complicated tasks. Libraries BMP180: Header-only

Jan 8, 2023

uSDR implementation based on a RP2040 Pi Pico

uSDR-pico A uSDR implementation based on a RP2040 Pi Pico. This code is experimental, intended to investigate how the HW and SDK work with an applicat

Jan 7, 2023

This is some utility functions/classes for having a nice way to communicate with a pico board RP2040

PicoScreenTerminal This is some utility functions/classes for having a nice way to communicate with a pico board RP2040 How to build First follow the

Nov 15, 2021

RPi Pico/RP2040 firmware for the Scoppy Oscilloscope

scoppy-pico RPi Pico/RP2040 firmware for the Scoppy Oscilloscope Installation and getting started instructions Scoppy Android app - Play Store Scoppy

Dec 20, 2022

Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103

Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103

ZeroBug - DIY Hexapod Robot Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103. The Pi Zero is in charge

Dec 22, 2022

Boilerplate to create a project with: STM32 + Ethernet + micro-ROS + FreeRTOS + Arduino + PlatformIO

Boilerplate to create a project with:  STM32 + Ethernet + micro-ROS + FreeRTOS + Arduino + PlatformIO

micro_ros_stm32_template Boilerplate to create a project with: STM32 + Ethernet + micro-ROS + FreeRTOS + Arduino + PlatformIO Default config STM32F407

Aug 29, 2022

Example of how to setup micro-ROS on any STM32 microcontroller

Setting up micro-ROS on any STM32 microcontroller This repository gives an example of how to set up micro-ROS on any STM32 microcontroller. For this r

Jan 9, 2023
Raspberry Pi Pico Arduino core, for all RP2040 boards
Raspberry Pi Pico Arduino core, for all RP2040 boards

Arduino-Pico Raspberry Pi Pico Arduino core, for all RP2040 boards This is a port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem

Jan 5, 2023
Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡

pico-lorawan Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board using a Semtech SX1276 radio module. Based on the Semte

Dec 30, 2022
#PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit
#PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit

PICOmputer #PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit https://www.pcbway.com/project/shareproject/_PICOmputer____World_firs

Dec 30, 2022
Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

pico-microphone Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. ?? Hardware RP2040 board Raspberry Pi Pico Microp

Dec 27, 2022
USB host implementation using PIO of raspberry pi pico (RP2040).

Pico-PIO-USB USB host implementation using PIO of raspberry pi pico (RP2040). You can add additional USB port to RP2040. ?? This library is WIP. API m

Dec 30, 2022
This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip.

Pico SPI Utilities This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip. While th

Aug 7, 2022
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display

pico-display-matrix Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display or how to actually use all Flash

Sep 10, 2022
Tetris on a Raspberry Pi Pico mounted on a Pimoroni Pico Explorer

PicoTetris Classic Tetris game running on a Raspberry Pi Pico microcontroller. Pico C port by Richard Birkby Original JavaScript implementation - Jake

Dec 3, 2022
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

Oct 15, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Dec 23, 2022