{"id":24030333,"url":"https://github.com/neuro-mechatronics-interfaces/microros-pico","last_synced_at":"2025-02-26T03:45:03.566Z","repository":{"id":192581291,"uuid":"686471352","full_name":"Neuro-Mechatronics-Interfaces/MicroROS-PICO","owner":"Neuro-Mechatronics-Interfaces","description":"An all-in-one package for building a local MicroROS workspace and flashing a ROS2 node on a Raspberry Pi PICO ","archived":false,"fork":false,"pushed_at":"2024-06-25T21:31:42.000Z","size":133,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-08T17:45:20.754Z","etag":null,"topics":["cpp","microcontroller","microros","pico","raspberrypi-pico","ros2"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neuro-Mechatronics-Interfaces.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-02T22:50:05.000Z","updated_at":"2024-08-04T12:34:30.000Z","dependencies_parsed_at":"2023-12-22T07:34:16.198Z","dependency_job_id":"139a5668-02ef-44cd-ac25-b1a6902e1005","html_url":"https://github.com/Neuro-Mechatronics-Interfaces/MicroROS-PICO","commit_stats":null,"previous_names":["neuro-mechatronics-interfaces/microros-pico"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuro-Mechatronics-Interfaces%2FMicroROS-PICO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuro-Mechatronics-Interfaces%2FMicroROS-PICO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuro-Mechatronics-Interfaces%2FMicroROS-PICO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuro-Mechatronics-Interfaces%2FMicroROS-PICO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neuro-Mechatronics-Interfaces","download_url":"https://codeload.github.com/Neuro-Mechatronics-Interfaces/MicroROS-PICO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788775,"owners_count":19857696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","microcontroller","microros","pico","raspberrypi-pico","ros2"],"created_at":"2025-01-08T17:42:06.938Z","updated_at":"2025-02-26T03:45:03.482Z","avatar_url":"https://github.com/Neuro-Mechatronics-Interfaces.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![banner](.images/banner-dark-theme.png#gh-dark-mode-only)\n![banner](.images/banner-light-theme.png#gh-light-mode-only)\n\n\u003c!-- License\n\nCopyright 2022-2023 Neuromechatronics Lab, Carnegie Mellon University\n\nContributors: \n  Jonathan Shulgach jshulgac@andrew.cmu.edu\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at https://mozilla.org/MPL/2.0/.\n--\u003e\n\nAn all-in-one package for building a local MicroROS workspace supporting ROS2 and flashing a ROS2 node on a Raspberry Pi PICO.\n\nThese instructions were put together to make setting up a new PICO microcontroller and integrated into a larger ROS2 framework connected to a host server as painless as possible. Installation of this package has been tested with native Ubuntu 22.04 and Windows 11.\n\n## Installation\n\n These instructions should work for ROS2 distributions [Foxy](https://docs.ros.org/en/foxy/Installation.html), [Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html), and [Iron](https://docs.ros.org/en/iron/Installation.html). These install steps have been successfully tested with a [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) (Ubuntu 22.04 on Windows) session running on Windows 11 in adition to native Ununtu 22.04 OS. \n \n If any problems occur, the Raspberry Pi company has a detailed [setup manual](https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf) for further help.\n\n#### Additional steps: WSL\n\nIf using WSL to interface with physical usb devices, you will need to set up [USB pass-through](doc/markdown/installation-wsl.md) access.\n\n### Install Micro-ROS \n\nMake sure your packages are up-to-date.\n```bash\nsudo apt-get update \u0026 sudo apt-get upgrade -y\n```\nCreate the microROS workspace with a ready-to-use micro-ROS build system. This will download any required cross-compilation tools and build the apps for your system.\n```bash\n# Source the ROS 2 installation\nsource /opt/ros/$ROS_DISTRO/setup.bash\n\n# Create a workspace and download the micro-ROS tools\ncd $HOME\nmkdir -p micro_ros_ws/src\ncd micro_ros_ws\ngit clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup\n\n# Update dependencies using rosdep (note that this assumes you've already installed it through the standard ROS2 install steps)\nsudo apt update \u0026\u0026 rosdep update\nrosdep install --from-paths src --ignore-src -y\n\n# Install pip\nsudo apt-get install python3-pip\n\n# Build micro-ROS tools and source them\ncolcon build\nsource install/local_setup.bash\n```\n\n* Note: Be aware of \"End-Of-Life\" distributions. If using ROS2 Foxy which reached its EOL phase Summer of 2023, an additional parameter of `--include-eol-distros` is needed when performing the `rosdep` command\n  \n   ```bash\n   rosdep install --from-paths src --include-eol-distros --ignore-src -y\n   ```\n\nCreate the firmware workspace that targets all the required code and tools\n```bash\n# Create firmware step\nros2 run micro_ros_setup create_firmware_ws.sh host\n```\nFinally create the microROS agent package and source the workspace\n```bash\nros2 run micro_ros_setup create_agent_ws.sh\nros2 run micro_ros_setup build_agent.sh\nsource install/local_setup.bash\n```\n### Install Pico SDK\nNow let's get the latest stable release of the Pico SDK installed and configured:\n```bash\n# Install dependencies\nsudo apt install cmake g++ gcc-arm-none-eabi doxygen libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib git python3\ngit clone --recurse-submodules https://github.com/raspberrypi/pico-sdk.git $HOME/micro_ros_ws/src/pico-sdk\n\n# Configure environment\necho \"export PICO_SDK_PATH=$HOME/micro_ros_ws/src/pico-sdk\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n* Note: The Pico SDK installation downloads a handful of submodules for TinyUSB which could take up quite a bit of space on your PC. If optimization isn't a concern, continue with the installation. Otherwise, you can delete folders from the `pico-sdk/lib/hw` path and remove the board types you won't be using. Be sure to keep at least these two folders:\n   `pico-sdk/lib/hw/bsp/rp2040`\n   `pico-sdk/lib/hw/mcu/raspberry_pi`\n\nYou may get a warning that the TinyUSB submodule isn't initialized yet. If so, navigate to the pico-sdk directory and initialize the submodule:\n```\ncd $HOME/micro_ros_ws/src/pico-sdk\ngit submodule update --init\n```\n\n### Install Pre-Compiled MicroROS Pico libraries\nOnce the Pico SDK is ready, compile the example:\n\n```bash\ngit clone https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk.git $HOME/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk\ncd $HOME/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n### Flashing Code\nTo flash code onto a Pico, hold the reset button on the Pico and plug in the USB cable. The `.uf2` file that gets created in the `micro_ros_raspberrypi_pico_sdk/build` subdirectory can be moved to the RPI drive by either clicking and dragging, or with the command:\n```\ncp pico_micro_ros_example.uf2 /media/$USER/RPI-RP2\n```\n \n \n### Start MicroROS Agent\nAssuming the Pico is connected on `dev/ttyACM0`, pass that in as an argument for the serial communication method.\n```\nros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0\n```\nIf access to the port is denied, you may need to allow read/write access and add yourself to the `tty` and `dialout` groups (necessary for communicating with USB peripheral devices).\n```\nsudo chmod a+rw /dev/ttyACM0\nsudo usermod -a -G dialout $USER\nsudo usermod -a -G tty $USER\n```\n\n Contributors: \n* Jonathan Shulgach (jshulgac@andrew.cmu.edu)\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at https://mozilla.org/MPL/2.0/.\n\n\u003c!---------------------------------------------------------------------\n   References\n----------------------------------------------------------------------\u003e\n\n\n[Neuromechatronics Lab]: https://www.meche.engineering.cmu.edu/faculty/neuromechatronics-lab.html\n\n[pip install]: https://pip.pypa.io/en/stable/cli/pip_install/\n\n[microROS]: https://micro.ros.org/\n\n[microROS RaspberryPi Pre-Compiled Pico SDK]: https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk/tree/iron\n\n[Pico examples]: https://github.com/raspberrypi/pico-examples\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuro-mechatronics-interfaces%2Fmicroros-pico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuro-mechatronics-interfaces%2Fmicroros-pico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuro-mechatronics-interfaces%2Fmicroros-pico/lists"}