diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a1f457a..f36d07e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,65 +1,101 @@ name: CI on: - pull_request: - paths-ignore: - - 'README.md' - branches: - - '**' + workflow_call: + inputs: + ci_target_ref: + required: true + type: string + +env: + ROS_DISTRO: humble jobs: micro_ros_build: runs-on: ubuntu-latest - container: ros:rolling - + container: + image: ubuntu:jammy + strategy: + fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: src/micro_ros_setup + ref: ${{ inputs.ci_target_ref }} + + - uses: ros-tooling/setup-ros@0.7.13 + with: + use-ros2-testing: false + required-ros-distributions: ${{ env.ROS_DISTRO }} - name: Dependencies run: | apt update - apt install -y python3-colcon-metadata python3-pip - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y + apt install -y python3-pip + pip3 install colcon-common-extensions + rosdep update --rosdistro ${{ env.ROS_DISTRO }} + rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y - name: Build run: | - . /opt/ros/$ROS_DISTRO/setup.sh + . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh colcon build - name: Install micro-ROS build system run: | (test -f install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh) && true || false - - uses: actions/upload-artifact@v1 + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" + + - uses: actions/upload-artifact@v4.4.0 with: - name: micro_ros_build + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install micro_ros_agent: runs-on: ubuntu-latest - container: ros:rolling + container: + image: ubuntu:jammy + strategy: + fail-fast: false needs: micro_ros_build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: src/micro_ros_setup + ref: ${{ inputs.ci_target_ref }} + + - uses: ros-tooling/setup-ros@0.7.13 + with: + use-ros2-testing: false + required-ros-distributions: ${{ env.ROS_DISTRO }} - name: dependencies run: | apt update - apt install -y python3-colcon-metadata python3-pip - apt install -y ros-${ROS_DISTRO}-rmw-fastrtps-cpp - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y + apt install -y python3-pip + pip3 install colcon-common-extensions + apt install -y ros-${{ env.ROS_DISTRO }}-rmw-fastrtps-cpp + rosdep update --rosdistro ${{ env.ROS_DISTRO }} + rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y + + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" - - uses: actions/download-artifact@v1 + - uses: actions/download-artifact@v4.1.7 with: - name: micro_ros_build + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install # Workaround https://github.com/actions/upload-artifact/issues/38 @@ -68,7 +104,7 @@ jobs: - name: build run: | - . /opt/ros/$ROS_DISTRO/setup.sh + . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh . install/local_setup.sh ros2 run micro_ros_setup create_agent_ws.sh ros2 run micro_ros_setup build_agent.sh @@ -79,9 +115,9 @@ jobs: micro_ros_client: runs-on: ubuntu-latest - container: ros:rolling needs: micro_ros_build - + container: + image: ubuntu:jammy strategy: fail-fast: false matrix: @@ -184,32 +220,38 @@ jobs: - rtos: mbed platform: disco_l475vg_iot01a binary: 'firmware/micro_ros_mbed/cmake_build/DISCO_L475VG_IOT01A/develop/GCC_ARM/micro_ros_mbed.bin' + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: src/micro_ros_setup + ref: ${{ inputs.ci_target_ref }} + + - uses: ros-tooling/setup-ros@0.7.13 + with: + use-ros2-testing: false + required-ros-distributions: ${{ env.ROS_DISTRO }} - name: Dependencies run: | apt update apt upgrade -y - # Install last version of CMake - apt install -y apt-transport-https ca-certificates gnupg software-properties-common wget - if [ $(lsb_release -sr) = "22.04" ]; then - echo "Using Ubuntu mainline CMake" - else - echo "Adding Kitware CMake repo to install CMake" - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null - apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' - fi apt-get update - apt install -y python3-colcon-metadata python3-pip cmake - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y + apt install -y python3-pip cmake + pip3 install colcon-common-extensions + rosdep update --rosdistro ${{ env.ROS_DISTRO }} + rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y + + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" - - uses: actions/download-artifact@v1 + - uses: actions/download-artifact@v4.1.7 with: - name: micro_ros_build + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install # Workaround https://github.com/actions/upload-artifact/issues/38 @@ -218,7 +260,7 @@ jobs: - name: Configure and build micro-ROS run: | - . /opt/ros/$ROS_DISTRO/setup.sh + . /opt/ros/${{ env.ROS_DISTRO }}/setup.sh . install/local_setup.sh ros2 run micro_ros_setup create_firmware_ws.sh ${{ matrix.rtos }} ${{ matrix.platform }} ros2 run micro_ros_setup configure_firmware.sh ${{ matrix.configuration }} ${{ matrix.transport_arguments }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 942ec641..96683779 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,414 +10,17 @@ on: jobs: - micro_ros_build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - distro: foxy - branch: foxy - - distro: rolling - branch: main - - distro: galactic - branch: galactic - container: ros:${{ matrix.distro }} - - steps: - - uses: actions/checkout@v2 - with: - path: src/micro_ros_setup - ref: ${{ matrix.branch }} - - - name: Dependencies - run: | - apt update - apt install -y python3-colcon-metadata python3-pip - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y - - - name: Build - run: | - . /opt/ros/$ROS_DISTRO/setup.sh - colcon build - - - name: Install micro-ROS build system - run: | - (test -f install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh) && true || false - - - uses: actions/upload-artifact@v1 - with: - name: micro_ros_build_${{ matrix.branch }} - path: install - - micro_ros_client: - runs-on: ubuntu-latest - container: ros:${{ matrix.distro }} - needs: micro_ros_build - - strategy: - fail-fast: false - matrix: - include: - - distro: foxy - branch: foxy - rtos: host - platform: null - configuration: null - transport_arguments: null - binary: 'install/micro_ros_demos_rclc/lib/micro_ros_demos_rclc/int32_publisher/int32_publisher' - - - distro: foxy - branch: foxy - rtos: generate_lib - platform: null - configuration: null - transport_arguments: null - build_arguments: $(pwd)/src/micro_ros_setup/config/generate_lib/generic/demo_toolchain.cmake - binary: 'firmware/build/libmicroros.a' - - - distro: foxy - branch: foxy - rtos: freertos - platform: crazyflie21 - configuration: crazyflie_position_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_crazyflie21_extensions/cf2.bin' - - - distro: foxy - branch: foxy - rtos: freertos - platform: olimex-stm32-e407 - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_olimex_e407_extensions/build/micro-ROS.elf' - - - distro: foxy - branch: foxy - rtos: freertos - platform: nucleo_f446re - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f446re_extensions/build/micro-ROS.elf' - - - distro: foxy - branch: foxy - rtos: freertos - platform: nucleo_f446ze - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f446ze_extensions/build/micro-ROS.elf' - - - distro: foxy - branch: foxy - rtos: freertos - platform: nucleo_f746zg - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/micro-ROS.elf' - - - distro: foxy - branch: foxy - rtos: freertos - platform: nucleo_f767zi - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f767zi_extensions/build/micro-ROS.elf' - - - distro: foxy - branch: foxy - rtos: freertos - platform: esp32 - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_esp32_extensions/build/int32_publisher.elf' - - - distro: foxy - branch: foxy - rtos: zephyr - platform: olimex-stm32-e407 - configuration: int32_publisher - transport_arguments: -t serial-usb - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: foxy - branch: foxy - rtos: zephyr - platform: discovery_l475_iot1 - configuration: int32_publisher - transport_arguments: -t serial-usb - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: foxy - branch: foxy - rtos: zephyr - platform: nucleo_h743zi - configuration: int32_publisher - transport_arguments: -t serial -d 3 - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: foxy - branch: foxy - rtos: zephyr - platform: nucleo_f746zg - configuration: int32_publisher - transport_arguments: -t serial -d 3 - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: foxy - branch: foxy - rtos: zephyr - platform: host - configuration: ping_pong - transport_arguments: -t udp -i 192.168.1.1 -p 8080 - binary: 'firmware/build/zephyr/zephyr.exe' - - - distro: foxy - branch: foxy - rtos: nuttx - platform: olimex-stm32-e407 - configuration: drive_base - transport_arguments: - binary: 'firmware/NuttX/nuttx.bin' - - - distro: foxy - branch: foxy - rtos: raspbian - platform: buster_v7 - configuration: agent_lite - binary: 'firmware/bin/micro_ros_agent_lite' - - - distro: foxy - branch: foxy - rtos: raspbian - platform: buster_v7 - configuration: weather_publisher - binary: 'firmware/bin/weather_publisher' - - - distro: rolling - branch: main - rtos: host - platform: null - configuration: null - transport_arguments: null - binary: 'install/micro_ros_demos_rclc/lib/micro_ros_demos_rclc/int32_publisher/int32_publisher' - - - distro: rolling - branch: main - rtos: generate_lib - platform: null - configuration: null - transport_arguments: null - build_arguments: $(pwd)/src/micro_ros_setup/config/generate_lib/generic/demo_toolchain.cmake - binary: 'firmware/build/libmicroros.a' - - - distro: rolling - branch: main - rtos: freertos - platform: crazyflie21 - configuration: crazyflie_position_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_crazyflie21_extensions/cf2.bin' - - - distro: rolling - branch: main - rtos: freertos - platform: olimex-stm32-e407 - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_olimex_e407_extensions/build/micro-ROS.elf' - - - distro: rolling - branch: main - rtos: freertos - platform: nucleo_f446re - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f446re_extensions/build/micro-ROS.elf' - - - distro: rolling - branch: main - rtos: freertos - platform: nucleo_f446ze - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f446ze_extensions/build/micro-ROS.elf' - - - distro: rolling - branch: main - rtos: freertos - platform: nucleo_f746zg - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f746zg_extensions/build/micro-ROS.elf' - - - distro: rolling - branch: main - rtos: freertos - platform: nucleo_f767zi - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_nucleo_f767zi_extensions/build/micro-ROS.elf' - - - distro: rolling - branch: main - rtos: freertos - platform: esp32 - configuration: int32_publisher - transport_arguments: -t serial -d 1 - binary: 'firmware/freertos_apps/microros_esp32_extensions/build/int32_publisher.elf' - - - distro: rolling - branch: main - rtos: zephyr - platform: olimex-stm32-e407 - configuration: int32_publisher - transport_arguments: -t serial-usb - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: rolling - branch: main - rtos: zephyr - platform: discovery_l475_iot1 - configuration: int32_publisher - transport_arguments: -t serial-usb - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: rolling - branch: main - rtos: zephyr - platform: nucleo_h743zi - configuration: int32_publisher - transport_arguments: -t serial -d 3 - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: rolling - branch: main - rtos: zephyr - platform: nucleo_f746zg - configuration: int32_publisher - transport_arguments: -t serial -d 3 - binary: 'firmware/build/zephyr/zephyr.bin' - - - distro: rolling - branch: main - rtos: zephyr - platform: host - configuration: ping_pong - transport_arguments: -t udp -i 192.168.1.1 -p 8080 - binary: 'firmware/build/zephyr/zephyr.exe' - - - distro: rolling - branch: main - rtos: raspbian - platform: buster_v7 - configuration: agent_lite - binary: 'firmware/bin/micro_ros_agent_lite' - - - distro: rolling - branch: main - rtos: raspbian - platform: buster_v7 - configuration: weather_publisher - binary: 'firmware/bin/weather_publisher' - - - distro: rolling - branch: main - rtos: mbed - platform: disco_l475vg_iot01a - binary: 'firmware/micro_ros_mbed/cmake_build/DISCO_L475VG_IOT01A/develop/GCC_ARM/micro_ros_mbed.bin' - steps: - - uses: actions/checkout@v2 + Jazzy: + uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@jazzy with: - path: src/micro_ros_setup - ref: ${{ matrix.branch }} - - - name: Dependencies - run: | - apt update - apt upgrade -y - # Install last version of CMake - apt install -y apt-transport-https ca-certificates gnupg software-properties-common wget - if [ $(lsb_release -sr) = "22.04" ]; then - echo "Using Ubuntu mainline CMake" - else - echo "Adding Kitware CMake repo to install CMake" - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null - apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' - fi - apt-get update - apt install -y python3-colcon-metadata python3-pip cmake - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y + ci_target_ref: 'jazzy' - - uses: actions/download-artifact@v1 + Rolling: + uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@rolling with: - name: micro_ros_build_${{ matrix.branch }} - path: install - - # Workaround https://github.com/actions/upload-artifact/issues/38 - - run: | - chmod +x -R install - - - name: Configure and build micro-ROS - run: | - . /opt/ros/$ROS_DISTRO/setup.sh - . install/local_setup.sh - ros2 run micro_ros_setup create_firmware_ws.sh ${{ matrix.rtos }} ${{ matrix.platform }} - ros2 run micro_ros_setup configure_firmware.sh ${{ matrix.configuration }} ${{ matrix.transport_arguments }} - ros2 run micro_ros_setup build_firmware.sh ${{ matrix.build_arguments }} - - - name: Check binaries - run: | - (test -f ${{ matrix.binary }}) && true || false - - micro_ros_agent: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - distro: foxy - branch: foxy - - distro: rolling - branch: main - - distro: galactic - branch: galactic - - needs: micro_ros_build - container: ros:${{ matrix.distro }} + ci_target_ref: 'rolling' - steps: - - uses: actions/checkout@v2 + Humble: + uses: micro-ROS/micro_ros_setup/.github/workflows/ci.yml@humble with: - path: src/micro_ros_setup - ref: ${{ matrix.branch }} - - - name: dependencies - run: | - apt update - apt install -y python3-colcon-metadata python3-pip - apt install -y ros-${ROS_DISTRO}-rmw-fastrtps-cpp - rosdep update --os=ubuntu:jammy --rosdistro $ROS_DISTRO - rosdep install --os=ubuntu:jammy -y --from-paths src --ignore-src -y - - - uses: actions/download-artifact@v1 - with: - name: micro_ros_build_${{ matrix.branch }} - path: install - - # Workaround https://github.com/actions/upload-artifact/issues/38 - - run: | - chmod +x -R install - - - name: build - run: | - . /opt/ros/$ROS_DISTRO/setup.sh - . install/local_setup.sh - ros2 run micro_ros_setup create_agent_ws.sh - ros2 run micro_ros_setup build_agent.sh - - - name: installation - run: | - (test -f install/micro_ros_agent/lib/micro_ros_agent/micro_ros_agent) && true || false + ci_target_ref: 'humble' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..6f7e5ed6 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,15 @@ +name: Pull Request CI + +on: + pull_request: + paths-ignore: + - 'README.md' + branches: + - '**' + +jobs: + + CI: + uses: ./.github/workflows/ci.yml + with: + ci_target_ref: ${{ github.event.pull_request.head.ref }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f0d11dff..add91f3b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,43 @@ Changelog for package micro_ros_setup ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.3 (2023-06-12) +------------------ +* Update ros-tooling CI version (`#637 `_) +* Support Segger J-Link to flash Olimex E407 (`#635 `_) +* Fix nigthly build (`#634 `_) +* Remove galactic from CI (`#624 `_) +* Add reference to micro-ROS book chapter. +* Add RT-Thread to Readme (`#604 `_) + +3.1.2 (2022-09-28) +------------------ +* Fix humble repos (`#572 `_) +* Fix mbed cmake version on CI (`#569 `_) +* Remove unnessary check (`#553 `_) (`#565 `_) +* Fix Nightly CMake (`#555 `_) + +3.1.1 (2022-07-14) +------------------ +* Add component command (`#540 `_) +* Fix CI host (`#535 `_) + +3.1.0 (2022-05-25) +------------------ +* Revert ROS2 test sources (`#524 `_) +* Humble release (`#513 `_) +* Add renesas dummy meta (`#516 `_) +* Fix readme rosdep (`#506 `_) +* Update Readme Rolling (`#492 `_) +* Modified zephyr create.sh to pull correct toolchain based on arch (`#499 `_) (`#500 `_) +* Remove Python 3.9 (`#496 `_) +* Fix CMake install in jammy (`#493 `_) +* Typo +* Fix CI upgrade ROS docker (backport `#489 `_) (`#490 `_) +* Fix Agent and host Rolling CI (`#486 `_) +* Enable rolling agent (`#479 `_) +* Contributors: Antonio Cuadros, Pablo Garrido, mergify[bot] + 3.0.0 (2022-03-28) ------------------ * Initial release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 031e2e83..fa2997a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,9 +39,9 @@ install( ) install( - PROGRAMS - scripts/create_ws.sh - scripts/create_agent_ws.sh + PROGRAMS + scripts/create_ws.sh + scripts/create_agent_ws.sh scripts/create_firmware_ws.sh scripts/configure_firmware.sh scripts/flash_firmware.sh @@ -49,5 +49,6 @@ install( scripts/build_agent.sh scripts/yaml_filter.py scripts/clean_env.sh + scripts/component DESTINATION lib/${PROJECT_NAME} ) diff --git a/NOTICE b/NOTICE index 17a152ed..47ce6bdc 100644 --- a/NOTICE +++ b/NOTICE @@ -25,6 +25,8 @@ eProsima Jose Antonio Moral Pablo Garrido +Jakob Friedl + Robert Bosch GmbH Ingo Lütkebohle Ralph Lange diff --git a/README.md b/README.md index 1ef3f9aa..c83410f2 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ This ROS 2 package is the entry point for building micro-ROS apps for different - [Purpose of the Project](#purpose-of-the-project) - [License](#license) - [Known Issues / Limitations](#known-issues--limitations) +- [Papers](#papers) # Supported platforms @@ -54,6 +55,13 @@ This package provides tools and utils to crosscompile micro-ROS with just the co ## Standalone build system tools +`micro_ros_setup` provides access to standalone build system tools using the `component` command. +After [building this package](#building) just run: + +```bash +ros2 run micro_ros_setup component --help +``` + micro-ROS standalone module for specific platforms are: - 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. @@ -62,6 +70,7 @@ micro-ROS standalone module for specific platforms are: - 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. - 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. - 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. +- 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. - 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. - 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. - a library builder for **[PlatformIO](https://github.com/micro-ROS/micro_ros_platformio)**: this package enables the integration of micro-ROS in PlatformIO. @@ -77,7 +86,8 @@ This package targets the **ROS 2** installation. ROS 2 supported distributions a | Crystal | EOL | `crystal` | | Dashing | EOL | `dashing` | | Foxy | Supported | `foxy` | -| Galactic | Supported | `galactic` | +| Galactic | EOL | `galactic` | +| Humble | Supported | `humble` | | Rolling | Supported | `main` | Some other prerequisites needed for building a firmware using this package are: @@ -104,7 +114,7 @@ source /opt/ros/$ROS_DISTRO/setup.bash mkdir uros_ws && cd uros_ws -git clone -b main https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup +git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup rosdep update && rosdep install --from-paths src --ignore-src -y @@ -236,3 +246,25 @@ see the file [3rd-party-licenses.txt](3rd-party-licenses.txt). There are no known limitations. If you find issues, [please report them](https://github.com/micro-ROS/micro_ros_setup/issues). + +# Papers + +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)): + +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.) + +```bibtex +@INBOOK{Belsare_et_al_2023_Micro-ROS, + author = {Kaiwalya Belsare and Antonio Cuadros Rodriguez and Pablo Garrido S\'{a}nchez and Juanjo Hierro + and Tomasz Ko\l{}con and Ralph Lange and Ingo L\"{u}tkebohle and Alexandre Malki + and Jaime Martin Losa and Francisco Melendez and Maria Merlan Rodriguez and Arne Nordmann + and Jan Staschulat and and Julian von Mendel}, + title = {Micro-ROS}, + editor = {Anis Koubaa}, + booktitle = {Robot Operating System (ROS): The Complete Reference (Volume 7)}, + year = {2023}, + publisher = {Springer}, + pages = {3--55}, + doi = {10.1007/978-3-031-09062-2_2} +} +``` diff --git a/config/agent_uros_packages.repos b/config/agent_uros_packages.repos index 97752f27..99c0cb80 100644 --- a/config/agent_uros_packages.repos +++ b/config/agent_uros_packages.repos @@ -2,12 +2,8 @@ repositories: uros/micro_ros_msgs: type: git url: https://github.com/micro-ROS/micro_ros_msgs.git - version: main + version: humble uros/micro-ROS-Agent: type: git url: https://github.com/micro-ROS/micro-ROS-Agent.git - version: main - uros/drive_base: - type: git - url: https://github.com/micro-ROS/drive_base.git - version: master + version: humble \ No newline at end of file diff --git a/config/android/generic/client_uros_packages.repos b/config/android/generic/client_uros_packages.repos index 2be1f888..c4e3bbf2 100644 --- a/config/android/generic/client_uros_packages.repos +++ b/config/android/generic/client_uros_packages.repos @@ -2,51 +2,50 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: foxy + version: ros2 eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: foxy + version: ros2 # MicroROS uros/rcl: type: git url: https://github.com/micro-ROS/rcl - version: galactic + version: humble uros/rclc: type: git url: https://github.com/ros2/rclc - version: galactic + version: humble uros/micro_ros_utilities: type: git url: https://github.com/micro-ROS/micro_ros_utilities - version: main - version: galactic + version: humble uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils - version: galactic + version: humble uros/micro_ros_msgs: type: git url: https://github.com/micro-ROS/micro_ros_msgs.git - version: galactic + version: humble uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: galactic + version: humble uros/rosidl_typesupport: type: git url: https://github.com/micro-ROS/rosidl_typesupport.git - version: galactic + version: humble uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: galactic + version: humble uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing.git/ - version: galactic + version: humble uros/micro-ROS-demos: type: git url: https://github.com/micro-ROS/micro-ROS-demos.git - version: galactic + version: humble diff --git a/config/client_uros_packages.repos b/config/client_uros_packages.repos index e745d465..7f696a72 100644 --- a/config/client_uros_packages.repos +++ b/config/client_uros_packages.repos @@ -2,46 +2,46 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: foxy + version: ros2 eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: foxy + version: ros2 # MicroROS uros/rcl: type: git url: https://github.com/micro-ROS/rcl - version: master + version: humble uros/rclc: type: git url: https://github.com/ros2/rclc - version: master + version: humble uros/micro_ros_utilities: type: git url: https://github.com/micro-ROS/micro_ros_utilities - version: main + version: humble uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils - version: master + version: humble uros/micro_ros_msgs: type: git url: https://github.com/micro-ROS/micro_ros_msgs.git - version: main + version: humble uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: main + version: humble uros/rosidl_typesupport: type: git url: https://github.com/micro-ROS/rosidl_typesupport.git - version: master + version: humble uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: main + version: humble uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing.git/ - version: master + version: humble diff --git a/config/freertos/crazyflie21/board.repos b/config/freertos/crazyflie21/board.repos index 508756d9..d35d8eb7 100644 --- a/config/freertos/crazyflie21/board.repos +++ b/config/freertos/crazyflie21/board.repos @@ -7,5 +7,5 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ROS/freertos_apps - version: main + version: humble diff --git a/config/freertos/esp32/board.repos b/config/freertos/esp32/board.repos index e66890cf..edfe6847 100644 --- a/config/freertos/esp32/board.repos +++ b/config/freertos/esp32/board.repos @@ -2,7 +2,7 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ROS/freertos_apps - version: main + version: humble diff --git a/config/freertos/esp32/create.sh b/config/freertos/esp32/create.sh index 47610713..dff641da 100755 --- a/config/freertos/esp32/create.sh +++ b/config/freertos/esp32/create.sh @@ -26,7 +26,7 @@ pushd $FW_TARGETDIR >/dev/null . $IDF_PATH/export.sh - pip3 install catkin_pkg lark-parser empy + pip3 install catkin_pkg lark-parser empy==3.3.4 colcon-common-extensions popd >/dev/null diff --git a/config/freertos/nucleo_f446re/board.repos b/config/freertos/nucleo_f446re/board.repos index 4557031e..3a8de066 100644 --- a/config/freertos/nucleo_f446re/board.repos +++ b/config/freertos/nucleo_f446re/board.repos @@ -2,4 +2,4 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ros/freertos_apps - version: main + version: humble diff --git a/config/freertos/nucleo_f446ze/board.repos b/config/freertos/nucleo_f446ze/board.repos index 4557031e..3a8de066 100644 --- a/config/freertos/nucleo_f446ze/board.repos +++ b/config/freertos/nucleo_f446ze/board.repos @@ -2,4 +2,4 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ros/freertos_apps - version: main + version: humble diff --git a/config/freertos/nucleo_f746zg/board.repos b/config/freertos/nucleo_f746zg/board.repos index 4557031e..3a8de066 100644 --- a/config/freertos/nucleo_f746zg/board.repos +++ b/config/freertos/nucleo_f746zg/board.repos @@ -2,4 +2,4 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ros/freertos_apps - version: main + version: humble diff --git a/config/freertos/nucleo_f767zi/board.repos b/config/freertos/nucleo_f767zi/board.repos index 4557031e..3a8de066 100644 --- a/config/freertos/nucleo_f767zi/board.repos +++ b/config/freertos/nucleo_f767zi/board.repos @@ -2,4 +2,4 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ros/freertos_apps - version: main + version: humble diff --git a/config/freertos/olimex-stm32-e407/board.repos b/config/freertos/olimex-stm32-e407/board.repos index e66890cf..24ad5097 100644 --- a/config/freertos/olimex-stm32-e407/board.repos +++ b/config/freertos/olimex-stm32-e407/board.repos @@ -1,8 +1,8 @@ repositories: freertos_apps: type: git - url: https://github.com/micro-ROS/freertos_apps - version: main + url: https://github.com/micro-ros/freertos_apps + version: humble diff --git a/config/freertos/olimex-stm32-e407/flash.sh b/config/freertos/olimex-stm32-e407/flash.sh index f9e18e12..fabbe051 100755 --- a/config/freertos/olimex-stm32-e407/flash.sh +++ b/config/freertos/olimex-stm32-e407/flash.sh @@ -15,6 +15,8 @@ pushd $OLIMEX_EXTENSIONS_DIR > /dev/null PROGRAMMER=interface/stlink-v2-1.cfg elif lsusb -d 0483:3748; then PROGRAMMER=interface/stlink-v2.cfg + elif lsusb -d 1366:0101 || lsusb -d 1366:0105; then + PROGRAMMER=interface/jlink.cfg else echo "Error. Unsuported OpenOCD USB programmer" exit 1 @@ -27,3 +29,4 @@ pushd $OLIMEX_EXTENSIONS_DIR > /dev/null popd > /dev/null + diff --git a/config/generate_lib/generic/build.sh b/config/generate_lib/generic/build.sh index 7db6e00c..891676b6 100755 --- a/config/generate_lib/generic/build.sh +++ b/config/generate_lib/generic/build.sh @@ -22,7 +22,7 @@ BUILD_DIR=$FW_TARGETDIR/build pushd $FW_TARGETDIR/mcu_ws >/dev/null rm -rf build install log - + colcon build \ --merge-install \ --packages-ignore-regex=.*_cpp \ @@ -48,6 +48,8 @@ pushd $FW_TARGETDIR/mcu_ws >/dev/null done ; \ ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); mkdir -p $BUILD_DIR; cp libmicroros.a $BUILD_DIR; ranlib $BUILD_DIR/libmicroros.a; \ cp -R $FW_TARGETDIR/mcu_ws/install/include $BUILD_DIR/; \ + rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp"); \ + rm -rf $(find $BUILD_DIR/include -type d -empty); \ cd ..; rm -rf libmicroros; popd >/dev/null diff --git a/config/host/generic/client_host_packages.repos b/config/host/generic/client_host_packages.repos index 6a513446..1ebdc314 100644 --- a/config/host/generic/client_host_packages.repos +++ b/config/host/generic/client_host_packages.repos @@ -2,57 +2,57 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: foxy + version: ros2 eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: foxy + version: ros2 # MicroROS uros/rclc: type: git url: https://github.com/ros2/rclc.git - version: master + version: humble uros/micro_ros_msgs: type: git url: https://github.com/micro-ROS/micro_ros_msgs.git - version: main + version: humble uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: main + version: humble uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: main + version: humble uros/micro-ROS-demos: type: git url: https://github.com/micro-ROS/micro-ROS-demos.git - version: main + version: humble uros/micro_ros_utilities: type: git url: https://github.com/micro-ROS/micro_ros_utilities - version: main + version: humble # Required messages packages ros2/common_interfaces: type: git url: https://github.com/ros2/common_interfaces - version: foxy + version: humble ros2/example_interfaces: type: git url: https://github.com/ros2/example_interfaces - version: foxy + version: humble ros2/rcl_interfaces: type: git url: https://github.com/ros2/rcl_interfaces - version: foxy + version: humble ros2/unique_identifier_msgs: type: git url: https://github.com/ros2/unique_identifier_msgs - version: foxy + version: humble diff --git a/config/host/generic/create.sh b/config/host/generic/create.sh index 430d9996..ab52b547 100755 --- a/config/host/generic/create.sh +++ b/config/host/generic/create.sh @@ -6,7 +6,7 @@ ros2 run micro_ros_setup create_ws.sh src $PREFIX/config/$RTOS/client_ros2_packa # add appropriate colcon.meta cp $PREFIX/config/$RTOS/$PLATFORM/client-host-colcon.meta src/colcon.meta -rosdep install --os=ubuntu:jammy -y --from-paths src -i src --skip-keys="$SKIP" -r +rosdep install -y --from-paths src -i src --skip-keys="$SKIP" -r touch src/uros/rclc/rclc_examples/COLCON_IGNORE touch src/uros/rclc/rclc_lifecycle/COLCON_IGNORE \ No newline at end of file diff --git a/config/mbed/generic/board.repos b/config/mbed/generic/board.repos index dc8427fd..ff900f99 100644 --- a/config/mbed/generic/board.repos +++ b/config/mbed/generic/board.repos @@ -2,4 +2,4 @@ repositories: micro_ros_mbed: type: git url: https://github.com/micro-ROS/micro_ros_mbed - version: main + version: humble diff --git a/config/raspbian/generic/configure.sh b/config/raspbian/generic/configure.sh index 0823da40..a8d73c8a 100755 --- a/config/raspbian/generic/configure.sh +++ b/config/raspbian/generic/configure.sh @@ -3,7 +3,7 @@ pushd $FW_TARGETDIR >/dev/null rm -rf mcu_ws/* cp raspbian_apps/toolchain.cmake mcu_ws/ - curl -s https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos |\ + curl -s https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos |\ ros2 run micro_ros_setup yaml_filter.py raspbian_apps/$CONFIG_NAME/ros2_repos.filter > ros2.repos vcs import --input ros2.repos mcu_ws/ && rm ros2.repos diff --git a/config/raspbian/generic/create.sh b/config/raspbian/generic/create.sh index 27fff17f..f5af2a5a 100755 --- a/config/raspbian/generic/create.sh +++ b/config/raspbian/generic/create.sh @@ -18,5 +18,5 @@ pushd $FW_TARGETDIR/$DEV_WS_DIR >/dev/null popd >/dev/null pushd $FW_TARGETDIR >/dev/null - git clone -b main https://github.com/micro-ROS/raspbian_apps.git + git clone -b humble https://github.com/micro-ROS/raspbian_apps.git popd >/dev/null \ No newline at end of file diff --git a/config/renesas_ra/ra6m5/board.repos b/config/renesas_ra/ra6m5/board.repos index ce3653b9..868670ff 100644 --- a/config/renesas_ra/ra6m5/board.repos +++ b/config/renesas_ra/ra6m5/board.repos @@ -2,4 +2,4 @@ repositories: micro_ros_renesas_demos: type: git url: https://github.com/micro-ROS/micro_ros_renesas_demos - version: main + version: humble diff --git a/config/zephyr/generic/board.repos b/config/zephyr/generic/board.repos index 2f2ba35d..8f83bf70 100644 --- a/config/zephyr/generic/board.repos +++ b/config/zephyr/generic/board.repos @@ -2,4 +2,4 @@ repositories: zephyr_apps: type: git url: https://github.com/micro-ROS/zephyr_apps - version: main + version: humble diff --git a/config/zephyr/generic/create.sh b/config/zephyr/generic/create.sh index aa613243..5b470031 100755 --- a/config/zephyr/generic/create.sh +++ b/config/zephyr/generic/create.sh @@ -28,7 +28,7 @@ pushd $FW_TARGETDIR >/dev/null west update popd >/dev/null - pip3 install -r zephyrproject/zephyr/scripts/requirements.txt + pip3 install -r zephyrproject/zephyr/scripts/requirements.txt --ignore-installed if [ "$PLATFORM" = "host" ]; then if [ "$ARCH" = "aarch64" ]; then @@ -66,7 +66,7 @@ pushd $FW_TARGETDIR >/dev/null touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE - # Workaround. Remove when https://github.com/sphinx-doc/sphinx/issues/10291 and https://github.com/micro-ROS/micro_ros_zephyr_module/runs/5714546662?check_suite_focus=true - pip3 install --upgrade Sphinx + # Upgrade sphinx + pip install --force-reinstall docutils==0.16 Sphinx==4.2.0 popd >/dev/null diff --git a/package.xml b/package.xml index cb54caf8..48a1d01b 100644 --- a/package.xml +++ b/package.xml @@ -2,9 +2,10 @@ micro_ros_setup - 3.0.0 + 3.1.3 Tools for setting up micro-ROS workspaces - Ingo Lütkebohle + Eugenio Collado + Carlos Espinoza Apache-2.0 ament_cmake diff --git a/scripts/build_firmware.sh b/scripts/build_firmware.sh index a570b232..e82cc0fe 100755 --- a/scripts/build_firmware.sh +++ b/scripts/build_firmware.sh @@ -69,9 +69,24 @@ fi # Building specific firmware folder echo "Building firmware for $RTOS platform $PLATFORM" -if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then +# Use the generic platform if directory found +if [ -d "$PREFIX/config/$RTOS/generic" ]; then . $PREFIX/config/$RTOS/generic/build.sh else . $PREFIX/config/$RTOS/$PLATFORM/build.sh fi +######## Fix include paths ######## +if [ "$RTOS" != "host" ]; then + cd "$FW_TARGETDIR/mcu_ws" + INCLUDE_ROS2_PACKAGES=$(colcon list | awk '{print $1}' | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}') + + for var in ${INCLUDE_ROS2_PACKAGES}; do + if [ -d "$FW_TARGETDIR/build/include/${var}/${var}" ]; then + mkdir -p "$FW_TARGETDIR/build/include/${var}" + cp -a "$FW_TARGETDIR/build/include/${var}/${var}/". "$FW_TARGETDIR/build/include/${var}/" + rm -rf "$FW_TARGETDIR/build/include/${var}/${var}" + fi + done +fi + diff --git a/scripts/component b/scripts/component new file mode 100755 index 00000000..ced3b0c9 --- /dev/null +++ b/scripts/component @@ -0,0 +1,109 @@ +#! /usr/bin/env python3 + +import sys +from textwrap import wrap +import os + +MAX_CHARACTERS = 80 + +COMPONENTS = [ + { + "name": "renesas_e2_studio", + "description": "micro-ROS component for Renesas e2 studio and RA6M5: this package enables the integration of micro-ROS in Renesas e2 studio for RA6M5 and RA6T2 MCUs.", + "url" : "https://github.com/micro-ROS/micro_ros_renesas2estudio_component" + }, + { + "name": "esp_idf", + "description": "micro-ROS component for ESP-IDF: this package enables the integration of micro-ROS in any Espressif ESP32 IDF project.", + "url" : "https://github.com/micro-ROS/micro_ros_espidf_component" + }, + { + "name": "zephyr_rtos", + "description": "micro-ROS module for Zephyr RTOS: this package enables the integration of micro-ROS in any Zephyr RTOS workspace.", + "url" : "https://github.com/micro-ROS/micro_ros_zephyr_module" + }, + { + "name": "mbed_rtos", + "description": "micro-ROS module for Mbed RTOS: this package enables the integration of micro-ROS in any Mbed RTOS workspace.", + "url" : "https://github.com/micro-ROS/micro_ros_mbed" + }, + { + "name": "nuttx_rtos", + "description": "micro-ROS module for NuttX RTOS: this package enables the integration of micro-ROS in any NuttX RTOS workspace.", + "url" : "https://github.com/micro-ROS/micro_ros_nuttx_app" + }, + { + "name": "azure_rtos", + "description": "micro-ROS module for Microsoft Azure RTOS: this package enables the integration of micro-ROS in a Microsoft Azure RTOS workspace.", + "url" : "https://github.com/micro-ROS/micro_ros_azure_rtos_app" + }, + { + "name": "tiva_c_series", + "description": "micro-ROS app for TI Tiva™ C Series: this package enables the integration of micro-ROS in Texas Instruments Tiva™ C Series.", + "url" : "https://github.com/micro-ROS/micro_ros_tivac_launchpad_app" + }, + { + "name": "stm32cube", + "description": "micro-ROS utils for STM32CubeMX and STM32CubeIDE: this package enables the integration of micro-ROS in STM32CubeMX and STM32CubeIDE.", + "url" : "https://github.com/micro-ROS/micro_ros_stm32cubemx_utils" + }, + { + "name": "platformio", + "description": "micro-ROS module for PlatformIO: this package enables the integration of micro-ROS in PlatformIO.", + "url" : "https://github.com/micro-ROS/micro_ros_platformio" + }, + { + "name": "arduino", + "description": "Arduino IDE & CLI libraries for micro-ROS: this package enables the integration of micro-ROS in the Arduino IDE for some hardware platforms.", + "url" : "https://github.com/micro-ROS/micro_ros_arduino" + }, + { + "name": "raspberry_pi_pico", + "description": "Raspberry Pi Pico SDK libraries for micro-ROS: this package enables the integration of micro-ROS in the Raspberry Pi Pico SDK.", + "url" : "https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk" + } +] + +def print_help(extended = False): + if extended: + print("Usage: ros2 run micro_ros_setup component ") + print("") + for component in COMPONENTS: + description = "\n\t".join(wrap(component["description"], MAX_CHARACTERS)) + print("[{}] \n\t{}\n".format(component["name"], description)) + else: + print("Usage: ros2 run micro_ros_setup component ") + print("Available components: {}".format(", ".join([c["name"] for c in COMPONENTS]))) + +# No arguments +if len(sys.argv) < 2: + print_help() + sys.exit(0) + +# User asks for help +if "-h" in sys.argv or "--help" in sys.argv: + print_help(True) + sys.exit(0) + +# Component select +component_name = sys.argv[1] +if component_name in [x["name"] for x in COMPONENTS]: + component = [x for x in COMPONENTS if x["name"] == component_name][0] + repo_folder_name = os.getcwd() + "/" + component["url"].split("/")[-1] + + print("Using micro-ROS {} component".format(component_name)) + print("\t{}".format("\n\t".join(wrap(component["description"], MAX_CHARACTERS)))) + print("") + + if os.path.exists(repo_folder_name): + print("Folder {} already exists!".format(repo_folder_name)) + else: + print("Cloning repository...") + os.system("git clone {} > /dev/null 2>&1".format(component["url"])) + print("{} repository cloned at {}".format(component_name, repo_folder_name)) + print("") + + print("FOR USAGE INSTRUCTIONS VISIT: {}".format(component["url"] + "#readme")) +else: + print("Unknown component: {}".format(component_name)) + print_help(True) diff --git a/scripts/configure_firmware.sh b/scripts/configure_firmware.sh index dca58e16..467710ea 100755 --- a/scripts/configure_firmware.sh +++ b/scripts/configure_firmware.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/bash set -e set -o nounset @@ -17,7 +17,7 @@ else fi # Check if configure script exists -if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then +if [ -d "$PREFIX/config/$RTOS/generic" ]; then if [ ! -f $PREFIX/config/$RTOS/generic/configure.sh ]; then echo "No configuration step needed for generic platform $PLATFORM" exit 0 @@ -32,7 +32,7 @@ fi # Parsing micro-ROS arguments if [ $# -lt 1 ]; then echo "micro-ROS application name must be provided: ros2 run micro_ros_setup configure_firmware.sh [app name] [options]" - # Check if RTOS has app listing funcions and source in case + # Check if RTOS has app listing funcions and source in case if [ -f $PREFIX/config/$RTOS/list_apps.sh ]; then . $PREFIX/config/$RTOS/list_apps.sh print_available_apps @@ -80,7 +80,7 @@ while [[ $# -gt 0 ]]; do done # Configure specific firmware folder if needed -if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then +if [ -d "$PREFIX/config/$RTOS/generic" ]; then echo "Configuring firmware for $RTOS platform $PLATFORM" exec $PREFIX/config/$RTOS/generic/configure.sh $@ else diff --git a/scripts/create_firmware_ws.sh b/scripts/create_firmware_ws.sh index 6a8659a8..4ec28bf9 100755 --- a/scripts/create_firmware_ws.sh +++ b/scripts/create_firmware_ws.sh @@ -76,7 +76,7 @@ fi 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 $EXTERNAL_SKIP" # Check generic build -if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then +if [ -d "$PREFIX/config/$RTOS/generic" ]; then TARGET_FOLDER=generic else TARGET_FOLDER=$PLATFORM diff --git a/scripts/create_ws.sh b/scripts/create_ws.sh index 0485ccbf..769e5a9d 100755 --- a/scripts/create_ws.sh +++ b/scripts/create_ws.sh @@ -40,7 +40,7 @@ then fi # ROS_DISTRO SPECIFIC -curl -s https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos |\ +curl -s https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos |\ ros2 run micro_ros_setup yaml_filter.py ${PACKAGES} > ros2.repos vcs import --input ros2.repos --skip-existing vcs import --input $REPOS --skip-existing diff --git a/scripts/flash_firmware.sh b/scripts/flash_firmware.sh index 23b080f2..15192dbd 100755 --- a/scripts/flash_firmware.sh +++ b/scripts/flash_firmware.sh @@ -17,7 +17,7 @@ else fi # Flash specific firmware folder if needed -if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then +if [ -d "$PREFIX/config/$RTOS/generic" ]; then if [ -f $PREFIX/config/$RTOS/generic/flash.sh ]; then echo "Flashing firmware for $RTOS platform $PLATFORM" . $PREFIX/config/$RTOS/generic/flash.sh