├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ └── general-issue.md └── workflows │ ├── ci.yml │ ├── nightly.yml │ └── pr.yml ├── .gitignore ├── .images └── microros_logo.png ├── 3rd-party-licenses.txt ├── CHANGELOG.rst ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── config ├── agent_ros2_packages.txt ├── agent_uros_packages.repos ├── android │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ └── generic │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml ├── client_ros2_packages.txt ├── client_uros_packages.repos ├── freertos │ ├── crazyflie21 │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ ├── esp32 │ │ ├── README.md │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ ├── list_apps.sh │ ├── nucleo_f446re │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ ├── nucleo_f446ze │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ ├── nucleo_f746zg │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ ├── nucleo_f767zi │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml │ └── olimex-stm32-e407 │ │ ├── board.repos │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml ├── generate_lib │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ └── generic │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── create.sh │ │ ├── demo_toolchain.cmake │ │ ├── flash.sh │ │ └── package.xml ├── host │ ├── client_ros2_packages.txt │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ └── generic │ │ ├── build.sh │ │ ├── client-host-colcon.meta │ │ ├── client_host_packages.repos │ │ ├── create.sh │ │ ├── flash.sh │ │ └── package.xml ├── raspbian │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ └── generic │ │ ├── build.sh │ │ ├── client-colcon.meta │ │ ├── client_uros_packages.repos │ │ ├── configure.sh │ │ ├── create.sh │ │ ├── flash.sh │ │ └── supported_platforms ├── utils.sh └── zephyr │ ├── dev_ros2_packages.txt │ ├── dev_uros_packages.repos │ ├── generic │ ├── board.repos │ ├── build.sh │ ├── client-colcon.meta │ ├── client_uros_packages.repos │ ├── configure.sh │ ├── create.sh │ ├── flash.sh │ ├── package.xml │ └── supported_platforms │ └── list_apps.sh ├── package.xml └── scripts ├── build_agent.sh ├── build_firmware.sh ├── clean_env.sh ├── component ├── configure_firmware.sh ├── create_agent_ws.sh ├── create_firmware_ws.sh ├── create_ws.sh ├── flash_firmware.sh └── yaml_filter.py /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @pablogs9 @jamoralp @FranFin 2 | config/freertos/nucleo_f446ze/ @alsaibie 3 | config/freertos/esp32/ @donRaphaco 4 | config/freertos/nucleo_f746zg/ @edesta-be 5 | config/freertos/nucleo_f767zi/ @jnugen 6 | config/freertos/nucleo_f446re/ @RTrioux -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General issue 3 | about: General issue template for micro-ROS 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Issue template 11 | 12 | - Hardware description: 13 | - RTOS: 14 | - Installation type: 15 | - Version or commit hash: 16 | 17 | #### Steps to reproduce the issue 18 | 19 | 20 | #### Expected behavior 21 | 22 | #### Actual behavior 23 | 24 | #### Additional information 25 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | ci_target_ref: 7 | required: true 8 | type: string 9 | 10 | env: 11 | ROS_DISTRO: kilted 12 | 13 | jobs: 14 | 15 | micro_ros_build: 16 | runs-on: ubuntu-latest 17 | container: 18 | image: ubuntu:24.04 19 | strategy: 20 | fail-fast: false 21 | steps: 22 | - uses: actions/checkout@v4 23 | with: 24 | path: src/micro_ros_setup 25 | ref: ${{ inputs.ci_target_ref }} 26 | 27 | - uses: ros-tooling/setup-ros@0.7.13 28 | with: 29 | use-ros2-testing: false 30 | required-ros-distributions: ${{ env.ROS_DISTRO }} 31 | 32 | - name: Dependencies 33 | run: | 34 | apt update 35 | rosdep update --rosdistro ${{ env.ROS_DISTRO }} 36 | rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y 37 | 38 | - name: Build 39 | run: | 40 | . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh 41 | colcon build 42 | 43 | - name: Install micro-ROS build system 44 | run: | 45 | (test -f install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh) && true || false 46 | 47 | - name: Sanitize Artifact Name 48 | id: sanitize-name 49 | run: | 50 | sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') 51 | echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV 52 | echo "::set-output name=sanitized_name::$sanitized_name" 53 | 54 | - uses: actions/upload-artifact@v4.4.0 55 | with: 56 | name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} 57 | path: install 58 | 59 | micro_ros_agent: 60 | runs-on: ubuntu-latest 61 | container: 62 | image: ubuntu:24.04 63 | strategy: 64 | fail-fast: false 65 | needs: micro_ros_build 66 | 67 | steps: 68 | - uses: actions/checkout@v4 69 | with: 70 | path: src/micro_ros_setup 71 | ref: ${{ inputs.ci_target_ref }} 72 | 73 | - uses: ros-tooling/setup-ros@0.7.13 74 | with: 75 | use-ros2-testing: false 76 | required-ros-distributions: ${{ env.ROS_DISTRO }} 77 | 78 | - name: dependencies 79 | run: | 80 | apt update 81 | apt install -y ros-${{ env.ROS_DISTRO }}-rmw-fastrtps-cpp 82 | rosdep update --rosdistro ${{ env.ROS_DISTRO }} 83 | rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y 84 | 85 | - name: Sanitize Artifact Name 86 | id: sanitize-name 87 | run: | 88 | sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') 89 | echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV 90 | echo "::set-output name=sanitized_name::$sanitized_name" 91 | 92 | - uses: actions/download-artifact@v4.1.7 93 | with: 94 | name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} 95 | path: install 96 | 97 | # Workaround https://github.com/actions/upload-artifact/issues/38 98 | - run: | 99 | chmod +x -R install 100 | 101 | - name: build 102 | run: | 103 | . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh 104 | . install/local_setup.sh 105 | ros2 run micro_ros_setup create_agent_ws.sh 106 | ros2 run micro_ros_setup build_agent.sh 107 | 108 | - name: installation 109 | run: | 110 | (test -f install/micro_ros_agent/lib/micro_ros_agent/micro_ros_agent) && true || false 111 | 112 | micro_ros_client: 113 | runs-on: ubuntu-latest 114 | needs: micro_ros_build 115 | container: 116 | image: ubuntu:24.04 117 | strategy: 118 | fail-fast: false 119 | matrix: 120 | include: 121 | - rtos: host 122 | platform: null 123 | configuration: null 124 | transport_arguments: null 125 | binary: 'install/micro_ros_demos_rclc/lib/micro_ros_demos_rclc/int32_publisher/int32_publisher' 126 | 127 | - rtos: generate_lib 128 | platform: null 129 | configuration: null 130 | transport_arguments: null 131 | build_arguments: $(pwd)/src/micro_ros_setup/config/generate_lib/generic/demo_toolchain.cmake 132 | binary: 'firmware/build/libmicroros.a' 133 | 134 | - rtos: freertos 135 | platform: crazyflie21 136 | configuration: crazyflie_position_publisher 137 | transport_arguments: -t serial -d 1 138 | binary: 'firmware/freertos_apps/microros_crazyflie21_extensions/cf2.bin' 139 | 140 | - rtos: freertos 141 | platform: olimex-stm32-e407 142 | configuration: int32_publisher 143 | transport_arguments: -t serial -d 1 144 | binary: 'firmware/freertos_apps/microros_olimex_e407_extensions/build/micro-ROS.elf' 145 | 146 | - rtos: freertos 147 | platform: nucleo_f446re 148 | configuration: int32_publisher 149 | transport_arguments: -t serial -d 1 150 | binary: 'firmware/freertos_apps/microros_nucleo_f446re_extensions/build/micro-ROS.elf' 151 | 152 | - rtos: freertos 153 | platform: nucleo_f446ze 154 | configuration: int32_publisher 155 | transport_arguments: -t serial -d 1 156 | binary: 'firmware/freertos_apps/microros_nucleo_f446ze_extensions/build/micro-ROS.elf' 157 | 158 | - rtos: freertos 159 | platform: nucleo_f746zg 160 | configuration: int32_publisher 161 | transport_arguments: -t serial -d 1 162 | binary: 'firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/micro-ROS.elf' 163 | 164 | - rtos: freertos 165 | platform: nucleo_f767zi 166 | configuration: int32_publisher 167 | transport_arguments: -t serial -d 1 168 | binary: 'firmware/freertos_apps/microros_nucleo_f767zi_extensions/build/micro-ROS.elf' 169 | 170 | - rtos: freertos 171 | platform: esp32 172 | configuration: int32_publisher 173 | transport_arguments: -t serial -d 1 174 | binary: 'firmware/freertos_apps/microros_esp32_extensions/build/int32_publisher.elf' 175 | 176 | - rtos: zephyr 177 | platform: olimex-stm32-e407 178 | configuration: int32_publisher 179 | transport_arguments: -t serial-usb 180 | binary: 'firmware/build/zephyr/zephyr.bin' 181 | 182 | - rtos: zephyr 183 | platform: discovery_l475_iot1 184 | configuration: int32_publisher 185 | transport_arguments: -t serial-usb 186 | binary: 'firmware/build/zephyr/zephyr.bin' 187 | 188 | - rtos: zephyr 189 | platform: nucleo_h743zi 190 | configuration: int32_publisher 191 | transport_arguments: -t serial -d 3 192 | binary: 'firmware/build/zephyr/zephyr.bin' 193 | 194 | - rtos: zephyr 195 | platform: nucleo_f746zg 196 | configuration: int32_publisher 197 | transport_arguments: -t serial -d 3 198 | binary: 'firmware/build/zephyr/zephyr.bin' 199 | 200 | - rtos: zephyr 201 | platform: host 202 | configuration: ping_pong 203 | transport_arguments: -t udp -i 192.168.1.1 -p 8080 204 | binary: 'firmware/build/zephyr/zephyr.exe' 205 | 206 | - rtos: raspbian 207 | platform: buster_v7 208 | configuration: agent_lite 209 | binary: 'firmware/bin/micro_ros_agent_lite' 210 | 211 | - rtos: raspbian 212 | platform: buster_v7 213 | configuration: weather_publisher 214 | binary: 'firmware/bin/weather_publisher' 215 | 216 | steps: 217 | - uses: actions/checkout@v4 218 | with: 219 | path: src/micro_ros_setup 220 | ref: ${{ inputs.ci_target_ref }} 221 | 222 | - uses: ros-tooling/setup-ros@0.7.13 223 | with: 224 | use-ros2-testing: false 225 | required-ros-distributions: ${{ env.ROS_DISTRO }} 226 | 227 | - name: Dependencies 228 | run: | 229 | apt update 230 | apt upgrade -y 231 | rosdep update --rosdistro ${{ env.ROS_DISTRO }} 232 | rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y 233 | 234 | - name: Sanitize Artifact Name 235 | id: sanitize-name 236 | run: | 237 | sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') 238 | echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV 239 | echo "::set-output name=sanitized_name::$sanitized_name" 240 | 241 | - uses: actions/download-artifact@v4.1.7 242 | with: 243 | name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} 244 | path: install 245 | 246 | # Workaround https://github.com/actions/upload-artifact/issues/38 247 | - run: | 248 | chmod +x -R install 249 | 250 | - name: Configure and build micro-ROS 251 | run: | 252 | . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh 253 | . install/local_setup.sh 254 | ros2 run micro_ros_setup create_firmware_ws.sh ${{ matrix.rtos }} ${{ matrix.platform }} 255 | ros2 run micro_ros_setup configure_firmware.sh ${{ matrix.configuration }} ${{ matrix.transport_arguments }} 256 | ros2 run micro_ros_setup build_firmware.sh ${{ matrix.build_arguments }} 257 | 258 | - name: Check binaries 259 | run: | 260 | (test -f ${{ matrix.binary }}) && true || false 261 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: Nightly 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | name: 7 | description: "Manual trigger" 8 | schedule: 9 | - cron: '0 4 * * *' 10 | 11 | jobs: 12 | 13 | Kilted: 14 | uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@kilted 15 | with: 16 | ci_target_ref: 'kilted' 17 | 18 | Jazzy: 19 | uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@jazzy 20 | with: 21 | ci_target_ref: 'jazzy' 22 | 23 | Rolling: 24 | uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@rolling 25 | with: 26 | ci_target_ref: 'rolling' 27 | 28 | Humble: 29 | uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@humble 30 | with: 31 | ci_target_ref: 'humble' 32 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request CI 2 | 3 | on: 4 | pull_request: 5 | paths-ignore: 6 | - 'README.md' 7 | branches: 8 | - '**' 9 | 10 | jobs: 11 | 12 | CI: 13 | uses: ./.github/workflows/ci.yml 14 | with: 15 | ci_target_ref: ${{ github.event.pull_request.head.ref }} 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /.images/microros_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micro-ROS/micro_ros_setup/304b3fea6b3ab63dbb7038b08133517296b0fb05/.images/microros_logo.png -------------------------------------------------------------------------------- /3rd-party-licenses.txt: -------------------------------------------------------------------------------- 1 | Third Party Licenses 2 | ==================== 3 | 4 | This repository does not directly contain 3rd party source code. 5 | 6 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package micro_ros_setup 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 5.0.0 (2023-06-12) 6 | ------------------ 7 | * Update to rolling repositories (`#649 `_) 8 | * Replace ros2 repo with micro-ROS fork (`#642 `_) 9 | * Support Segger J-Link to flash Olimex E407 (`#635 `_) (`#640 `_) 10 | * Fix nigthly build (`#634 `_) (`#639 `_) 11 | * Add rosidl_dynamic_typesupport to rolling (`#629 `_) 12 | * Deprecate galactic CI and fix Zephyr build (`#625 `_) 13 | * Remove galactic from CI (`#624 `_) 14 | * Fix ros2_tracing build (`#628 `_) 15 | * Add reference to micro-ROS book chapter. (`#612 `_) 16 | * Add RT-Thread to Readme (`#604 `_) (`#607 `_) 17 | 18 | 4.0.2 (2022-09-28) 19 | ------------------ 20 | * Add rosidl_core (`#573 `_) 21 | * Remove unnessary check (`#553 `_) 22 | * Fix Nightly CMake (`#555 `_) (`#556 `_) 23 | 24 | 4.0.1 (2022-07-14) 25 | ------------------ 26 | * Add component command (`#540 `_) (`#541 `_) 27 | * Fix CI host (`#535 `_) (`#536 `_) 28 | 29 | 4.0.0 (2022-05-25) 30 | ------------------ 31 | * Fix PyYaml unistall error (`#521 `_) (`#522 `_) 32 | * Add renesas dummy meta (`#516 `_) 33 | * Fix readme rosdep (`#506 `_) 34 | * Update Readme Rolling (`#492 `_) 35 | * Modified zephyr create.sh to pull correct toolchain based on arch (`#499 `_) (`#500 `_) 36 | * Remove Python 3.9 (`#496 `_) 37 | * Fix CMake install in jammy (`#493 `_) 38 | * Typo 39 | * Fix CI upgrade ROS docker (backport `#489 `_) (`#490 `_) 40 | * Fix Agent and host Rolling CI (`#486 `_) 41 | * Enable rolling agent (`#479 `_) 42 | * Contributors: Pablo Garrido, mergify[bot] 43 | 44 | 3.0.0 (2022-03-28) 45 | ------------------ 46 | * Initial release -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(micro_ros_setup) 3 | 4 | # Default to C99 5 | if(NOT CMAKE_C_STANDARD) 6 | set(CMAKE_C_STANDARD 99) 7 | endif() 8 | 9 | # Default to C++14 10 | if(NOT CMAKE_CXX_STANDARD) 11 | set(CMAKE_CXX_STANDARD 14) 12 | endif() 13 | 14 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 15 | add_compile_options(-Wall -Wextra -Wpedantic) 16 | endif() 17 | 18 | # find dependencies 19 | find_package(ament_cmake REQUIRED) 20 | # uncomment the following section in order to fill in 21 | # further dependencies manually. 22 | # find_package( REQUIRED) 23 | 24 | if(BUILD_TESTING) 25 | find_package(ament_lint_auto REQUIRED) 26 | # the following line skips the linter which checks for copyrights 27 | # uncomment the line when a copyright and license is not present in all source files 28 | #set(ament_cmake_copyright_FOUND TRUE) 29 | # the following line skips cpplint (only works in a git repo) 30 | # uncomment the line when this package is not in a git repo 31 | #set(ament_cmake_cpplint_FOUND TRUE) 32 | ament_lint_auto_find_test_dependencies() 33 | endif() 34 | 35 | ament_package() 36 | 37 | install( 38 | DIRECTORY config DESTINATION . USE_SOURCE_PERMISSIONS 39 | ) 40 | 41 | install( 42 | PROGRAMS 43 | scripts/create_ws.sh 44 | scripts/create_agent_ws.sh 45 | scripts/create_firmware_ws.sh 46 | scripts/configure_firmware.sh 47 | scripts/flash_firmware.sh 48 | scripts/build_firmware.sh 49 | scripts/build_agent.sh 50 | scripts/yaml_filter.py 51 | scripts/clean_env.sh 52 | scripts/component 53 | DESTINATION lib/${PROJECT_NAME} 54 | ) 55 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Want to contribute? Great! You can do so through the standard GitHub pull 4 | request model. For large contributions we do encourage you to file a ticket in 5 | the GitHub issues tracking system prior to any code development to coordinate 6 | with the system_modes development team early in the process. Coordinating up 7 | front helps to avoid frustration later on. 8 | 9 | Your contribution must be licensed under the Apache-2.0 license, the license 10 | used by this project. 11 | 12 | ## Add / retain copyright notices 13 | 14 | Include a copyright notice and license in each new file to be contributed, 15 | consistent with the style used by this project. If your contribution contains 16 | code under the copyright of a third party, document its origin, license, and 17 | copyright holders. 18 | 19 | ## Sign your work 20 | 21 | This project tracks patch provenance and licensing using a modified Developer 22 | Certificate of Origin (DCO; from [OSDL][DCO]) and Signed-off-by tags initially 23 | developed by the Linux kernel project. 24 | 25 | ``` 26 | system_modes Developer's Certificate of Origin. Version 1.0 27 | 28 | By making a contribution to this project, I certify that: 29 | 30 | (a) The contribution was created in whole or in part by me and I 31 | have the right to submit it under the "Apache License, Version 2.0" 32 | ("Apache-2.0"); or 33 | 34 | (b) The contribution is based upon previous work that is covered by 35 | an appropriate open source license and I have the right under 36 | that license to submit that work with modifications, whether 37 | created in whole or in part by me, under the Apache-2.0 license; 38 | or 39 | 40 | (c) The contribution was provided directly to me by some other 41 | person who certified (a) or (b) and I have not modified it. 42 | 43 | (d) I understand and agree that this project and the contribution 44 | are public and that a record of the contribution (including all 45 | metadata and personal information I submit with it, including my 46 | sign-off) is maintained indefinitely and may be redistributed 47 | consistent with this project and the requirements of the Apache-2.0 48 | license or any open source license(s) involved, where they are 49 | relevant. 50 | 51 | (e) I am granting the contribution to this project under the terms of 52 | Apache-2.0. 53 | 54 | http://www.apache.org/licenses/LICENSE-2.0 55 | ``` 56 | 57 | With the sign-off in a commit message you certify that you authored the patch 58 | or otherwise have the right to submit it under an open source license. The 59 | procedure is simple: To certify above system_modes Developer's Certificate of 60 | Origin 1.0 for your contribution just append a line 61 | 62 | Signed-off-by: Random J Developer 63 | 64 | to every commit message using your real name or your pseudonym and a valid 65 | email address. 66 | 67 | If you have set your `user.name` and `user.email` git configs you can 68 | automatically sign the commit by running the git-commit command with the `-s` 69 | option. There may be multiple sign-offs if more than one developer was 70 | involved in authoring the contribution. 71 | 72 | For a more detailed description of this procedure, please see 73 | [SubmittingPatches][] which was extracted from the Linux kernel project, and 74 | which is stored in an external repository. 75 | 76 | ### Individual vs. Corporate Contributors 77 | 78 | Often employers or academic institution have ownership over code that is 79 | written in certain circumstances, so please do due diligence to ensure that 80 | you have the right to submit the code. 81 | 82 | If you are a developer who is authorized to contribute to system_modes on 83 | behalf of your employer, then please use your corporate email address in the 84 | Signed-off-by tag. Otherwise please use a personal email address. 85 | 86 | ## Maintain Copyright holder / Contributor list 87 | 88 | Each contributor is responsible for identifying themselves in the 89 | [NOTICE](NOTICE) file, the project's list of copyright holders and authors. 90 | Please add the respective information corresponding to the Signed-off-by tag 91 | as part of your first pull request. 92 | 93 | If you are a developer who is authorized to contribute to system_modes on 94 | behalf of your employer, then add your company / organization to the list of 95 | copyright holders in the [NOTICE](NOTICE) file. As author of a corporate 96 | contribution you can also add your name and corporate email address as in the 97 | Signed-off-by tag. 98 | 99 | If your contribution is covered by this project's DCO's clause "(c) The 100 | contribution was provided directly to me by some other person who certified 101 | (a) or (b) and I have not modified it", please add the appropriate copyright 102 | holder(s) to the [NOTICE](NOTICE) file as part of your contribution. 103 | 104 | 105 | [DCO]: http://web.archive.org/web/20070306195036/http://osdlab.org/newsroom/press_releases/2004/2004_05_24_dco.html 106 | 107 | [SubmittingPatches]: https://github.com/wking/signed-off-by/blob/7d71be37194df05c349157a2161c7534feaf86a4/Documentation/SubmittingPatches 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | 2 | # This is the official list of copyright holders and authors. 3 | # 4 | # Often employers or academic institutions have ownership over code that is 5 | # written in certain circumstances, so please do due diligence to ensure that 6 | # you have the right to submit the code. 7 | # 8 | # When adding J Random Contributor's name to this file, either J's name on its 9 | # own or J's name associated with J's organization's name should be added, 10 | # depending on whether J's employer (or academic institution) has ownership 11 | # over code that is written for this project. 12 | # 13 | # How to add names to this file: 14 | # Individual's name . 15 | # 16 | # If Individual's organization is copyright holder of her contributions add the 17 | # organization's name, optionally also the contributor's name: 18 | # 19 | # Organization's name 20 | # Individual's name 21 | # 22 | # Please keep the list sorted. 23 | 24 | eProsima 25 | Jose Antonio Moral 26 | Pablo Garrido 27 | 28 | Jakob Friedl 29 | 30 | Robert Bosch GmbH 31 | Ingo Lütkebohle 32 | Ralph Lange 33 | 34 | Robert Wilbrandt 35 | 36 | Boston Engineering 37 | Connor Lansdale 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 |
6 | 7 | This ROS 2 package is the entry point for building micro-ROS apps for different embedded platforms. 8 | 9 | - [Supported platforms](#supported-platforms) 10 | - [Standalone build system tools](#standalone-build-system-tools) 11 | - [Dependencies](#dependencies) 12 | - [Quick start](#quick-start) 13 | - [Building](#building) 14 | - [Creating micro-ROS firmware](#creating-micro-ros-firmware) 15 | - [Configuring micro-ROS firmware](#configuring-micro-ros-firmware) 16 | - [Building micro-ROS firmware](#building-micro-ros-firmware) 17 | - [Flashing micro-ROS firmware](#flashing-micro-ros-firmware) 18 | - [Building micro-ROS-Agent](#building-micro-ros-agent) 19 | - [Contributing](#contributing) 20 | - [Purpose of the Project](#purpose-of-the-project) 21 | - [License](#license) 22 | - [Known Issues / Limitations](#known-issues--limitations) 23 | - [Papers](#papers) 24 | 25 | # Supported platforms 26 | 27 | This package provides tools and utils to crosscompile micro-ROS with just the common ROS 2 tools for the following platforms. 28 | 29 | **Note that this package provides basic support only, intended in particular for ROS developers who are new to microcontrollers. Micro-ROS [components for each platform](#standalone-build-system-tools) are available and provide a deeper and more flexible integration with the platform-specific build systems.** 30 | 31 | | RTOS | Platform | Version | Example | Recommended Alternative | 32 | | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | 33 | | [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F446RE](https://www.st.com/en/evaluation-tools/nucleo-f446re.html) 1 | STM32CubeMX latest | `freertos nucleo_f446re` | **[micro-ROS utils for STM32CubeMX and STM32CubeIDE](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils)** | 34 | | [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F446ZE](https://www.st.com/en/evaluation-tools/nucleo-f446ze.html) 1 | STM32CubeMX latest | `freertos nucleo_f446ze` | **[micro-ROS utils for STM32CubeMX and STM32CubeIDE](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils)** | 35 | | [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F746ZG](https://www.st.com/en/evaluation-tools/nucleo-f746zg.html) 1 | STM32CubeMX latest | `freertos nucleo_f746zg` | **[micro-ROS utils for STM32CubeMX and STM32CubeIDE](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils)** | 36 | | [FreeRTOS](https://www.freertos.org/) | [ST Nucleo F767ZI](https://www.st.com/en/evaluation-tools/nucleo-f746zg.html) 1 | STM32CubeMX latest | `freertos nucleo_f767zi` | **[micro-ROS utils for STM32CubeMX and STM32CubeIDE](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils)** | 37 | | [FreeRTOS](https://www.freertos.org/) | [Espressif ESP32](https://www.espressif.com/en/products/socs/esp32/overview) | v8.2.0 | `freertos esp32` | **[micro-ROS component for ESP-IDF](https://github.com/micro-ROS/micro_ros_espidf_component)** | 38 | | [FreeRTOS](https://www.freertos.org/) | [Crazyflie 2.1](https://www.bitcraze.io/crazyflie-2-1/) | v10.2.1 - CF 2020.06 | `freertos crazyflie21` | | 39 | | [Zephyr](https://www.zephyrproject.org/) | [Olimex STM32-E407](https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware) | v2.6.0 | `zephyr olimex-stm32-e407` | **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)** | 40 | | [Zephyr](https://www.zephyrproject.org/) | [ST Nucleo F446RE](https://www.st.com/en/evaluation-tools/nucleo-f446re.html) 1 | v2.6.0 | `zephyr nucleo_f446re` | **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)** | 41 | | [Zephyr](https://www.zephyrproject.org/) | [ST B-L475E-IOT01A](https://docs.zephyrproject.org/latest/boards/arm/disco_l475_iot1/doc/index.html) | v2.6.0 | `zephyr discovery_l475_iot1` | **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)** | 42 | | [Zephyr](https://www.zephyrproject.org/) | [ST Nucleo H743ZI](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html) 1 | v2.6.0 | `zephyr nucleo_h743zi` | **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)** | 43 | | [Zephyr](https://www.zephyrproject.org/) | [Zephyr emulator](https://docs.zephyrproject.org/2.3.0/boards/posix/native_posix/doc/index.html) | v2.6.0 | `zephyr host` | **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)** | 44 | | - | Static library (.a) and headers (.h) 3 | - | `generate_lib` | | 45 | | Linux | *Host 2* | Ubuntu 18.04/20.04 | `host` | | 46 | | Android | [AOSP](https://source.android.com) 1 | Latest | `android generic` | | 47 | 48 | *1 Community supported, may have lack of official support* 49 | 50 | *2 Support for compiling apps in a native Linux host for testing and debugging* 51 | 52 | *3 a valid CMake toolchain with custom crosscompilation definition is required* 53 | 54 | ## Standalone build system tools 55 | 56 | `micro_ros_setup` provides access to standalone build system tools using the `component` command. 57 | After [building this package](#building) just run: 58 | 59 | ```bash 60 | ros2 run micro_ros_setup component --help 61 | ``` 62 | 63 | micro-ROS standalone module for specific platforms are: 64 | 65 | - a standalone **[micro-ROS component for Renesas e2 studio and RA6M5](https://github.com/micro-ROS/micro_ros_renesas2estudio_component)**: this package enables the integration of micro-ROS in Renesas e2 studio and RA6M5 MCU family. 66 | - a standalone **[micro-ROS component for ESP-IDF](https://github.com/micro-ROS/micro_ros_espidf_component)**: this package enables the integration of micro-ROS in any Espressif ESP32 IDF project. 67 | - a standalone **[micro-ROS module for Zephyr RTOS](https://github.com/micro-ROS/micro_ros_zephyr_module)**: this package enables the integration of micro-ROS in any Zephyr RTOS workspace. 68 | - a standalone **[micro-ROS module for Mbed RTOS](https://github.com/micro-ROS/micro_ros_mbed)**: this package enables the integration of micro-ROS in any Mbed RTOS workspace. 69 | - a standalone **[micro-ROS module for NuttX RTOS](https://github.com/micro-ROS/micro_ros_nuttx_app)**: this package enables the integration of micro-ROS in any NuttX RTOS workspace. 70 | - a standalone **[micro-ROS module for Microsoft Azure RTOS](https://github.com/micro-ROS/micro_ros_azure_rtos_app)**: this package enables the integration of micro-ROS in a Microsoft Azure RTOS workspace. 71 | - a standalone **[micro-ROS module for RT-Thread RTOS](https://github.com/micro-ROS/micro_ros_rtthread_component)**: this package enables the integration of micro-ROS in a RT-Thread workspace. 72 | - a standalone **[micro-ROS app for TI Tiva™ C Series](https://github.com/micro-ROS/micro_ros_tivac_launchpad_app)**: this package enables the integration of micro-ROS in a exas Instruments Tiva™ C Series. 73 | - a set of **[micro-ROS utils for STM32CubeMX and STM32CubeIDE](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils)**: this package enables the integration of micro-ROS in STM32CubeMX and STM32CubeIDE. 74 | - a library builder for **[PlatformIO](https://github.com/micro-ROS/micro_ros_platformio)**: this package enables the integration of micro-ROS in PlatformIO. 75 | - a precompiled set of **[Arduino IDE libraries](https://github.com/micro-ROS/micro_ros_arduino)**: this package enables the integration of micro-ROS in the Arduino IDE for some hardware platforms. 76 | - a precompiled set of **[Raspberry Pi Pico SDK libraries](https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk)**: this package enables the integration of micro-ROS in the Raspberry Pi Pico SDK. 77 | 78 | # Dependencies 79 | 80 | This package targets the **ROS 2** installation. ROS 2 supported distributions are: 81 | 82 | | ROS 2 Distro | State | Branch | 83 | | ------------ | --------- | ---------- | 84 | | Crystal | EOL | `crystal` | 85 | | Dashing | EOL | `dashing` | 86 | | Foxy | EOL | `foxy` | 87 | | Galactic | EOL | `galactic` | 88 | | Humble | Supported | `humble` | 89 | | Iron | EOL | `iron` | 90 | | Jazzy | Supported | `jazzy` | 91 | | Kilted | Supported | `kilted` | 92 | | Rolling | Supported | `rolling` | 93 | 94 | Some other prerequisites needed for building a firmware using this package are: 95 | 96 | ``` 97 | sudo apt install python3-rosdep 98 | ``` 99 | 100 | Building for Android needs [Latest Android NDK](https://developer.android.com/ndk/downloads) to be installed and the following environment variables to be set: 101 | - ```ANDROID_ABI```: CPU variant, refer [here](https://developer.android.com/ndk/guides/abis) for details. 102 | - ```ANDROID_NATIVE_API_LEVEL```: Android platform version, refer [here](https://developer.android.com/ndk/guides/cmake#android_native_api_level) for details. 103 | - ```ANDROID_NDK```: root path of the installed NDK. 104 | 105 | # Quick start 106 | 107 | Download [here](https://www.eprosima.com/index.php/downloads-all) the micro-ROS docker image that contains a pre-installed client and agent as well as some compiled examples. 108 | 109 | # Building 110 | 111 | Create a ROS 2 workspace and build this package for a given ROS 2 distro (see table above): 112 | 113 | ```bash 114 | source /opt/ros/$ROS_DISTRO/setup.bash 115 | 116 | mkdir uros_ws && cd uros_ws 117 | 118 | git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup 119 | 120 | rosdep update && rosdep install --from-paths src --ignore-src -y 121 | 122 | colcon build 123 | 124 | source install/local_setup.bash 125 | ``` 126 | 127 | Once the package is built, the firmware scripts are ready to run. 128 | 129 | You can find tutorials for moving your first steps with micro-ROS on an RTOS in the [micro-ROS webpage](https://micro-ros.github.io/docs/tutorials/core/first_application_rtos/). 130 | 131 | 132 | ## Creating micro-ROS firmware 133 | 134 | Using the `create_firmware_ws.sh [RTOS] [Platform]` command, a firmware folder will be created with the required code for building a micro-ROS app. For example, for our reference platform, the invocation is: 135 | 136 | ```bash 137 | # Creating a FreeRTOS + micro-ROS firmware workspace 138 | ros2 run micro_ros_setup create_firmware_ws.sh freertos olimex-stm32-e407 139 | 140 | # Creating a Zephyr + micro-ROS firmware workspace 141 | ros2 run micro_ros_setup create_firmware_ws.sh zephyr olimex-stm32-e407 142 | ``` 143 | 144 | ## Configuring micro-ROS firmware 145 | 146 | By running `configure_firmware.sh` command the installed firmware is configured and modified in a pre-build step. This command will show its usage if parameters are not provided: 147 | 148 | ``` 149 | ros2 run micro_ros_setup configure_firmware.sh [configuration] [options] 150 | ``` 151 | 152 | By running this command without any argument the available demo applications and configurations will be shown. 153 | 154 | Common options available at this configuration step are: 155 | - `--transport` or `-t`: `udp`, `serial` or any hardware specific transport label 156 | - `--dev` or `-d`: agent string descriptor in a serial-like transport (optional) 157 | - `--ip` or `-i`: agent IP in a network-like transport (optional) 158 | - `--port` or `-p`: agent port in a network-like transport (optional) 159 | 160 | 161 | Please note that each RTOS has its configuration approach that you might use for further customization of these base configurations. Visit the [micro-ROS webpage](https://micro-ros.github.io/docs/tutorials/core/first_application_rtos/) for detailed information about RTOS configuration. 162 | 163 | In summary, the supported configurations for transports are: 164 | 165 | | | FreeRTOS | Zephyr | 166 | | ----------------------------- | :---------------: | :----------------: | 167 | | Olimex STM32-E407 | UART, Network | USB, UART | 168 | | ST B-L475E-IOT01A | - | USB, UART, Network | 169 | | Crazyflie 2.1 | Custom Radio Link | - | 170 | | Espressif ESP32 | UART, WiFI UDP | - | 171 | | ST Nucleo F446RE 1 | UART | UART | 172 | | ST Nucleo F446ZE 1 | UART | - | 173 | | ST Nucleo H743ZI 1 | - | UART | 174 | | ST Nucleo F746ZG 1 | UART | UART | 175 | | ST Nucleo F767ZI 1 | UART | - | 176 | 177 | *1 Community supported, may have lack of official support* 178 | 179 | ## Building micro-ROS firmware 180 | 181 | By running `build_firmware.sh` the firmware is built: 182 | 183 | ``` 184 | ros2 run micro_ros_setup build_firmware.sh 185 | ``` 186 | 187 | ## Flashing micro-ROS firmware 188 | 189 | In order to flash the target platform run `flash_firmware.sh` command. 190 | This step may need some platform-specific procedure to boot the platform in flashing mode: 191 | 192 | ``` 193 | ros2 run micro_ros_setup flash_firmware.sh 194 | ``` 195 | 196 | # Building micro-ROS-Agent 197 | 198 | Using this package is possible to install a ready to use **micro-ROS-Agent**: 199 | 200 | ``` 201 | ros2 run micro_ros_setup create_agent_ws.sh 202 | ros2 run micro_ros_setup build_agent.sh 203 | source install/local_setup.sh 204 | ros2 run micro_ros_agent micro_ros_agent [parameters] 205 | ``` 206 | 207 | # Contributing 208 | 209 | As it is explained along this document, the firmware building system takes **four steps**: creating, configuring, building and flashing. 210 | 211 | New combinations of platforms and RTOS are intended to be included in `config` folder. For example, the scripts for building a **micro-ROS** app for **Crazyflie 2.1** using **FreeRTOS** is located in `config/freertos/crazyflie21`. 212 | 213 | This folder contains up to four scripts: 214 | - `create.sh`: gets a variable named `$FW_TARGETDIR` and installs in this path all the dependencies and code required for the firmware. 215 | - `configure.sh`: modifies and configure parameters of the installed dependencies. This step is **optional**. 216 | - `build.sh`: builds the firmware and create a platform-specific linked binary. 217 | - `flash.sh`: flashes the binary in the target platform. 218 | 219 | Some other required files inside the folder can be accessed from these scripts using the following paths: 220 | 221 | ```bash 222 | # Files inside platform folder 223 | $PREFIX/config/$RTOS/$PLATFORM/ 224 | 225 | # Files inside config folder 226 | $PREFIX/config 227 | ``` 228 | 229 | # Purpose of the Project 230 | 231 | This software is not ready for production use. It has neither been developed nor 232 | tested for a specific use case. However, the license conditions of the 233 | applicable Open Source licenses allow you to adapt the software to your needs. 234 | Before using it in a safety relevant setting, make sure that the software 235 | fulfills your requirements and adjust it according to any applicable safety 236 | standards, e.g., ISO 26262. 237 | 238 | # License 239 | 240 | This repository is open-sourced under the Apache-2.0 license. See the [LICENSE](LICENSE) file for details. 241 | 242 | For a list of other open-source components included in ROS 2 system_modes, 243 | see the file [3rd-party-licenses.txt](3rd-party-licenses.txt). 244 | 245 | # Known Issues / Limitations 246 | 247 | There are no known limitations. 248 | 249 | If you find issues, [please report them](https://github.com/micro-ROS/micro_ros_setup/issues). 250 | 251 | # Papers 252 | 253 | If you want to cite micro-ROS, please cite the following book chapter ([PDF available at Springer Link](https://doi.org/10.1007/978-3-031-09062-2_2)): 254 | 255 | Kaiwalya Belsare, Antonio Cuadros Rodriguez, Pablo Garrido Sánchez, Juanjo Hierro, Tomasz Kołcon, Ralph Lange, Ingo Lütkebohle, Alexandre Malki, Jaime Martin Losa, Francisco Melendez, Maria Merlan Rodriguez, Arne Nordmann, Jan Staschulat, and Julian von Mendel: Micro-ROS. In: _Anis Koubaa (ed.) Robot Operating System (ROS): The Complete Reference (Volume 7),_ Springer, pp. 3–55, 2023. (Online since 2 February 2023.) 256 | 257 | ```bibtex 258 | @INBOOK{Belsare_et_al_2023_Micro-ROS, 259 | author = {Kaiwalya Belsare and Antonio Cuadros Rodriguez and Pablo Garrido S\'{a}nchez and Juanjo Hierro 260 | and Tomasz Ko\l{}con and Ralph Lange and Ingo L\"{u}tkebohle and Alexandre Malki 261 | and Jaime Martin Losa and Francisco Melendez and Maria Merlan Rodriguez and Arne Nordmann 262 | and Jan Staschulat and and Julian von Mendel}, 263 | title = {Micro-ROS}, 264 | editor = {Anis Koubaa}, 265 | booktitle = {Robot Operating System (ROS): The Complete Reference (Volume 7)}, 266 | year = {2023}, 267 | publisher = {Springer}, 268 | pages = {3--55}, 269 | doi = {10.1007/978-3-031-09062-2_2} 270 | } 271 | ``` 272 | -------------------------------------------------------------------------------- /config/agent_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | none -------------------------------------------------------------------------------- /config/agent_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | uros/micro_ros_msgs: 3 | type: git 4 | url: https://github.com/micro-ROS/micro_ros_msgs.git 5 | version: kilted 6 | uros/micro-ROS-Agent: 7 | type: git 8 | url: https://github.com/micro-ROS/micro-ROS-Agent.git 9 | version: kilted 10 | uros/drive_base: 11 | type: git 12 | url: https://github.com/micro-ROS/drive_base.git 13 | version: master 14 | -------------------------------------------------------------------------------- /config/android/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ament/ament_cmake 3 | ament/ament_index 4 | ament/ament_lint 5 | ament/ament_package 6 | ament/googletest 7 | ament/osrf_pycommon 8 | ament/uncrustify_vendor 9 | ros2/ament_cmake_ros -------------------------------------------------------------------------------- /config/android/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/android/generic/build.sh: -------------------------------------------------------------------------------- 1 | . $PREFIX/config/utils.sh 2 | 3 | if [ $# -ge 1 ]; then 4 | TOOLCHAIN=$1 5 | else 6 | echo "Syntax: ros2 run micro_ros_setup build_firmware.sh [Colcon meta file]" 7 | exit 1 8 | fi 9 | 10 | if [ $# -ge 2 ]; then 11 | COLCON_META=$2 12 | echo "Using provided meta: $COLCON_META" 13 | 14 | else 15 | COLCON_META=$FW_TARGETDIR/mcu_ws/colcon.meta 16 | echo "Using default meta: $COLCON_META" 17 | fi 18 | 19 | 20 | BUILD_DIR=$FW_TARGETDIR/build 21 | 22 | pushd $FW_TARGETDIR/mcu_ws >/dev/null 23 | 24 | # Set these variables according to your own environment. 25 | if [ -z ${ANDROID_ABI+x} ]; then 26 | ANDROID_ABI=arm64-v8a 27 | fi 28 | if [ -z ${ANDROID_NATIVE_API_LEVEL+x} ]; then 29 | ANDROID_NATIVE_API_LEVEL=android-30 30 | fi 31 | if [ -z ${ANDROID_NDK+x} ]; then 32 | ANDROID_NDK=~/android-ndk-r23 33 | fi 34 | 35 | # rm -rf build install log 36 | 37 | colcon build --packages-up-to micro_ros_demos_rclc \ 38 | --merge-install \ 39 | --packages-ignore-regex=.*_cpp \ 40 | --metas $COLCON_META \ 41 | --cmake-args \ 42 | "--no-warn-unused-cli" \ 43 | -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF \ 44 | -DBUILD_SHARED_LIBS=ON \ 45 | -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ 46 | -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \ 47 | -DANDROID_FUNCTION_LEVEL_LINKING=OFF \ 48 | -DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL} \ 49 | -DANDROID_STL=c++_shared \ 50 | -DANDROID_ABI=${ANDROID_ABI} \ 51 | -DANDROID_NDK=${ANDROID_NDK} \ 52 | -DANDROID=ON \ 53 | -DTHIRDPARTY=ON \ 54 | -DBUILD_TESTING=OFF \ 55 | -DBUILD_MEMORY_TOOLS=OFF \ 56 | -DBUILD_MEMORY_TESTS=OFF \ 57 | -DCMAKE_BUILD_TYPE=Release \ 58 | -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON 59 | 60 | popd >/dev/null 61 | 62 | -------------------------------------------------------------------------------- /config/android/generic/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names":{ 3 | "microxrcedds_client":{ 4 | "cmake-args":[ 5 | "-DBUILD_SHARED_LIBS=ON", 6 | "-DUCLIENT_PROFILE_MULTITHREAD=ON" 7 | ] 8 | }, 9 | "microcdr":{ 10 | "cmake-args":[ 11 | "-DBUILD_SHARED_LIBS=ON" 12 | ] 13 | }, 14 | "rosidl_typesupport_microxrcedds_c":{ 15 | "cmake-args":[ 16 | "-DBUILD_SHARED_LIBS=ON" 17 | ] 18 | }, 19 | "rosidl_typesupport_microxrcedds_cpp":{ 20 | "cmake-args":[ 21 | "-DBUILD_SHARED_LIBS=ON" 22 | ] 23 | }, 24 | "rclc_parameter":{ 25 | "cmake-args":[ 26 | "-DBUILD_SHARED_LIBS=ON" 27 | ] 28 | }, 29 | "rcutils":{ 30 | "cmake-args":[ 31 | "-DENABLE_TESTING=OFF" 32 | ] 33 | }, 34 | "rmw_microxrcedds":{ 35 | "cmake-args":[ 36 | "-DRMW_UXRCE_TRANSPORT=udp", 37 | "-DRMW_UXRCE_DEFAULT_UDP_IP=127.0.0.1", 38 | "-DRMW_UXRCE_DEFAULT_UDP_PORT=8888", 39 | "-DRMW_UXRCE_MAX_NODES=15", 40 | "-DRMW_UXRCE_MAX_PUBLISHERS=15", 41 | "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=15", 42 | "-DRMW_UXRCE_MAX_SERVICES=15", 43 | "-DRMW_UXRCE_MAX_CLIENTS=15", 44 | "-DRMW_UXRCE_STREAM_HISTORY=32", 45 | "-DRMW_UXRCE_MAX_HISTORY=10" 46 | ] 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /config/android/generic/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | eProsima/Micro-CDR: 3 | type: git 4 | url: https://github.com/eProsima/Micro-CDR.git 5 | version: ros2 6 | eProsima/Micro-XRCE-DDS-Client: 7 | type: git 8 | url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git 9 | version: ros2 10 | 11 | # MicroROS 12 | uros/rcl: 13 | type: git 14 | url: https://github.com/micro-ROS/rcl 15 | version: kilted 16 | uros/rclc: 17 | type: git 18 | url: https://github.com/ros2/rclc 19 | version: kilted 20 | uros/micro_ros_utilities: 21 | type: git 22 | url: https://github.com/micro-ROS/micro_ros_utilities 23 | version: kilted 24 | uros/rcutils: 25 | type: git 26 | url: https://github.com/micro-ROS/rcutils 27 | version: kilted 28 | uros/micro_ros_msgs: 29 | type: git 30 | url: https://github.com/micro-ROS/micro_ros_msgs.git 31 | version: kilted 32 | uros/rmw_microxrcedds: 33 | type: git 34 | url: https://github.com/micro-ROS/rmw-microxrcedds.git 35 | version: kilted 36 | uros/rosidl_typesupport: 37 | type: git 38 | url: https://github.com/micro-ROS/rosidl_typesupport.git 39 | version: kilted 40 | uros/rosidl_typesupport_microxrcedds: 41 | type: git 42 | url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git 43 | version: kilted 44 | uros/micro-ROS-demos: 45 | type: git 46 | url: https://github.com/micro-ROS/micro-ROS-demos.git 47 | version: kilted 48 | -------------------------------------------------------------------------------- /config/android/generic/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | 3 | # ignore broken packages 4 | touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE 5 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 6 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 7 | touch mcu_ws/ros2_tracing/test_tracetools/COLCON_IGNORE 8 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 9 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 10 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 11 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 12 | 13 | popd >/dev/null 14 | -------------------------------------------------------------------------------- /config/android/generic/flash.sh: -------------------------------------------------------------------------------- 1 | echo "No flash step" 2 | echo "Please find library and includes inside firmware/build folder" -------------------------------------------------------------------------------- /config/android/generic/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for Android 7 | Joel Cao 8 | APL2 9 | 10 | gperf 11 | wget 12 | 13 | -------------------------------------------------------------------------------- /config/client_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ros2/rcl 3 | ros2/rmw 4 | ros2/rosidl_defaults 5 | ros2/rosidl 6 | ros2/rosidl_dds 7 | ros2/rmw_implementation 8 | ros2/common_interfaces 9 | ros2/libyaml_vendor 10 | ros2/rcl_interfaces 11 | ros2/unique_identifier_msgs 12 | ros2/rcl_logging 13 | ros2/test_interface_files 14 | ros2/example_interfaces 15 | ros2/rcpputils 16 | ros2/rosidl_core 17 | ros2/ros2_tracing 18 | ros2/rosidl_dynamic_typesupport -------------------------------------------------------------------------------- /config/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | eProsima/Micro-CDR: 3 | type: git 4 | url: https://github.com/eProsima/Micro-CDR.git 5 | version: ros2 6 | eProsima/Micro-XRCE-DDS-Client: 7 | type: git 8 | url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git 9 | version: ros2 10 | 11 | # MicroROS 12 | uros/rcl: 13 | type: git 14 | url: https://github.com/micro-ROS/rcl 15 | version: kilted 16 | uros/rclc: 17 | type: git 18 | url: https://github.com/ros2/rclc 19 | version: kilted 20 | uros/micro_ros_utilities: 21 | type: git 22 | url: https://github.com/micro-ROS/micro_ros_utilities 23 | version: kilted 24 | uros/rcutils: 25 | type: git 26 | url: https://github.com/micro-ROS/rcutils 27 | version: kilted 28 | uros/micro_ros_msgs: 29 | type: git 30 | url: https://github.com/micro-ROS/micro_ros_msgs.git 31 | version: kilted 32 | uros/rmw_microxrcedds: 33 | type: git 34 | url: https://github.com/micro-ROS/rmw-microxrcedds.git 35 | version: kilted 36 | uros/rosidl_typesupport: 37 | type: git 38 | url: https://github.com/micro-ROS/rosidl_typesupport.git 39 | version: kilted 40 | uros/rosidl_typesupport_microxrcedds: 41 | type: git 42 | url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git 43 | version: kilted 44 | -------------------------------------------------------------------------------- /config/freertos/crazyflie21/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | crazyflie_firmware: 3 | type: git 4 | url: https://github.com/bitcraze/crazyflie-firmware 5 | version: 2020.06 6 | 7 | freertos_apps: 8 | type: git 9 | url: https://github.com/micro-ROS/freertos_apps 10 | version: kilted 11 | 12 | -------------------------------------------------------------------------------- /config/freertos/crazyflie21/build.sh: -------------------------------------------------------------------------------- 1 | CF_DIR=$FW_TARGETDIR/crazyflie_firmware 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_crazyflie21_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | pushd $CF_DIR >/dev/null 7 | git submodule init 8 | git submodule update 9 | popd >/dev/null 10 | 11 | pushd $EXTENSIONS_DIR >/dev/null 12 | 13 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 14 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 15 | 16 | if [ -d "$UROS_APP_FOLDER" ]; then 17 | echo "Selected app: $UROS_APP" 18 | else 19 | echo "App not found: $UROS_APP" 20 | print_available_apps 21 | exit 1 22 | fi 23 | 24 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "$FW_TARGETDIR/mcu_ws/build" ]; then 25 | # Clean micro-ROS build 26 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 27 | 28 | # Clean build 29 | make clean 30 | 31 | # Build micro-ROS stack 32 | make libmicroros 33 | fi 34 | 35 | # build firmware 36 | make -j$(nproc) PLATFORM=cf2 CLOAD=0 UROS_APP_FOLDER=$UROS_APP_FOLDER PYTHON=python3 37 | popd >/dev/null 38 | -------------------------------------------------------------------------------- /config/freertos/crazyflie21/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names":{ 3 | "rcutils":{ 4 | "cmake-args":[ 5 | "-DENABLE_TESTING=OFF", 6 | "-DRCUTILS_NO_FILESYSTEM=ON", 7 | "-DRCUTILS_NO_LOGGING=ON", 8 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 9 | "-DRCUTILS_NO_64_ATOMIC=ON" 10 | ] 11 | }, 12 | "microxrcedds_client":{ 13 | "cmake-args":[ 14 | "-DUCLIENT_PIC=OFF", 15 | "-DUCLIENT_PROFILE_DISCOVERY=OFF", 16 | "-DUCLIENT_PROFILE_UDP=OFF", 17 | "-DUCLIENT_PROFILE_TCP=OFF" 18 | ] 19 | }, 20 | "rmw_microxrcedds":{ 21 | "cmake-args":[ 22 | "-DRMW_UXRCE_TRANSPORT=custom" 23 | ] 24 | }, 25 | "tracetools": { 26 | "cmake-args": [ 27 | "-DTRACETOOLS_DISABLED=ON", 28 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 29 | ] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /config/freertos/crazyflie21/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/crazyflie21/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_crazyflie21_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 7 | 8 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 9 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 10 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 11 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 12 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 13 | 14 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" -------------------------------------------------------------------------------- /config/freertos/crazyflie21/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | # Install toolchain 6 | echo "Downloading ARM compiler, this may take a while" 7 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 8 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 9 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 10 | 11 | # Import repos 12 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 13 | 14 | # ignore broken packages 15 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 16 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 17 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 18 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 19 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 20 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 21 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 22 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 23 | 24 | popd >/dev/null -------------------------------------------------------------------------------- /config/freertos/crazyflie21/flash.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR/freertos_apps/microros_crazyflie21_extensions > /dev/null 2 | 3 | if [ -f cf2.bin ]; then 4 | echo "Flashing firmware for $RTOS platform $PLATFORM" 5 | dfu-util -d 0483:df11 -a 0 -s 0x08000000 -D cf2.bin 6 | else 7 | echo "cf2.bin not found: please compile before flashing." 8 | fi 9 | 10 | popd > /dev/null 11 | 12 | -------------------------------------------------------------------------------- /config/freertos/crazyflie21/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and Crazyflie 2.1 7 | Pablo Garrido 8 | APL2 9 | 10 | dfu-util 11 | ed 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/freertos/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ament/ament_cmake 3 | ament/ament_index 4 | ament/ament_lint 5 | ament/ament_package 6 | ament/googletest 7 | ament/osrf_pycommon 8 | ament/uncrustify_vendor 9 | ros2/ament_cmake_ros 10 | -------------------------------------------------------------------------------- /config/freertos/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/freertos/esp32/README.md: -------------------------------------------------------------------------------- 1 | # Notes for ESP32 2 | 3 | - ESP32 does only have serial ports 0-2 (where UART0 is used for stdout by default) 4 | - You can run idf targets like `menuconfig` or `monitor` by specifing the target as an argument to the `build_firmware.sh` script 5 | - The GPIO pins for the configured serial port can be set with `menuconfig` (see `micro-ROS Transport Settings` menu) 6 | - ESP32 only runs in singlecore mode (`CONFIG_FREERTOS_UNICORE=y` setting) 7 | -------------------------------------------------------------------------------- /config/freertos/esp32/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ROS/freertos_apps 5 | version: kilted 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /config/freertos/esp32/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_esp32_extensions 2 | 3 | # Source virtualenv 4 | source $FW_TARGETDIR/venv/bin/activate 5 | 6 | . $PREFIX/config/utils.sh 7 | 8 | export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif 9 | export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf 10 | 11 | eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) 12 | 13 | . $IDF_PATH/export.sh 14 | 15 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 16 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 17 | 18 | if [ -d "$UROS_APP_FOLDER" ]; then 19 | echo "Selected app: $UROS_APP" 20 | else 21 | echo "App not found: $UROS_APP" 22 | print_available_apps 23 | exit 1 24 | fi 25 | 26 | pushd $EXTENSIONS_DIR/build >/dev/null 27 | make $@ 28 | popd >/dev/null 29 | -------------------------------------------------------------------------------- /config/freertos/esp32/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_NO_THREAD_SUPPORT=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | }, 28 | "tracetools": { 29 | "cmake-args": [ 30 | "-DTRACETOOLS_DISABLED=ON", 31 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/freertos/esp32/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/esp32/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_esp32_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t udp or serial" 9 | echo " --dev -d agent string descriptor in a serial-like transport" 10 | echo " --ip -i agent IP in a network-like transport" 11 | echo " --port -p agent port in a network-like transport" 12 | } 13 | 14 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 15 | 16 | if [ "$UROS_TRANSPORT" == "serial" ]; then 17 | echo "Using serial device USART." 18 | echo "Please check firmware/freertos_apps/microros_esp32_extensions/main/main.c" 19 | echo "for configuring serial device before build." 20 | 21 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 23 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 24 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 25 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 26 | 27 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 28 | 29 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 30 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 31 | 32 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 33 | 34 | elif [ "$UROS_TRANSPORT" == "udp" ]; then 35 | 36 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT 37 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP 38 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT 39 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 40 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON" 41 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 42 | 43 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE" 44 | remove_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL" 45 | remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER_SERIAL" 46 | remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC_SERIAL" 47 | 48 | else 49 | help 50 | exit 1 51 | fi 52 | 53 | 54 | UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 55 | UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 56 | 57 | export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif 58 | export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf 59 | 60 | eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) 61 | 62 | . $IDF_PATH/export.sh 63 | 64 | if [ -d $EXTENSIONS_DIR/build ]; then 65 | rm -r $EXTENSIONS_DIR/build 66 | fi 67 | mkdir $EXTENSIONS_DIR/build 68 | 69 | pushd $EXTENSIONS_DIR/build >/dev/null 70 | 71 | cmake -G'Unix Makefiles' \ 72 | -DCMAKE_VERBOSE_MAKEFILE=ON \ 73 | -DUROS_APP_FOLDER=$UROS_APP_FOLDER \ 74 | -DIDF_PATH=$IDF_PATH \ 75 | -DUROS_APP=$UROS_APP \ 76 | $EXTENSIONS_DIR 77 | 78 | popd >/dev/null 79 | 80 | 81 | if [ "$UROS_TRANSPORT" == "serial" ]; then 82 | echo "Configured $UROS_TRANSPORT mode with agent at USART$UROS_AGENT_DEVICE" 83 | elif [ "$UROS_TRANSPORT" == "udp" ]; then 84 | echo "Configured $UROS_TRANSPORT mode with agent at $UROS_AGENT_IP:$UROS_AGENT_PORT" 85 | echo "You can configure your WiFi AP password running 'ros2 run micro_ros_setup build_firmware.sh menuconfig'" 86 | fi 87 | -------------------------------------------------------------------------------- /config/freertos/esp32/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Create a virtual environment 3 | python3 -m venv $FW_TARGETDIR/venv 4 | source $FW_TARGETDIR/venv/bin/activate 5 | 6 | # Install deps 7 | pip3 install catkin_pkg empy lark-parser colcon-common-extensions 8 | 9 | pip3 install virtualenv 10 | 11 | # Install toolchain 12 | mkdir toolchain 13 | 14 | pushd toolchain >/dev/null 15 | git clone -b v4.1 --recursive https://github.com/espressif/esp-idf.git 16 | 17 | mkdir espressif 18 | export IDF_TOOLS_PATH=$(pwd)/espressif 19 | export IDF_PATH=$(pwd)/esp-idf 20 | alias python=python3 21 | 22 | echo "Installing ESP-IDF tools" 23 | python3 esp-idf/tools/idf_tools.py install 24 | 25 | echo "Installing ESP-IDF virtualenv" 26 | dpkg -s python3-pip > /dev/null 27 | if [[ $? -ne 0 ]]; then 28 | echo "Error: python3-pip package must be installed before continuing..." 29 | exit 1 30 | fi 31 | python3 esp-idf/tools/idf_tools.py install-python-env 32 | 33 | eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) 34 | 35 | . $IDF_PATH/export.sh 36 | 37 | pip3 install catkin_pkg lark-parser colcon-common-extensions 38 | 39 | popd >/dev/null 40 | 41 | # Import repos 42 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos >/dev/null 43 | 44 | # ignore broken packages 45 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 46 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 47 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 48 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 49 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 50 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 51 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 52 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 53 | 54 | popd >/dev/null 55 | -------------------------------------------------------------------------------- /config/freertos/esp32/flash.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_esp32_extensions 2 | 3 | export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif 4 | export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf 5 | 6 | # Source virtualenv 7 | source $FW_TARGETDIR/venv/bin/activate 8 | 9 | eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) 10 | 11 | . $IDF_PATH/export.sh 12 | 13 | pushd $EXTENSIONS_DIR/build > /dev/null 14 | 15 | make flash/fast 16 | 17 | popd > /dev/null 18 | 19 | -------------------------------------------------------------------------------- /config/freertos/esp32/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and ESP32 7 | Raphael Vogelgsang 8 | APL2 9 | 10 | 11 | git 12 | wget 13 | libncurses-dev 14 | flex 15 | bison 16 | gperf 17 | python3 18 | python3-setuptools 19 | cmake 20 | libffi-dev 21 | libssl-dev 22 | python3-venv 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /config/freertos/list_apps.sh: -------------------------------------------------------------------------------- 1 | function print_available_apps { 2 | echo "Available apps for FreeRTOS and $PLATFORM:" 3 | 4 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 5 | UROS_FREERTOS_APPS=$UROS_CUSTOM_APP_FOLDER 6 | else 7 | UROS_FREERTOS_APPS=$FW_TARGETDIR/freertos_apps/apps 8 | fi 9 | 10 | pushd $UROS_FREERTOS_APPS >/dev/null 11 | for app in $(ls -d */ | cut -f1 -d'/'); do 12 | echo "+-- $app" 13 | done 14 | popd >/dev/null 15 | } 16 | 17 | function check_available_app { 18 | 19 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 20 | UROS_FREERTOS_APPS=$UROS_CUSTOM_APP_FOLDER 21 | else 22 | UROS_FREERTOS_APPS=$FW_TARGETDIR/freertos_apps/apps 23 | fi 24 | 25 | pushd $UROS_FREERTOS_APPS >/dev/null 26 | if [ ! -d $1 ]; then 27 | echo "App $1 for FreeRTOS not available" 28 | print_available_apps 29 | exit 1 30 | fi 31 | popd >/dev/null 32 | } -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ros/freertos_apps 5 | version: kilted 6 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | pushd $EXTENSIONS_DIR >/dev/null 6 | 7 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 8 | 9 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 10 | export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP" 11 | else 12 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 13 | fi 14 | 15 | if [ -d "$UROS_APP_FOLDER" ]; then 16 | echo "Selected app: $UROS_APP" 17 | else 18 | echo "App not found: $UROS_APP" 19 | print_available_apps 20 | exit 1 21 | fi 22 | 23 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then 24 | # Clean micro-ROS build 25 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 26 | 27 | # Clean build 28 | make clean 29 | 30 | # Build micro-ROS stack 31 | make libmicroros 32 | fi 33 | 34 | # Build firmware 35 | make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER 36 | popd >/dev/null 37 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | }, 28 | "tracetools": { 29 | "cmake-args": [ 30 | "-DTRACETOOLS_DISABLED=ON", 31 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/configure.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | function help { 6 | echo "Configure script need an argument." 7 | echo " --transport -t serial or serial-usb" 8 | } 9 | 10 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 11 | # TODO add USB-OTG support 12 | if [ "$UROS_TRANSPORT" == "serial" ]; then 13 | echo "Using serial device USART." 14 | 15 | echo "Please check firmware/freertos_apps/microros_nucleo_f446re_extensions/Core/Src/freertos.c" 16 | echo "for configuring serial device before build." 17 | 18 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 19 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 20 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 21 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 23 | 24 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 25 | 26 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 27 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 28 | 29 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 30 | else 31 | help 32 | fi 33 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | 6 | # Install toolchain 7 | echo "Downloading ARM compiler, this may take a while" 8 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 9 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 10 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 11 | 12 | # Import repos 13 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 14 | 15 | # ignore broken packages 16 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 17 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 18 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 19 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 20 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 21 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 22 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 23 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 24 | 25 | popd >/dev/null 26 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/flash.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446re_extensions 2 | 3 | USE_STFLASH=false 4 | 5 | pushd $EXTENSIONS_DIR > /dev/null 6 | 7 | if [ -f build/micro-ROS.bin ]; then 8 | 9 | echo "Flashing firmware for $RTOS platform $PLATFORM" 10 | if [ $USE_STFLASH = true ]; then 11 | st-flash --reset write build/micro-ROS.bin 0x8000000 12 | else 13 | if lsusb -d 0483:374b; then 14 | ST_INTERFACE=interface/stlink-v2-1.cfg 15 | elif lsusb -d 0483:3748; then 16 | ST_INTERFACE=interface/stlink-v2.cfg 17 | else 18 | # TODO: add stlink v3, should it be stlink.cfg ? 19 | echo "Error. Unsuported OpenOCD USB programmer" 20 | exit 1 21 | fi 22 | openocd -f $ST_INTERFACE -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" 23 | fi 24 | else 25 | echo "build/micro-ROS.bin not found: please compile before flashing." 26 | fi 27 | 28 | popd > /dev/null 29 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446re/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and STM32F446RE 7 | Robin Trioux 8 | APL2 9 | 10 | openocd 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ros/freertos_apps 5 | version: kilted 6 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | pushd $EXTENSIONS_DIR >/dev/null 6 | 7 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 8 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 9 | 10 | if [ -d "$UROS_APP_FOLDER" ]; then 11 | echo "Selected app: $UROS_APP" 12 | else 13 | echo "App not found: $UROS_APP" 14 | print_available_apps 15 | exit 1 16 | fi 17 | 18 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then 19 | # Clean micro-ROS build 20 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 21 | 22 | # Clean build 23 | make clean 24 | 25 | # Build micro-ROS stack 26 | make libmicroros 27 | fi 28 | 29 | # Build firmware 30 | make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER 31 | popd >/dev/null 32 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | }, 28 | "tracetools": { 29 | "cmake-args": [ 30 | "-DTRACETOOLS_DISABLED=ON", 31 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t serial or serial-usb" 9 | } 10 | 11 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 12 | # TODO add USB-OTG support 13 | if [ "$UROS_TRANSPORT" == "serial" ]; then 14 | echo "Using serial device USART." 15 | 16 | echo "Please check firmware/freertos_apps/microros_nucleo_f446ze_extensions/Src/main.c" 17 | echo "for configuring serial device before build." 18 | 19 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 20 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 21 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 23 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 24 | 25 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 26 | 27 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 28 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 29 | 30 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 31 | else 32 | help 33 | fi 34 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | 6 | # Install toolchain 7 | echo "Downloading ARM compiler, this may take a while" 8 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 9 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 10 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 11 | 12 | # Import repos 13 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 14 | 15 | # ignore broken packages 16 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 17 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 18 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 19 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 20 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 21 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 22 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 23 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 24 | 25 | popd >/dev/null -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/flash.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions 2 | 3 | USE_STFLASH=false 4 | 5 | pushd $EXTENSIONS_DIR > /dev/null 6 | 7 | if [ -f build/micro-ROS.bin ]; then 8 | 9 | echo "Flashing firmware for $RTOS platform $PLATFORM" 10 | if [$USE_STFLASH = true]; then 11 | st-flash --reset write build/micro-ROS.bin 0x8000000 12 | else 13 | if lsusb -d 0483:374b; then 14 | ST_INTERFACE=interface/stlink-v2-1.cfg 15 | elif lsusb -d 0483:3748; then 16 | ST_INTERFACE=interface/stlink-v2.cfg 17 | else 18 | # TODO: add stlink v3, should it be stlink.cfg ? 19 | echo "Error. Unsuported OpenOCD USB programmer" 20 | exit 1 21 | fi 22 | openocd -f $ST_INTERFACE -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" 23 | fi 24 | else 25 | echo "build/micro-ROS.bin not found: please compile before flashing." 26 | fi 27 | 28 | popd > /dev/null 29 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f446ze/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and STM32F446ZE 7 | Ali AlSaibie 8 | APL2 9 | 10 | openocd 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ros/freertos_apps 5 | version: kilted 6 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f746zg_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | pushd $EXTENSIONS_DIR >/dev/null 6 | 7 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 8 | 9 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 10 | export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP" 11 | else 12 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 13 | fi 14 | 15 | if [ -d "$UROS_APP_FOLDER" ]; then 16 | echo "Selected app: $UROS_APP" 17 | else 18 | echo "App not found: $UROS_APP" 19 | print_available_apps 20 | exit 1 21 | fi 22 | 23 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then 24 | # Clean micro-ROS build 25 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 26 | 27 | # Clean build 28 | make clean 29 | 30 | # Build micro-ROS stack 31 | make libmicroros 32 | fi 33 | 34 | # Build firmware 35 | make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER 36 | popd >/dev/null 37 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | }, 28 | "tracetools": { 29 | "cmake-args": [ 30 | "-DTRACETOOLS_DISABLED=ON", 31 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f746zg_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t udp, serial or serial-usb" 9 | echo " --ip -i agent IP in a network-like transport" 10 | echo " --port -p agent port in a network-like transport" 11 | } 12 | 13 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 14 | 15 | 16 | if [ "$UROS_TRANSPORT" == "udp" ]; then 17 | 18 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT 19 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP 20 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT 21 | 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=OFF" 23 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 24 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON" 25 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 26 | 27 | echo "Configured $UROS_TRANSPORT mode with agent at $UROS_AGENT_IP:$UROS_AGENT_PORT" 28 | 29 | elif [ "$UROS_TRANSPORT" == "serial" ]; then 30 | echo "Using serial device USART." 31 | 32 | echo "Please check firmware/freertos_apps/microros_nucleo_f746zg_extensions/Src/main.c" 33 | echo "for configuring serial device before build." 34 | 35 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 36 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 37 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 38 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 39 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 40 | 41 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 42 | 43 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 44 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 45 | 46 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 47 | else 48 | help 49 | fi 50 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | 6 | # Install toolchain 7 | echo "Downloading ARM compiler, this may take a while" 8 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 9 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 10 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 11 | 12 | # Import repos 13 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 14 | 15 | # ignore broken packages 16 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 17 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 18 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 19 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 20 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 21 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 22 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 23 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 24 | 25 | popd >/dev/null -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/flash.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f746zg_extensions 2 | 3 | USE_STFLASH=false 4 | 5 | pushd $EXTENSIONS_DIR > /dev/null 6 | 7 | if [ -f build/micro-ROS.bin ]; then 8 | 9 | echo "Flashing firmware for $RTOS platform $PLATFORM" 10 | if [$USE_STFLASH = true]; then 11 | st-flash --reset write build/micro-ROS.bin 0x8000000 12 | else 13 | if lsusb -d 0483:374b; then 14 | ST_INTERFACE=interface/stlink-v2-1.cfg 15 | elif lsusb -d 0483:3748; then 16 | ST_INTERFACE=interface/stlink-v2.cfg 17 | else 18 | # TODO: add stlink v3, should it be stlink.cfg ? 19 | echo "Error. Unsuported OpenOCD USB programmer" 20 | exit 1 21 | fi 22 | openocd -f $ST_INTERFACE -f target/stm32f7x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" 23 | fi 24 | else 25 | echo "build/micro-ROS.bin not found: please compile before flashing." 26 | fi 27 | 28 | popd > /dev/null 29 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f746zg/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and STM32F746ZG Nucleo Board 7 | Eden Desta 8 | APL2 9 | 10 | openocd 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ros/freertos_apps 5 | version: kilted 6 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | pushd $EXTENSIONS_DIR >/dev/null 6 | 7 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 8 | 9 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 10 | export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP" 11 | else 12 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 13 | fi 14 | 15 | if [ -d "$UROS_APP_FOLDER" ]; then 16 | echo "Selected app: $UROS_APP" 17 | else 18 | echo "App not found: $UROS_APP" 19 | print_available_apps 20 | exit 1 21 | fi 22 | 23 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then 24 | # Clean micro-ROS build 25 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 26 | 27 | # Clean build 28 | make clean 29 | 30 | # Build micro-ROS stack 31 | make libmicroros 32 | fi 33 | 34 | # Build firmware 35 | make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER 36 | popd >/dev/null 37 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t udp, serial or serial-usb" 9 | echo " --ip -i agent IP in a network-like transport" 10 | echo " --port -p agent port in a network-like transport" 11 | } 12 | 13 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 14 | 15 | 16 | if [ "$UROS_TRANSPORT" == "udp" ]; then 17 | 18 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT 19 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP 20 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT 21 | 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=OFF" 23 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 24 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON" 25 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 26 | 27 | echo "Configured $UROS_TRANSPORT mode with agent at $UROS_AGENT_IP:$UROS_AGENT_PORT" 28 | 29 | elif [ "$UROS_TRANSPORT" == "serial" ]; then 30 | echo "Using serial device USART." 31 | 32 | echo "Please check firmware/freertos_apps/microros_nucleo_f767zi_extensions/Src/main.c" 33 | echo "for configuring serial device before build." 34 | 35 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 36 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 37 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 38 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 39 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 40 | 41 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 42 | 43 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 44 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 45 | 46 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 47 | else 48 | help 49 | fi 50 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | 6 | # Install toolchain 7 | echo "Downloading ARM compiler, this may take a while" 8 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 9 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 10 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 11 | 12 | # Import repos 13 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 14 | 15 | # ignore broken packages 16 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 17 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 18 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 19 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 20 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 21 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 22 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 23 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 24 | 25 | popd >/dev/null -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/flash.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f767zi_extensions 2 | 3 | USE_STFLASH=false 4 | 5 | pushd $EXTENSIONS_DIR > /dev/null 6 | 7 | if [ -f build/micro-ROS.bin ]; then 8 | 9 | echo "Flashing firmware for $RTOS platform $PLATFORM" 10 | if [$USE_STFLASH = true]; then 11 | st-flash --reset write build/micro-ROS.bin 0x8000000 12 | else 13 | if lsusb -d 0483:374b; then 14 | ST_INTERFACE=interface/stlink-v2-1.cfg 15 | elif lsusb -d 0483:3748; then 16 | ST_INTERFACE=interface/stlink-v2.cfg 17 | else 18 | # TODO: add stlink v3, should it be stlink.cfg ? 19 | echo "Error. Unsuported OpenOCD USB programmer" 20 | exit 1 21 | fi 22 | openocd -f $ST_INTERFACE -f target/stm32f7x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" 23 | fi 24 | else 25 | echo "build/micro-ROS.bin not found: please compile before flashing." 26 | fi 27 | 28 | popd > /dev/null 29 | -------------------------------------------------------------------------------- /config/freertos/nucleo_f767zi/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and STM32F767ZI Nucleo Board 7 | James Nugen 8 | APL2 9 | 10 | openocd 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | freertos_apps: 3 | type: git 4 | url: https://github.com/micro-ROS/freertos_apps 5 | version: kilted 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/build.sh: -------------------------------------------------------------------------------- 1 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_olimex_e407_extensions 2 | 3 | . $PREFIX/config/utils.sh 4 | 5 | pushd $EXTENSIONS_DIR >/dev/null 6 | 7 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 8 | export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" 9 | 10 | if [ -d "$UROS_APP_FOLDER" ]; then 11 | echo "Selected app: $UROS_APP" 12 | else 13 | echo "App not found: $UROS_APP" 14 | print_available_apps 15 | exit 1 16 | fi 17 | 18 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then 19 | # Clean micro-ROS build 20 | rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log 21 | 22 | # Clean build 23 | make clean 24 | 25 | # Build micro-ROS stack 26 | make libmicroros 27 | fi 28 | 29 | # Build firmware 30 | make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER 31 | popd >/dev/null 32 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcutils": { 10 | "cmake-args": [ 11 | "-DENABLE_TESTING=OFF", 12 | "-DRCUTILS_NO_FILESYSTEM=ON", 13 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 14 | "-DRCUTILS_NO_64_ATOMIC=ON" 15 | ] 16 | }, 17 | "microxrcedds_client": { 18 | "cmake-args": [ 19 | "-DUCLIENT_PIC=OFF", 20 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 21 | ] 22 | }, 23 | "rmw_microxrcedds": { 24 | "cmake-args": [ 25 | "-DRMW_UXRCE_TRANSPORT=custom" 26 | ] 27 | }, 28 | "tracetools": { 29 | "cmake-args": [ 30 | "-DTRACETOOLS_DISABLED=ON", 31 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_olimex_e407_extensions 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t udp, serial or serial-usb" 9 | echo " --ip -i agent IP in a network-like transport" 10 | echo " --port -p agent port in a network-like transport" 11 | } 12 | 13 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 14 | 15 | if [ "$UROS_TRANSPORT" == "udp" ]; then 16 | 17 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT 18 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP 19 | update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT 20 | 21 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=OFF" 22 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 23 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON" 24 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 25 | 26 | echo "Configured $UROS_TRANSPORT mode with agent at $UROS_AGENT_IP:$UROS_AGENT_PORT" 27 | 28 | elif [ "$UROS_TRANSPORT" == "serial" ]; then 29 | echo "Using serial device USART." 30 | 31 | echo "Please check firmware/freertos_apps/microros_olimex_e407_extensions/Src/main.c" 32 | echo "for configuring serial device before build." 33 | 34 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 35 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 36 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 37 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 38 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 39 | 40 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 41 | 42 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" 43 | remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" 44 | 45 | echo "Configured $UROS_TRANSPORT mode with agent at USART" 46 | else 47 | help 48 | fi 49 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | # Install toolchain 3 | mkdir toolchain 4 | 5 | 6 | # Install toolchain 7 | echo "Downloading ARM compiler, this may take a while" 8 | curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 9 | tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null 10 | rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 11 | 12 | # Import repos 13 | vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos 14 | 15 | # ignore broken packages 16 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 17 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 18 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 19 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 20 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 21 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 22 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 23 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 24 | touch mcu_ws/ros2/rmw/rmw_security_common/COLCON_IGNORE 25 | 26 | popd >/dev/null -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/flash.sh: -------------------------------------------------------------------------------- 1 | OLIMEX_EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_olimex_e407_extensions 2 | 3 | pushd $OLIMEX_EXTENSIONS_DIR > /dev/null 4 | 5 | if [ -f build/micro-ROS.bin ]; then 6 | echo "Flashing firmware for $RTOS platform $PLATFORM" 7 | 8 | if lsusb -d 15BA:002a; then 9 | PROGRAMMER=interface/ftdi/olimex-arm-usb-tiny-h.cfg 10 | elif lsusb -d 15BA:0003;then 11 | PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd.cfg 12 | elif lsusb -d 15BA:002b;then 13 | PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd-h.cfg 14 | elif lsusb -d 0483:374b; then 15 | PROGRAMMER=interface/stlink-v2-1.cfg 16 | elif lsusb -d 0483:3748; then 17 | PROGRAMMER=interface/stlink-v2.cfg 18 | elif lsusb -d 1366:0101 || lsusb -d 1366:0105; then 19 | PROGRAMMER=interface/jlink.cfg 20 | else 21 | echo "Error. Unsuported OpenOCD USB programmer" 22 | exit 1 23 | fi 24 | 25 | openocd -f $PROGRAMMER -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" 26 | else 27 | echo "build/micro-ROS.bin not found: please compile before flashing." 28 | fi 29 | 30 | popd > /dev/null 31 | 32 | 33 | -------------------------------------------------------------------------------- /config/freertos/olimex-stm32-e407/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for FreeRTOS and Olimex STM32 E407 7 | Pablo Garrido 8 | APL2 9 | 10 | openocd 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/generate_lib/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ament/ament_cmake 3 | ament/ament_index 4 | ament/ament_lint 5 | ament/ament_package 6 | ament/googletest 7 | ament/osrf_pycommon 8 | ament/uncrustify_vendor 9 | ros2/ament_cmake_ros 10 | -------------------------------------------------------------------------------- /config/generate_lib/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/generate_lib/generic/build.sh: -------------------------------------------------------------------------------- 1 | . $PREFIX/config/utils.sh 2 | 3 | if [ $# -ge 1 ]; then 4 | TOOLCHAIN=$1 5 | else 6 | echo "Syntax: ros2 run micro_ros_setup build_firmware.sh [Colcon meta file]" 7 | exit 1 8 | fi 9 | 10 | if [ $# -ge 2 ]; then 11 | COLCON_META=$2 12 | echo "Using provided meta: $COLCON_META" 13 | 14 | else 15 | COLCON_META=$FW_TARGETDIR/mcu_ws/colcon.meta 16 | echo "Using default meta: $COLCON_META" 17 | fi 18 | 19 | 20 | BUILD_DIR=$FW_TARGETDIR/build 21 | 22 | pushd $FW_TARGETDIR/mcu_ws >/dev/null 23 | 24 | rm -rf build install log 25 | 26 | colcon build \ 27 | --merge-install \ 28 | --packages-ignore-regex=.*_cpp \ 29 | --metas $COLCON_META \ 30 | --cmake-args \ 31 | "--no-warn-unused-cli" \ 32 | -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF \ 33 | -DTHIRDPARTY=ON \ 34 | -DBUILD_SHARED_LIBS=OFF \ 35 | -DBUILD_TESTING=OFF \ 36 | -DCMAKE_BUILD_TYPE=Release \ 37 | -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \ 38 | -DCMAKE_VERBOSE_MAKEFILE=ON; \ 39 | 40 | mkdir -p $FW_TARGETDIR/libmicroros; cd $FW_TARGETDIR/libmicroros; \ 41 | for file in $(find $FW_TARGETDIR/mcu_ws/install/lib/ -name '*.a'); do \ 42 | folder=$(echo $file | sed -E "s/(.+)\/(.+).a/\2/"); \ 43 | mkdir -p $folder; cd $folder; ar x $file; \ 44 | for f in *; do \ 45 | mv $f ../$folder-$f; \ 46 | done; \ 47 | cd ..; rm -rf $folder; \ 48 | done ; \ 49 | ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); mkdir -p $BUILD_DIR; cp libmicroros.a $BUILD_DIR; ranlib $BUILD_DIR/libmicroros.a; \ 50 | cp -R $FW_TARGETDIR/mcu_ws/install/include $BUILD_DIR/; \ 51 | rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp"); \ 52 | rm -rf $(find $BUILD_DIR/include -type d -empty); \ 53 | cd ..; rm -rf libmicroros; 54 | 55 | popd >/dev/null 56 | -------------------------------------------------------------------------------- /config/generate_lib/generic/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rosidl_typesupport": { 10 | "cmake-args": [ 11 | "-DROSIDL_TYPESUPPORT_SINGLE_TYPESUPPORT=ON" 12 | ] 13 | }, 14 | "rcl": { 15 | "cmake-args": [ 16 | "-DBUILD_TESTING=OFF", 17 | "-DRCL_MICROROS=ON" 18 | ] 19 | }, 20 | "rcutils": { 21 | "cmake-args": [ 22 | "-DENABLE_TESTING=OFF", 23 | "-DRCUTILS_NO_FILESYSTEM=ON", 24 | "-DRCUTILS_NO_THREAD_SUPPORT=ON", 25 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" 26 | ] 27 | }, 28 | "microxrcedds_client": { 29 | "cmake-args": [ 30 | "-DUCLIENT_PIC=OFF" 31 | ] 32 | }, 33 | "rmw_microxrcedds": { 34 | "cmake-args": [ 35 | "-DRMW_UXRCE_MAX_NODES=1", 36 | "-DRMW_UXRCE_MAX_PUBLISHERS=1", 37 | "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", 38 | "-DRMW_UXRCE_MAX_SERVICES=1", 39 | "-DRMW_UXRCE_MAX_CLIENTS=1", 40 | "-DRMW_UXRCE_MAX_HISTORY=4" 41 | ] 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /config/generate_lib/generic/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/generate_lib/generic/create.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR >/dev/null 2 | 3 | # ignore broken packages 4 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 5 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 6 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 7 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 8 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 9 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 10 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 11 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 12 | touch mcu_ws/ros2/rmw/rmw_security_common/COLCON_IGNORE 13 | 14 | popd >/dev/null 15 | -------------------------------------------------------------------------------- /config/generate_lib/generic/demo_toolchain.cmake: -------------------------------------------------------------------------------- 1 | include(CMakeForceCompiler) 2 | 3 | set(CMAKE_SYSTEM_NAME Linux) 4 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 5 | -------------------------------------------------------------------------------- /config/generate_lib/generic/flash.sh: -------------------------------------------------------------------------------- 1 | echo "No flash step" 2 | echo "Please find library and includes inside firmware/build folder" -------------------------------------------------------------------------------- /config/generate_lib/generic/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for generating micro-ROS libs 7 | Pablo Garrido 8 | APL2 9 | 10 | gperf 11 | wget 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/host/client_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | none 3 | -------------------------------------------------------------------------------- /config/host/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | none 3 | -------------------------------------------------------------------------------- /config/host/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/host/generic/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | colcon build --packages-up-to rosidl_typesupport_microxrcedds_c --metas src --cmake-args -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON $@ 3 | colcon build --packages-up-to rosidl_typesupport_microxrcedds_cpp --metas src --cmake-args -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON $@ 4 | 5 | set +o nounset 6 | . install/local_setup.bash 7 | set -o nounset 8 | 9 | colcon build --metas src --cmake-args -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON $@ 10 | -------------------------------------------------------------------------------- /config/host/generic/client-host-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names":{ 3 | "microxrcedds_client":{ 4 | "cmake-args":[ 5 | "-DBUILD_SHARED_LIBS=ON", 6 | "-DUCLIENT_PROFILE_MULTITHREAD=ON" 7 | ] 8 | }, 9 | "microcdr":{ 10 | "cmake-args":[ 11 | "-DBUILD_SHARED_LIBS=ON" 12 | ] 13 | }, 14 | "rosidl_typesupport_microxrcedds_c":{ 15 | "cmake-args":[ 16 | "-DBUILD_SHARED_LIBS=ON" 17 | ] 18 | }, 19 | "rosidl_typesupport_microxrcedds_cpp":{ 20 | "cmake-args":[ 21 | "-DBUILD_SHARED_LIBS=ON" 22 | ] 23 | }, 24 | "rclc_parameter":{ 25 | "cmake-args":[ 26 | "-DBUILD_SHARED_LIBS=ON" 27 | ] 28 | }, 29 | "rcutils":{ 30 | "cmake-args":[ 31 | "-DENABLE_TESTING=ON" 32 | ] 33 | }, 34 | "rmw_microxrcedds":{ 35 | "cmake-args":[ 36 | "-DRMW_UXRCE_TRANSPORT=udp", 37 | "-DRMW_UXRCE_DEFAULT_UDP_IP=127.0.0.1", 38 | "-DRMW_UXRCE_DEFAULT_UDP_PORT=8888", 39 | "-DRMW_UXRCE_MAX_NODES=15", 40 | "-DRMW_UXRCE_MAX_PUBLISHERS=15", 41 | "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=15", 42 | "-DRMW_UXRCE_MAX_SERVICES=15", 43 | "-DRMW_UXRCE_MAX_CLIENTS=15", 44 | "-DRMW_UXRCE_STREAM_HISTORY=32", 45 | "-DRMW_UXRCE_MAX_HISTORY=10" 46 | ] 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /config/host/generic/client_host_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | eProsima/Micro-CDR: 3 | type: git 4 | url: https://github.com/eProsima/Micro-CDR.git 5 | version: ros2 6 | eProsima/Micro-XRCE-DDS-Client: 7 | type: git 8 | url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git 9 | version: ros2 10 | 11 | # MicroROS 12 | 13 | uros/rclc: 14 | type: git 15 | url: https://github.com/ros2/rclc.git 16 | version: kilted 17 | uros/micro_ros_msgs: 18 | type: git 19 | url: https://github.com/micro-ROS/micro_ros_msgs.git 20 | version: kilted 21 | uros/rmw_microxrcedds: 22 | type: git 23 | url: https://github.com/micro-ROS/rmw-microxrcedds.git 24 | version: kilted 25 | uros/rosidl_typesupport_microxrcedds: 26 | type: git 27 | url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git 28 | version: kilted 29 | uros/micro-ROS-demos: 30 | type: git 31 | url: https://github.com/micro-ROS/micro-ROS-demos.git 32 | version: kilted 33 | uros/micro_ros_utilities: 34 | type: git 35 | url: https://github.com/micro-ROS/micro_ros_utilities 36 | version: kilted 37 | 38 | # Required messages packages 39 | 40 | ros2/common_interfaces: 41 | type: git 42 | url: https://github.com/ros2/common_interfaces 43 | version: kilted 44 | 45 | ros2/example_interfaces: 46 | type: git 47 | url: https://github.com/ros2/example_interfaces 48 | version: kilted 49 | 50 | ros2/rcl_interfaces: 51 | type: git 52 | url: https://github.com/ros2/rcl_interfaces 53 | version: kilted 54 | 55 | ros2/unique_identifier_msgs: 56 | type: git 57 | url: https://github.com/ros2/unique_identifier_msgs 58 | version: kilted 59 | 60 | ros2/test_interface_files: 61 | type: git 62 | url: https://github.com/ros2/test_interface_files 63 | version: kilted 64 | -------------------------------------------------------------------------------- /config/host/generic/create.sh: -------------------------------------------------------------------------------- 1 | # populate the workspace 2 | mkdir -p src 3 | 4 | ros2 run micro_ros_setup create_ws.sh src $PREFIX/config/$RTOS/client_ros2_packages.txt $PREFIX/config/$RTOS/$PLATFORM/client_host_packages.repos 5 | 6 | # add appropriate colcon.meta 7 | cp $PREFIX/config/$RTOS/$PLATFORM/client-host-colcon.meta src/colcon.meta 8 | 9 | rosdep install -y --from-paths src -i src --skip-keys="$SKIP" -r 10 | 11 | touch src/uros/rclc/rclc_examples/COLCON_IGNORE 12 | touch src/uros/rclc/rclc_lifecycle/COLCON_IGNORE -------------------------------------------------------------------------------- /config/host/generic/flash.sh: -------------------------------------------------------------------------------- 1 | echo "Nothing to flash: running in host mode" 2 | echo "Use 'RMW_IMPLEMENTATION=rmw_microxrcedds ros2 run micro_ros_demos_rcl int32_subscriber' to start with examples" -------------------------------------------------------------------------------- /config/host/generic/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for host platforms 7 | Pablo Garrido 8 | APL2 9 | 10 | log4cxx 11 | clang 12 | clang-tidy 13 | clang-format 14 | 15 | 16 | -------------------------------------------------------------------------------- /config/raspbian/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ament/ament_cmake 3 | ament/ament_index 4 | ament/ament_lint 5 | ament/ament_package 6 | ament/googletest 7 | ament/osrf_pycommon 8 | ament/uncrustify_vendor 9 | ros2/ament_cmake_ros 10 | -------------------------------------------------------------------------------- /config/raspbian/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/raspbian/generic/build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | pushd $FW_TARGETDIR/mcu_ws >/dev/null 4 | source app_info.sh 5 | PATH=$PWD/../dev_ws/xcompiler/bin:$PATH 6 | LD_LIBRARY_PATH=$PWD/../dev_ws/xcompiler/lib:$PWD/../dev_ws/xcompiler/arm-linux-gnueabihf/lib 7 | colcon build --packages-up-to=$APP_PACKAGE_NAME --merge-install --cmake-force-configure \ 8 | --packages-ignore-regex=.*_cpp \ 9 | --cmake-args \ 10 | -DCMAKE_TOOLCHAIN_FILE=$PWD/toolchain.cmake \ 11 | -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ 12 | -DBUILD_SHARED_LIBS=OFF \ 13 | -DBUILD_TESTING=OFF \ 14 | "--no-warn-unused-cli" 15 | find ./install -executable -type f -name $APP_BINARY_NAME -exec cp {} $FW_TARGETDIR/bin/$APP_OUTPUT_NAME \; 16 | popd >/dev/null -------------------------------------------------------------------------------- /config/raspbian/generic/client-colcon.meta: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /config/raspbian/generic/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: -------------------------------------------------------------------------------- /config/raspbian/generic/configure.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | pushd $FW_TARGETDIR >/dev/null 4 | rm -rf mcu_ws/* 5 | cp raspbian_apps/toolchain.cmake mcu_ws/ 6 | curl -s https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos |\ 7 | ros2 run micro_ros_setup yaml_filter.py raspbian_apps/$CONFIG_NAME/ros2_repos.filter > ros2.repos 8 | vcs import --input ros2.repos mcu_ws/ && rm ros2.repos 9 | 10 | if [ -d mcu_ws/ros2/rosidl ]; then 11 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE 12 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 13 | fi 14 | 15 | vcs import --input raspbian_apps/$CONFIG_NAME/app.repos mcu_ws/ 16 | if [ -d raspbian_apps/$CONFIG_NAME/app ]; then 17 | cp -r raspbian_apps/$CONFIG_NAME/app mcu_ws/ 18 | fi 19 | cp raspbian_apps/$CONFIG_NAME/colcon.meta mcu_ws/ 20 | cp raspbian_apps/$CONFIG_NAME/app_info.sh mcu_ws/ 21 | if [ -d bin ]; then 22 | rm -rf bin/* 23 | else 24 | mkdir -p bin 25 | fi 26 | if [ -d raspbian_apps/$CONFIG_NAME/bin ]; then 27 | cp -r raspbian_apps/$CONFIG_NAME/bin mcu_ws/ 28 | fi 29 | popd >/dev/null 30 | -------------------------------------------------------------------------------- /config/raspbian/generic/create.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | pushd $FW_TARGETDIR/$DEV_WS_DIR >/dev/null 4 | if [ $PLATFORM == "stretch_v8" ]; then 5 | TOOLCHAIN_URL="https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-6.3.0-pi_3%2B.tar.gz/download" 6 | elif [ $PLATFORM == "buster_v7" ]; then 7 | TOOLCHAIN_URL="https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/Raspberry%20Pi%202%2C%203/cross-gcc-8.3.0-pi_2-3.tar.gz/download" 8 | elif [ $PLATFORM == "buster_v8" ]; then 9 | TOOLCHAIN_URL="https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-8.3.0-pi_3%2B.tar.gz/download" 10 | else 11 | echo "Platform not supported." 12 | exit 1 13 | fi 14 | curl -o xcompiler.tar.gz -L $TOOLCHAIN_URL 15 | mkdir xcompiler 16 | tar xf xcompiler.tar.gz -C xcompiler --strip-components 1 17 | rm xcompiler.tar.gz 18 | popd >/dev/null 19 | 20 | pushd $FW_TARGETDIR >/dev/null 21 | git clone -b kilted https://github.com/micro-ROS/raspbian_apps.git 22 | popd >/dev/null -------------------------------------------------------------------------------- /config/raspbian/generic/flash.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $FW_TARGETDIR/mcu_ws/app_info.sh 4 | echo "Copy $FW_TARGETDIR/bin/$APP_OUTPUT_NAME into your RPi." -------------------------------------------------------------------------------- /config/raspbian/generic/supported_platforms: -------------------------------------------------------------------------------- 1 | stretch_v8 2 | buster_v7 3 | buster_v8 4 | -------------------------------------------------------------------------------- /config/utils.sh: -------------------------------------------------------------------------------- 1 | function update_meta { 2 | python3 -c "import sys; import json; c = '-D' +'$2'; s = json.loads(''.join([l for l in sys.stdin])); k = s['names']['$1']['cmake-args']; i = [c.startswith(v.split('=')[0]) for v in k]; k.pop(i.index(True)) if any(i) else None; k.append(c) if len(c.split('=')[1]) else None; print(json.dumps(s,indent=4))" < $FW_TARGETDIR/mcu_ws/colcon.meta > $FW_TARGETDIR/mcu_ws/colcon_new.meta 3 | mv $FW_TARGETDIR/mcu_ws/colcon_new.meta $FW_TARGETDIR/mcu_ws/colcon.meta 4 | } 5 | 6 | function remove_meta { 7 | python3 -c "import sys; import json; c = '-D' +'$2'; s = json.loads(''.join([l for l in sys.stdin])); k = s['names']['$1']['cmake-args']; i = [c.startswith(v.split('=')[0]) for v in k]; k.pop(i.index(True)) if any(i) else None; print(json.dumps(s,indent=4))" < $FW_TARGETDIR/mcu_ws/colcon.meta > $FW_TARGETDIR/mcu_ws/colcon_new.meta 8 | mv $FW_TARGETDIR/mcu_ws/colcon_new.meta $FW_TARGETDIR/mcu_ws/colcon.meta 9 | } 10 | -------------------------------------------------------------------------------- /config/zephyr/dev_ros2_packages.txt: -------------------------------------------------------------------------------- 1 | keep: 2 | ament/ament_cmake 3 | ament/ament_index 4 | ament/ament_lint 5 | ament/ament_package 6 | ament/googletest 7 | ament/osrf_pycommon 8 | ament/uncrustify_vendor 9 | ros2/ament_cmake_ros 10 | -------------------------------------------------------------------------------- /config/zephyr/dev_uros_packages.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | -------------------------------------------------------------------------------- /config/zephyr/generic/board.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | zephyr_apps: 3 | type: git 4 | url: https://github.com/micro-ROS/zephyr_apps 5 | version: kilted 6 | -------------------------------------------------------------------------------- /config/zephyr/generic/build.sh: -------------------------------------------------------------------------------- 1 | . $PREFIX/config/utils.sh 2 | 3 | pushd $FW_TARGETDIR >/dev/null 4 | source $FW_TARGETDIR/venv/bin/activate 5 | 6 | source $FW_TARGETDIR/zephyrproject/zephyr/zephyr-env.sh 7 | 8 | export ZEPHYR_TOOLCHAIN_VARIANT=zephyr 9 | export ZEPHYR_SDK_INSTALL_DIR=$FW_TARGETDIR/zephyr-sdk 10 | export PATH=~/.local/bin:"$PATH" 11 | 12 | 13 | # Retrieve user app 14 | unset UROS_APP 15 | 16 | export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) 17 | 18 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 19 | export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP" 20 | else 21 | export UROS_APP_FOLDER="$FW_TARGETDIR/zephyr_apps/apps/$UROS_APP" 22 | fi 23 | 24 | if [ -d "$UROS_APP_FOLDER" ]; then 25 | echo "Selected app: $UROS_APP" 26 | else 27 | echo "App not found: $UROS_APP" 28 | print_available_apps 29 | exit 1 30 | fi 31 | 32 | # Clean previous builds 33 | rm -rf build 34 | 35 | if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "mcu_ws/build" ]; then 36 | rm -rf mcu_ws/build mcu_ws/install mcu_ws/log 37 | fi 38 | 39 | # Platform renaming for Zephyr 40 | if [ "$PLATFORM" = "nucleo_f746zg" ]; then 41 | export BOARD="nucleo_f746zg" 42 | elif [ "$PLATFORM" = "discovery_l475_iot1" ]; then 43 | export BOARD="disco_l475_iot1" 44 | elif [ "$PLATFORM" = "olimex-stm32-e407" ]; then 45 | export BOARD="olimex_stm32_e407" 46 | elif [ "$PLATFORM" = "nucleo_f401re" ]; then 47 | export BOARD="nucleo_f401re" 48 | elif [ "$PLATFORM" = "nucleo_h743zi" ]; then 49 | export BOARD="nucleo_h743zi" 50 | elif [ "$PLATFORM" = "host" ]; then 51 | export BOARD="native_posix" 52 | else 53 | echo "Unrecognized board: $PLATFORM. Trying to build" 54 | export BOARD=$PLATFORM 55 | fi 56 | 57 | # Choose configuration based on transport and host 58 | if [ -z "$TRANSPORT" ]; then 59 | echo "Configuration: No transport set, using prj.conf" 60 | export CONF_FILE="prj.conf" 61 | 62 | elif [ "$PLATFORM" = "host" ]; then 63 | echo "Configuration: Platform 'host' detected, using host-udp.conf" 64 | export CONF_FILE="host-udp.conf" 65 | 66 | else 67 | if [ ! -f "$UROS_APP_FOLDER/$TRANSPORT.conf" ]; then 68 | echo "Configuration: Specific config for transport $TRANSPORT not found, using prj.conf" 69 | export CONF_FILE="prj.conf" 70 | else 71 | echo "Configuration: Using transport-specific $TRANSPORT.conf" 72 | export CONF_FILE="$TRANSPORT.conf" 73 | fi 74 | fi 75 | 76 | UROS_BUILD_CMD=" 77 | west build 78 | -b $BOARD 79 | -p auto 80 | $UROS_APP_FOLDER 81 | -- -DCONF_FILE=$UROS_APP_FOLDER/$CONF_FILE 82 | -G'Unix Makefiles' 83 | -DCMAKE_VERBOSE_MAKEFILE=$UROS_VERBOSE_BUILD 84 | -DMICRO_ROS_FIRMWARE_DIR=$FW_TARGETDIR 85 | -DMICRO_ROS_TRANSPORT=$TRANSPORT 86 | ${UROS_EXTRA_BUILD_ARGS[@]}" 87 | 88 | if [ "$UROS_VERBOSE_BUILD" = "on" ]; then 89 | echo "" 90 | echo "-----------------------------" 91 | echo "| Verbose build information |" 92 | echo "-----------------------------" 93 | echo "Fast build: $UROS_FAST_BUILD" 94 | echo "App name: $UROS_APP" 95 | echo "Full app path: $UROS_APP_FOLDER" 96 | echo "Zephyr board: $BOARD" 97 | echo "Zephyr configuration file: $UROS_APP_FOLDER/$CONF_FILE" 98 | echo "Extra build arguments: ${UROS_EXTRA_BUILD_ARGS[@]}" 99 | echo "Full build command: "${UROS_BUILD_CMD[@]} 100 | echo "" 101 | fi 102 | 103 | # Build zephyr + app 104 | eval ${UROS_BUILD_CMD[@]} 105 | 106 | popd >/dev/null 107 | -------------------------------------------------------------------------------- /config/zephyr/generic/client-colcon.meta: -------------------------------------------------------------------------------- 1 | { 2 | "names": { 3 | "tracetools": { 4 | "cmake-args": [ 5 | "-DTRACETOOLS_DISABLED=ON", 6 | "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" 7 | ] 8 | }, 9 | "rcl": { 10 | "cmake-args": [ 11 | "-DBUILD_TESTING=OFF", 12 | "-DRCL_MICROROS=ON" 13 | ] 14 | }, 15 | "rcutils": { 16 | "cmake-args": [ 17 | "-DENABLE_TESTING=OFF", 18 | "-DRCUTILS_NO_FILESYSTEM=ON", 19 | "-DRCUTILS_NO_THREAD_SUPPORT=ON", 20 | "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", 21 | "-DRCUTILS_NO_64_ATOMIC=ON" 22 | ] 23 | }, 24 | "microxrcedds_client": { 25 | "cmake-args": [ 26 | "-DUCLIENT_PIC=OFF", 27 | "-DUCLIENT_PROFILE_DISCOVERY=OFF" 28 | ] 29 | }, 30 | "rmw_microxrcedds": { 31 | "cmake-args": [ 32 | "-DRMW_UXRCE_MAX_NODES=1", 33 | "-DRMW_UXRCE_MAX_PUBLISHERS=1", 34 | "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", 35 | "-DRMW_UXRCE_MAX_SERVICES=1", 36 | "-DRMW_UXRCE_MAX_CLIENTS=1", 37 | "-DRMW_UXRCE_MAX_HISTORY=4" 38 | ] 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /config/zephyr/generic/client_uros_packages.repos: -------------------------------------------------------------------------------- 1 | ../../client_uros_packages.repos -------------------------------------------------------------------------------- /config/zephyr/generic/configure.sh: -------------------------------------------------------------------------------- 1 | 2 | EXTENSIONS_DIR=$FW_TARGETDIR/zephyr_apps 3 | 4 | . $PREFIX/config/utils.sh 5 | 6 | function help { 7 | echo "Configure script need an argument." 8 | echo " --transport -t udp, serial or serial-usb" 9 | } 10 | 11 | echo $CONFIG_NAME > $FW_TARGETDIR/APP 12 | 13 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON" 14 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON" 15 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" 16 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" 17 | update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" 18 | 19 | update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" 20 | 21 | echo $UROS_TRANSPORT > $FW_TARGETDIR/TRANSPORT 22 | 23 | if [ "$UROS_TRANSPORT" == "udp" ]; then 24 | echo "Configured UDP mode." 25 | echo "Please check firmware/zephyr_apps/microros_extensions/microros_transports.h" 26 | echo "for configuring IP and port before build." 27 | elif [ "$UROS_TRANSPORT" == "serial" ]; then 28 | echo "Using serial device." 29 | echo "Please check firmware/zephyr_apps/microros_extensions/microros_transports.h" 30 | echo "for configuring serial device before build." 31 | elif [ "$UROS_TRANSPORT" == "serial-usb" ]; then 32 | echo "Using USB serial device." 33 | echo "Configured $UROS_TRANSPORT mode with agent at USB serial" 34 | else 35 | help 36 | fi 37 | -------------------------------------------------------------------------------- /config/zephyr/generic/create.sh: -------------------------------------------------------------------------------- 1 | # Reminder: Zephyr recommended dependecies are: git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib software-properties-common -y 2 | 3 | CMAKE_VERSION_NUMBER=$(cmake --version | grep "[0-9]*\.[0-9]*\.[0-9]*" | cut -d ' ' -f 3) 4 | CMAKE_VERSION_MAJOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 1) 5 | CMAKE_VERSION_MINOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 2) 6 | CMAKE_VERSION_PATCH_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 3) 7 | 8 | if ! (( $CMAKE_VERSION_MAJOR_NUMBER > 3 || \ 9 | $CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER > 13 || \ 10 | $CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER == 13 && $CMAKE_VERSION_PATCH_NUMBER >= 1 )); then 11 | echo "Error: installed CMake version must be equal or greater than 3.13.1." 12 | echo "Your current version is $CMAKE_VERSION_NUMBER." 13 | echo "Please if not installed follow the instructions: https://docs.zephyrproject.org/latest/getting_started/index.html" 14 | exit 1 15 | fi 16 | 17 | export PATH=~/.local/bin:"$PATH" 18 | export ZEPHYR_VERSION="v0.12.4" 19 | export ARCH=$(uname -m) 20 | 21 | # Create a virtual environment 22 | python3 -m venv $FW_TARGETDIR/venv 23 | source $FW_TARGETDIR/venv/bin/activate 24 | 25 | # Install west 26 | pip3 install west 27 | 28 | # Install requirements 29 | pip3 install catkin_pkg empy 30 | 31 | pushd $FW_TARGETDIR >/dev/null 32 | 33 | west init zephyrproject 34 | pushd zephyrproject >/dev/null 35 | cd zephyr 36 | git checkout zephyr-v2.6.0 37 | cd .. 38 | west update 39 | popd >/dev/null 40 | 41 | pip3 install -r zephyrproject/zephyr/scripts/requirements.txt --ignore-installed 42 | 43 | if [ "$PLATFORM" = "host" ]; then 44 | if [ "$ARCH" = "aarch64" ]; then 45 | export TOOLCHAIN_VERSION=zephyr-sdk-0.13.1-linux-aarch64-setup.run 46 | export ZEPHYR_VERSION="v0.13.1" 47 | else 48 | export TOOLCHAIN_VERSION=zephyr-sdk-0.12.4-x86_64-linux-setup.run 49 | fi 50 | else 51 | if [ "$ARCH" = "aarch64" ]; then 52 | export TOOLCHAIN_VERSION=zephyr-toolchain-arm-0.13.1-linux-aarch64-setup.run 53 | export ZEPHYR_VERSION="v0.13.1" 54 | else 55 | export TOOLCHAIN_VERSION=zephyr-toolchain-arm-0.12.4-x86_64-linux-setup.run 56 | fi 57 | fi 58 | 59 | wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/$ZEPHYR_VERSION/$TOOLCHAIN_VERSION 60 | chmod +x $TOOLCHAIN_VERSION 61 | ./$TOOLCHAIN_VERSION -- -d $(pwd)/zephyr-sdk -y 62 | 63 | rm -rf $TOOLCHAIN_VERSION 64 | 65 | export ZEPHYR_TOOLCHAIN_VARIANT=zephyr 66 | export ZEPHYR_SDK_INSTALL_DIR=$FW_TARGETDIR/zephyr-sdk 67 | 68 | # Import repos 69 | vcs import --input $PREFIX/config/$RTOS/generic/board.repos 70 | 71 | # ignore broken packages 72 | touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE 73 | touch mcu_ws/ros2/rcl/COLCON_IGNORE 74 | touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE 75 | touch mcu_ws/ros2/rcpputils/COLCON_IGNORE 76 | touch mcu_ws/ros2/ros2_tracing/test_tracetools/COLCON_IGNORE 77 | touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE 78 | touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE 79 | touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE 80 | 81 | # Upgrade sphinx 82 | pip install --force-reinstall docutils==0.16 Sphinx==4.2.0 83 | 84 | popd >/dev/null 85 | -------------------------------------------------------------------------------- /config/zephyr/generic/flash.sh: -------------------------------------------------------------------------------- 1 | pushd $FW_TARGETDIR > /dev/null 2 | 3 | source $FW_TARGETDIR/venv/bin/activate 4 | 5 | ZEPHYR_BUILD_DIR="$FW_TARGETDIR/build/zephyr" 6 | 7 | # Host platform (=native_posix) is special, as flashing is actually just executing the binary 8 | if [ "$PLATFORM" = "host" ]; then 9 | 10 | if [ ! -f "$ZEPHYR_BUILD_DIR/zephyr.exe" ]; then 11 | echo "Error: $ZEPHYR_BUILD_DIR/zephyr.exe not found. Please compile before flashing." 12 | exit 1 13 | fi 14 | 15 | $ZEPHYR_BUILD_DIR/zephyr.exe 16 | 17 | else 18 | 19 | if [ ! -f "$ZEPHYR_BUILD_DIR/zephyr.bin" ]; then 20 | echo "Error: $ZEPHYR_BUILD_DIR/zephyr.bin not found. Please compile before flashing." 21 | exit 1 22 | fi 23 | 24 | 25 | 26 | # These boards need special openocd rules 27 | FLASH_OPENOCD=false 28 | if [ "$PLATFORM" = "olimex-stm32-e407" ]; then 29 | 30 | FLASH_OPENOCD=true 31 | OPENOCD_TARGET="stm32f4x.cfg" 32 | if lsusb -d 15BA:002a; then 33 | OPENOCD_PROGRAMMER=interface/ftdi/olimex-arm-usb-tiny-h.cfg 34 | elif lsusb -d 15BA:0003;then 35 | OPENOCD_PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd.cfg 36 | elif lsusb -d 15BA:002b;then 37 | OPENOCD_PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd-h.cfg 38 | else 39 | echo "Error: Unsuported OpenOCD USB programmer" 40 | exit 1 41 | fi 42 | 43 | elif [ "$PLATFORM" = "nucleo_h743zi" ]; then 44 | 45 | FLASH_OPENOCD=true 46 | OPENOCD_TARGET="stm32h7x.cfg" 47 | 48 | if lsusb -d 0483:374e;then 49 | OPENOCD_PROGRAMMER=interface/stlink.cfg 50 | else 51 | echo "Error: Unsupported OpenOCD programmer" 52 | exit 1 53 | fi 54 | 55 | fi 56 | 57 | 58 | 59 | if [ "$FLASH_OPENOCD" = true ]; then 60 | 61 | openocd -f $OPENOCD_PROGRAMMER -f target/$OPENOCD_TARGET \ 62 | -c init \ 63 | -c "reset halt" \ 64 | -c "flash write_image erase $ZEPHYR_BUILD_DIR/zephyr.bin 0x08000000" \ 65 | -c "reset run; exit" 66 | 67 | else 68 | 69 | export ZEPHYR_TOOLCHAIN_VARIANT=zephyr 70 | export ZEPHYR_SDK_INSTALL_DIR=$FW_TARGETDIR/zephyr-sdk 71 | export PATH=~/.local/bin:"$PATH" 72 | 73 | source $FW_TARGETDIR/zephyrproject/zephyr/zephyr-env.sh 74 | 75 | west flash 76 | 77 | fi 78 | 79 | fi 80 | 81 | popd > /dev/null 82 | -------------------------------------------------------------------------------- /config/zephyr/generic/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firmware 5 | 0.0.0 6 | Micro-ROS dependecies for Zephyr RTOS 7 | Pablo Garrido 8 | APL2 9 | 10 | ninja-build 11 | gperf 12 | dfu-util 13 | wget 14 | xz-utils 15 | gcc-multilib 16 | g++-multilib 17 | openocd 18 | python3-venv 19 | 20 | 21 | -------------------------------------------------------------------------------- /config/zephyr/generic/supported_platforms: -------------------------------------------------------------------------------- 1 | discovery_l475_iot1 2 | olimex-stm32-e407 3 | nucleo_f401re 4 | nucleo_h743zi 5 | nucleo_f746zg 6 | -------------------------------------------------------------------------------- /config/zephyr/list_apps.sh: -------------------------------------------------------------------------------- 1 | function print_available_apps { 2 | echo "Available apps for Zephyr and $PLATFORM:" 3 | 4 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 5 | UROS_ZEPHYR_APPS=$UROS_CUSTOM_APP_FOLDER 6 | else 7 | UROS_ZEPHYR_APPS=$FW_TARGETDIR/zephyr_apps/apps 8 | fi 9 | 10 | pushd $UROS_ZEPHYR_APPS >/dev/null 11 | for app in $(ls -d */ | cut -f1 -d'/'); do 12 | echo "+-- $app" 13 | done 14 | popd >/dev/null 15 | } 16 | 17 | function check_available_app { 18 | 19 | if [ -v UROS_CUSTOM_APP_FOLDER ]; then 20 | UROS_ZEPHYR_APPS=$UROS_CUSTOM_APP_FOLDER 21 | else 22 | UROS_ZEPHYR_APPS=$FW_TARGETDIR/zephyr_apps/apps 23 | fi 24 | 25 | pushd $UROS_ZEPHYR_APPS >/dev/null 26 | if [ ! -d $1 ]; then 27 | echo "App $1 for Zephyr not available" 28 | print_available_apps 29 | exit 1 30 | fi 31 | popd >/dev/null 32 | } -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | micro_ros_setup 5 | 5.0.0 6 | Tools for setting up micro-ROS workspaces 7 | Pablo Garrido 8 | Apache-2.0 9 | 10 | curl 11 | python3-yaml 12 | clang-tidy 13 | 14 | flex 15 | bison 16 | libncurses-dev 17 | usbutils 18 | 19 | python3-vcstool 20 | 21 | 22 | ament_cmake 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /scripts/build_agent.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | echo "Building micro-ROS Agent" 8 | 9 | colcon build --packages-up-to micro_ros_agent $@ --cmake-args \ 10 | "-DUAGENT_BUILD_EXECUTABLE=OFF" \ 11 | "-DUAGENT_P2P_PROFILE=OFF" \ 12 | "--no-warn-unused-cli" 13 | -------------------------------------------------------------------------------- /scripts/build_firmware.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | PREFIXES_TO_CLEAN=$AMENT_PREFIX_PATH 8 | FW_TARGETDIR=$(pwd)/firmware 9 | PREFIX=$(ros2 pkg prefix micro_ros_setup) 10 | 11 | # Parse cli arguments 12 | UROS_FAST_BUILD=off 13 | UROS_VERBOSE_BUILD=off 14 | UROS_EXTRA_BUILD_ARGS="" 15 | 16 | while getopts "vf" o 17 | do 18 | case "$o" in 19 | f) 20 | echo "Fast-Build active, ROS workspace will not be re-built!" 21 | UROS_FAST_BUILD=on 22 | ;; 23 | v) 24 | echo "Building in verbose mode" 25 | UROS_VERBOSE_BUILD=on 26 | ;; 27 | [?]) 28 | echo "Usage: ros2 run micro_ros_setup build_firmware.sh [options] -- [build_args]" 29 | echo "Options:" 30 | echo " -v Print verbose build output." 31 | echo " -f Activate Fast-Build. Without this, mcu_ws will get rebuilt completely." 32 | echo "Build args: These options will get directly forwarded to the build system (currently only supported for zephyr)." 33 | exit 1 34 | ;; 35 | esac 36 | done 37 | shift $((OPTIND-1)) 38 | 39 | if [[ -n "$@" ]]; then 40 | UROS_EXTRA_BUILD_ARGS=("$@") 41 | fi 42 | 43 | export UROS_FAST_BUILD 44 | export UROS_VERBOSE_BUILD 45 | export UROS_EXTRA_BUILD_ARGS 46 | 47 | # Checking if firmware exists 48 | if [ -d $FW_TARGETDIR ]; then 49 | RTOS=$(head -n1 $FW_TARGETDIR/PLATFORM) 50 | PLATFORM=$(head -n2 $FW_TARGETDIR/PLATFORM | tail -n1) 51 | if [ -f $FW_TARGETDIR/TRANSPORT ]; then 52 | TRANSPORT=$(head -n1 $FW_TARGETDIR/TRANSPORT) 53 | fi 54 | else 55 | echo "Firmware folder not found. Please use ros2 run micro_ros_setup create_firmware_ws.sh to create a new project." 56 | exit 1 57 | fi 58 | 59 | # clean paths 60 | . $(dirname $0)/clean_env.sh 61 | 62 | # source dev_ws 63 | if [ $RTOS != "host" ]; then 64 | set +o nounset 65 | . $FW_TARGETDIR/dev_ws/install/setup.bash 66 | set -o nounset 67 | fi 68 | 69 | # Building specific firmware folder 70 | echo "Building firmware for $RTOS platform $PLATFORM" 71 | 72 | # Use the generic platform if directory found 73 | if [ -d "$PREFIX/config/$RTOS/generic" ]; then 74 | . $PREFIX/config/$RTOS/generic/build.sh 75 | else 76 | . $PREFIX/config/$RTOS/$PLATFORM/build.sh 77 | fi 78 | 79 | -------------------------------------------------------------------------------- /scripts/clean_env.sh: -------------------------------------------------------------------------------- 1 | # this script cleans the environment 2 | # do not run it, source it! 3 | 4 | set -e 5 | set -o nounset 6 | set -o pipefail 7 | 8 | PREFIXES_TO_CLEAN=$AMENT_PREFIX_PATH 9 | FW_TARGETDIR=$(pwd)/firmware 10 | PREFIX=$(ros2 pkg prefix micro_ros_setup) 11 | # Cleaning paths 12 | function clean { 13 | echo $(echo $(echo $1 | sed 's/:/\n/g' | \ 14 | grep -v -E "($(echo $PREFIXES_TO_CLEAN | sed 's/:/\|/g'))" ) | sed 's/ /:/g' ) 15 | } 16 | 17 | if [ $RTOS == "host" ]; then 18 | echo "Compiling for host environment: not cleaning path" 19 | else 20 | echo "Crosscompiled environment: cleaning path" 21 | if [ ! -z ${LD_LIBRARY_PATH+x} ] 22 | then 23 | MRS_TEMP_VAR=$(clean $LD_LIBRARY_PATH) 24 | if [ ! -z "$MRS_TEMP_VAR" ] 25 | then 26 | export LD_LIBRARY_PATH=$MRS_TEMP_VAR 27 | else 28 | unset LD_LIBRARY_PATH 29 | fi 30 | unset MRS_TEMP_VAR 31 | fi 32 | if [ ! -z ${CMAKE_PREFIX_PATH+x} ] 33 | then 34 | MRS_TEMP_VAR=$(clean $CMAKE_PREFIX_PATH) 35 | if [ ! -z "$MRS_TEMP_VAR" ] 36 | then 37 | export CMAKE_PREFIX_PATH=$MRS_TEMP_VAR 38 | else 39 | unset CMAKE_PREFIX_PATH 40 | fi 41 | unset MRS_TEMP_VAR 42 | fi 43 | if [ ! -z ${PYTHONPATH+x} ] 44 | then 45 | MRS_TEMP_VAR=$(clean $PYTHONPATH) 46 | if [ ! -z "$MRS_TEMP_VAR" ] 47 | then 48 | export PYTHONPATH=$MRS_TEMP_VAR 49 | else 50 | unset PYTHONPATH 51 | fi 52 | unset MRS_TEMP_VAR 53 | fi 54 | export PATH=$(clean $PATH) 55 | unset AMENT_PREFIX_PATH 56 | unset COLCON_PREFIX_PATH 57 | fi -------------------------------------------------------------------------------- /scripts/component: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import sys 4 | from textwrap import wrap 5 | import os 6 | 7 | MAX_CHARACTERS = 80 8 | 9 | COMPONENTS = [ 10 | { 11 | "name": "esp_idf", 12 | "description": "micro-ROS component for ESP-IDF: this package enables the integration of micro-ROS in any Espressif ESP32 IDF project.", 13 | "url" : "https://github.com/micro-ROS/micro_ros_espidf_component" 14 | }, 15 | { 16 | "name": "zephyr_rtos", 17 | "description": "micro-ROS module for Zephyr RTOS: this package enables the integration of micro-ROS in any Zephyr RTOS workspace.", 18 | "url" : "https://github.com/micro-ROS/micro_ros_zephyr_module" 19 | }, 20 | { 21 | "name": "mbed_rtos", 22 | "description": "micro-ROS module for Mbed RTOS: this package enables the integration of micro-ROS in any Mbed RTOS workspace.", 23 | "url" : "https://github.com/micro-ROS/micro_ros_mbed" 24 | }, 25 | { 26 | "name": "nuttx_rtos", 27 | "description": "micro-ROS module for NuttX RTOS: this package enables the integration of micro-ROS in any NuttX RTOS workspace.", 28 | "url" : "https://github.com/micro-ROS/micro_ros_nuttx_app" 29 | }, 30 | { 31 | "name": "azure_rtos", 32 | "description": "micro-ROS module for Microsoft Azure RTOS: this package enables the integration of micro-ROS in a Microsoft Azure RTOS workspace.", 33 | "url" : "https://github.com/micro-ROS/micro_ros_azure_rtos_app" 34 | }, 35 | { 36 | "name": "tiva_c_series", 37 | "description": "micro-ROS app for TI Tiva™ C Series: this package enables the integration of micro-ROS in Texas Instruments Tiva™ C Series.", 38 | "url" : "https://github.com/micro-ROS/micro_ros_tivac_launchpad_app" 39 | }, 40 | { 41 | "name": "stm32cube", 42 | "description": "micro-ROS utils for STM32CubeMX and STM32CubeIDE: this package enables the integration of micro-ROS in STM32CubeMX and STM32CubeIDE.", 43 | "url" : "https://github.com/micro-ROS/micro_ros_stm32cubemx_utils" 44 | }, 45 | { 46 | "name": "platformio", 47 | "description": "micro-ROS module for PlatformIO: this package enables the integration of micro-ROS in PlatformIO.", 48 | "url" : "https://github.com/micro-ROS/micro_ros_platformio" 49 | }, 50 | { 51 | "name": "arduino", 52 | "description": "Arduino IDE & CLI libraries for micro-ROS: this package enables the integration of micro-ROS in the Arduino IDE for some hardware platforms.", 53 | "url" : "https://github.com/micro-ROS/micro_ros_arduino" 54 | }, 55 | { 56 | "name": "raspberry_pi_pico", 57 | "description": "Raspberry Pi Pico SDK libraries for micro-ROS: this package enables the integration of micro-ROS in the Raspberry Pi Pico SDK.", 58 | "url" : "https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk" 59 | } 60 | ] 61 | 62 | def print_help(extended = False): 63 | if extended: 64 | print("Usage: ros2 run micro_ros_setup component ") 65 | print("") 66 | for component in COMPONENTS: 67 | description = "\n\t".join(wrap(component["description"], MAX_CHARACTERS)) 68 | print("[{}] \n\t{}\n".format(component["name"], description)) 69 | else: 70 | print("Usage: ros2 run micro_ros_setup component ") 71 | print("Available components: {}".format(", ".join([c["name"] for c in COMPONENTS]))) 72 | 73 | # No arguments 74 | if len(sys.argv) < 2: 75 | print_help() 76 | sys.exit(0) 77 | 78 | # User asks for help 79 | if "-h" in sys.argv or "--help" in sys.argv: 80 | print_help(True) 81 | sys.exit(0) 82 | 83 | # Component select 84 | component_name = sys.argv[1] 85 | if component_name in [x["name"] for x in COMPONENTS]: 86 | component = [x for x in COMPONENTS if x["name"] == component_name][0] 87 | repo_folder_name = os.getcwd() + "/" + component["url"].split("/")[-1] 88 | 89 | print("Using micro-ROS {} component".format(component_name)) 90 | print("\t{}".format("\n\t".join(wrap(component["description"], MAX_CHARACTERS)))) 91 | print("") 92 | 93 | if os.path.exists(repo_folder_name): 94 | print("Folder {} already exists!".format(repo_folder_name)) 95 | else: 96 | print("Cloning repository...") 97 | os.system("git clone {} > /dev/null 2>&1".format(component["url"])) 98 | print("{} repository cloned at {}".format(component_name, repo_folder_name)) 99 | print("") 100 | 101 | print("FOR USAGE INSTRUCTIONS VISIT: {}".format(component["url"] + "#readme")) 102 | else: 103 | print("Unknown component: {}".format(component_name)) 104 | print_help(True) 105 | -------------------------------------------------------------------------------- /scripts/configure_firmware.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | export FW_TARGETDIR=$(pwd)/firmware 8 | export PREFIX=$(ros2 pkg prefix micro_ros_setup) 9 | 10 | # Checking if firmware exists 11 | if [ -d $FW_TARGETDIR ]; then 12 | RTOS=$(head -n1 $FW_TARGETDIR/PLATFORM) 13 | PLATFORM=$(head -n2 $FW_TARGETDIR/PLATFORM | tail -n1) 14 | else 15 | echo "Firmware folder not found. Please use ros2 run micro_ros_setup create_firmware_ws.sh to create a new project." 16 | exit 1 17 | fi 18 | 19 | # Check if configure script exists 20 | if [ -d "$PREFIX/config/$RTOS/generic" ]; then 21 | if [ ! -f $PREFIX/config/$RTOS/generic/configure.sh ]; then 22 | echo "No configuration step needed for generic platform $PLATFORM" 23 | exit 0 24 | fi 25 | else 26 | if [ ! -f $PREFIX/config/$RTOS/$PLATFORM/configure.sh ]; then 27 | echo "No configuration step needed for $RTOS platform $PLATFORM" 28 | exit 0 29 | fi 30 | fi 31 | 32 | # Parsing micro-ROS arguments 33 | if [ $# -lt 1 ]; then 34 | echo "micro-ROS application name must be provided: ros2 run micro_ros_setup configure_firmware.sh [app name] [options]" 35 | # Check if RTOS has app listing funcions and source in case 36 | if [ -f $PREFIX/config/$RTOS/list_apps.sh ]; then 37 | . $PREFIX/config/$RTOS/list_apps.sh 38 | print_available_apps 39 | fi 40 | exit 1 41 | fi 42 | 43 | if [ -f $PREFIX/config/$RTOS/list_apps.sh ]; then 44 | . $PREFIX/config/$RTOS/list_apps.sh 45 | check_available_app $1 46 | fi 47 | 48 | export CONFIG_NAME=$1 49 | shift 50 | 51 | while [[ $# -gt 0 ]]; do 52 | key="$1" 53 | 54 | case $key in 55 | -t|--transport) 56 | export UROS_TRANSPORT="$2" 57 | shift # past argument 58 | shift # past value 59 | ;; 60 | -d|--dev) 61 | export UROS_AGENT_DEVICE="$2" 62 | shift # past argument 63 | shift # past value 64 | ;; 65 | -i|--ip) 66 | export UROS_AGENT_IP="$2" 67 | shift # past argument 68 | shift # past value 69 | ;; 70 | -p|--port) 71 | export UROS_AGENT_PORT="$2" 72 | shift # past argument 73 | shift # past value 74 | ;; 75 | *) # unknown option 76 | echo "Unknown argument $1" 77 | exit 1 78 | ;; 79 | esac 80 | done 81 | 82 | # Configure specific firmware folder if needed 83 | if [ -d "$PREFIX/config/$RTOS/generic" ]; then 84 | echo "Configuring firmware for $RTOS platform $PLATFORM" 85 | exec $PREFIX/config/$RTOS/generic/configure.sh $@ 86 | else 87 | echo "Configuring firmware for $RTOS platform $PLATFORM" 88 | exec $PREFIX/config/$RTOS/$PLATFORM/configure.sh $@ 89 | fi 90 | 91 | -------------------------------------------------------------------------------- /scripts/create_agent_ws.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | PREFIX=$(ros2 pkg prefix micro_ros_setup) 8 | TARGETDIR=src 9 | 10 | if [ -z ${EXTERNAL_SKIP+x} ]; then 11 | EXTERNAL_SKIP="" 12 | fi 13 | 14 | SKIP="rosidl_typesupport_opensplice_c rosidl_typesupport_opensplice_cpp rmw_opensplice_cpp rmw_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_connext_cpp microxrcedds_agent microxrcedds_client microcdr rmw_connextdds $EXTERNAL_SKIP" 15 | 16 | if [ $# -gt 0 ] 17 | then 18 | TARGETDIR=$1 19 | fi 20 | 21 | [ -d $TARGETDIR ] || mkdir $TARGETDIR 22 | 23 | # populate the workspace 24 | ros2 run micro_ros_setup create_ws.sh $TARGETDIR $PREFIX/config/agent_ros2_packages.txt $PREFIX/config/agent_uros_packages.repos 25 | 26 | rosdep install --os=ubuntu:noble --from-paths $TARGETDIR -i $TARGETDIR -y --skip-keys="$SKIP" 27 | -------------------------------------------------------------------------------- /scripts/create_firmware_ws.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | DEV_WS_DIR=dev_ws 8 | FW_TARGETDIR=$(pwd)/firmware 9 | PREFIX=$(ros2 pkg prefix micro_ros_setup) 10 | 11 | print_available_platforms () { 12 | echo "Available platforms:" 13 | pushd $PREFIX/config >/dev/null 14 | for rtos in $(ls -d */ | cut -f1 -d'/'); do 15 | echo ". $rtos" 16 | if [ -f $PREFIX/config/$rtos/generic/supported_platforms ];then 17 | 18 | while read line; do 19 | echo "+-- $line" 20 | done < $PREFIX/config/$rtos/generic/supported_platforms 21 | else 22 | pushd $rtos >/dev/null 23 | for platform in $(ls -d */ | cut -f1 -d'/'); do 24 | echo "+-- $platform" 25 | done 26 | popd >/dev/null 27 | fi 28 | done 29 | popd >/dev/null 30 | } 31 | 32 | # Retrieving RTOS and Platform 33 | 34 | if [ $# -ge 1 ]; then 35 | RTOS=$1 36 | else 37 | echo "Syntax: ros2 run micro_ros_setup create_firmware_ws.sh []" 38 | print_available_platforms 39 | exit 1 40 | fi 41 | 42 | if [ $# -ge 2 ]; then 43 | PLATFORM=$2 44 | else 45 | PLATFORM=generic 46 | fi 47 | 48 | # Checking if firmware exists 49 | if [ -d $FW_TARGETDIR ]; then 50 | echo "Firmware already created. Please delete $FW_TARGETDIR folder if you want a fresh installation." 51 | exit 1 52 | fi 53 | 54 | # Checking folders 55 | if [ -d $PREFIX/config/$RTOS/$PLATFORM ] || [ -d "$PREFIX/config/$RTOS/generic" ]; then 56 | echo "Creating firmware for $RTOS platform $PLATFORM" 57 | FOLDER=$PREFIX/config/$RTOS/$PLATFORM 58 | else 59 | echo "Non valid RTOS/Platform: $RTOS/$PLATFORM" 60 | print_available_platforms 61 | exit 1 62 | fi 63 | 64 | mkdir $FW_TARGETDIR 65 | touch $FW_TARGETDIR/COLCON_IGNORE 66 | 67 | echo $RTOS > $FW_TARGETDIR/PLATFORM 68 | echo $PLATFORM >> $FW_TARGETDIR/PLATFORM 69 | 70 | # Setting common enviroment 71 | 72 | if [ -z ${EXTERNAL_SKIP+x} ]; then 73 | EXTERNAL_SKIP="" 74 | fi 75 | 76 | SKIP="microxrcedds_agent microxrcedds_client microcdr rosidl_typesupport_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_opensplice_cpp rosidl_typesupport_opensplice_c rmw_opensplice_cpp ros-${ROS_DISTRO}-cyclonedds ros-${ROS_DISTRO}-rti-connext-dds-cmake-module ros-${ROS_DISTRO}-rmw-connextdds-common ros-${ROS_DISTRO}-rmw-connextdds ros-${ROS_DISTRO}-rmw-cyclonedds-cpp google_benchmark_vendor performance_test_fixture ros-${ROS_DISTRO}-mimick-vendor rmw_cyclonedds_cpp rmw_connext_cpp rti-connext-dds-5.3.1 rmw_connextdds osrf_testing_tools_cpp $EXTERNAL_SKIP" 77 | 78 | # Check generic build 79 | if [ -d "$PREFIX/config/$RTOS/generic" ]; then 80 | TARGET_FOLDER=generic 81 | else 82 | TARGET_FOLDER=$PLATFORM 83 | fi 84 | 85 | pushd $FW_TARGETDIR >/dev/null 86 | # Creating dev directory 87 | mkdir $DEV_WS_DIR 88 | 89 | if [ $RTOS != "host" ]; then 90 | ros2 run micro_ros_setup create_ws.sh $DEV_WS_DIR $PREFIX/config/$RTOS/dev_ros2_packages.txt \ 91 | $PREFIX/config/$RTOS/dev_uros_packages.repos 92 | rosdep install --os=ubuntu:noble -y --from-paths $DEV_WS_DIR -i $DEV_WS_DIR --rosdistro $ROS_DISTRO --skip-keys="$SKIP" 93 | 94 | # Creating mcu directory 95 | mkdir mcu_ws 96 | ros2 run micro_ros_setup create_ws.sh mcu_ws $PREFIX/config/client_ros2_packages.txt $PREFIX/config/$RTOS/$TARGET_FOLDER/client_uros_packages.repos 97 | cp $PREFIX/config/$RTOS/$TARGET_FOLDER/client-colcon.meta mcu_ws/colcon.meta || : 98 | fi 99 | popd >/dev/null 100 | 101 | # build the dev_ws 102 | . $(dirname $0)/clean_env.sh 103 | if [ $RTOS != "host" ]; then 104 | pushd $FW_TARGETDIR/$DEV_WS_DIR >/dev/null 105 | # Fix failing build by ignoring rmw_test_fixture_implementation. 106 | touch ros2/ament_cmake_ros/rmw_test_fixture_implementation/COLCON_IGNORE 107 | colcon build 108 | set +o nounset 109 | # source dev workspace 110 | . install/setup.bash 111 | popd > /dev/null 112 | fi 113 | 114 | # Install dependecies for specific platform 115 | rosdep install --os=ubuntu:noble -y --from-paths $PREFIX/config/$RTOS/$TARGET_FOLDER -i $PREFIX/config/$RTOS/$TARGET_FOLDER --rosdistro $ROS_DISTRO --skip-keys="$SKIP" 116 | 117 | # Creating specific firmware folder 118 | . $PREFIX/config/$RTOS/$TARGET_FOLDER/create.sh 119 | 120 | -------------------------------------------------------------------------------- /scripts/create_ws.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | if [ $# -lt 3 ] 8 | then 9 | echo "Syntax: $0 " 10 | exit 255 11 | fi 12 | 13 | if [ ! -d $1 ] 14 | then 15 | echo "Error: Target ('$1') must be a directory but isn't". 16 | exit 255 17 | fi 18 | 19 | 20 | PACKAGES=$2 21 | REPOS=$3 22 | 23 | if [ ! -f ${PACKAGES} ] 24 | then 25 | echo "Error: Package list file $PACKAGES (expanded from $2) does not exist" 26 | exit 255 27 | fi 28 | 29 | if [ ! -f ${REPOS} ] 30 | then 31 | echo "Error: Repo file $REPOS (expanded from $3) does not exist" 32 | exit 255 33 | fi 34 | 35 | 36 | pushd $1 >/dev/null 37 | if [ -f ros2.repos ] 38 | then 39 | echo "Repo-file ros2.repos already present, overwriting!" 40 | fi 41 | 42 | # ROS_DISTRO SPECIFIC 43 | curl -s https://raw.githubusercontent.com/ros2/ros2/kilted/ros2.repos |\ 44 | ros2 run micro_ros_setup yaml_filter.py ${PACKAGES} > ros2.repos 45 | vcs import --input ros2.repos --skip-existing 46 | vcs import --input $REPOS --skip-existing 47 | 48 | popd >/dev/null 49 | 50 | -------------------------------------------------------------------------------- /scripts/flash_firmware.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | set -o pipefail 6 | 7 | FW_TARGETDIR=$(pwd)/firmware 8 | PREFIX=$(ros2 pkg prefix micro_ros_setup) 9 | 10 | # Checking if firmware exists 11 | if [ -d $FW_TARGETDIR ]; then 12 | RTOS=$(head -n1 $FW_TARGETDIR/PLATFORM) 13 | PLATFORM=$(head -n2 $FW_TARGETDIR/PLATFORM | tail -n1) 14 | else 15 | echo "Firmware folder not found. Please use ros2 run micro_ros_setup create_firmware_ws.sh to create a new project." 16 | exit 1 17 | fi 18 | 19 | # Flash specific firmware folder if needed 20 | if [ -d "$PREFIX/config/$RTOS/generic" ]; then 21 | if [ -f $PREFIX/config/$RTOS/generic/flash.sh ]; then 22 | echo "Flashing firmware for $RTOS platform $PLATFORM" 23 | . $PREFIX/config/$RTOS/generic/flash.sh 24 | else 25 | echo "No flash step found for $RTOS platform $PLATFORM" 26 | fi 27 | else 28 | if [ -f $PREFIX/config/$RTOS/$PLATFORM/flash.sh ]; then 29 | echo "Flashing firmware for $RTOS platform $PLATFORM" 30 | . $PREFIX/config/$RTOS/$PLATFORM/flash.sh 31 | else 32 | echo "No flash step found for $RTOS platform $PLATFORM" 33 | fi 34 | fi 35 | -------------------------------------------------------------------------------- /scripts/yaml_filter.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import yaml 4 | 5 | import sys 6 | 7 | import copy 8 | 9 | if __name__ == '__main__': 10 | repos_info = yaml.safe_load(sys.stdin) 11 | repos_keep = yaml.safe_load(open(sys.argv[1]))['keep'].split() 12 | 13 | target = {'repositories': {}} 14 | 15 | if repos_info: 16 | for key in repos_info["repositories"]: 17 | if key in repos_keep: 18 | target['repositories'][key] = repos_info["repositories"][key] 19 | 20 | print(yaml.dump(target)) 21 | --------------------------------------------------------------------------------