From 3f0379f1329480d579d66937ab4c4944de77eeee Mon Sep 17 00:00:00 2001 From: DorBenHarush Date: Tue, 11 Aug 2020 21:18:19 +0300 Subject: [PATCH 01/10] support for esp32-camera with freertos *add the esp32-camera repository to /esp-idf/components. Signed-off-by: Dor Ben Harush --- NOTICE | 3 +++ config/freertos/esp32/create.sh | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/NOTICE b/NOTICE index fb0568e7..169639d7 100644 --- a/NOTICE +++ b/NOTICE @@ -28,3 +28,6 @@ eProsima Robert Bosch GmbH Ingo Lütkebohle Ralph Lange + +Dor Ben Harush + Dor Ben Harush diff --git a/config/freertos/esp32/create.sh b/config/freertos/esp32/create.sh index 0db15dd3..690c3fcb 100755 --- a/config/freertos/esp32/create.sh +++ b/config/freertos/esp32/create.sh @@ -4,6 +4,10 @@ pushd $FW_TARGETDIR >/dev/null pushd toolchain >/dev/null git clone -b v4.0.1 --recursive https://github.com/espressif/esp-idf.git + pushd esp-idf/components + #add the esp32-camera reposirtoy to the components dircetory + git clone https://github.com/espressif/esp32-camera.git + popd mkdir espressif export IDF_TOOLS_PATH=$(pwd)/espressif From fb85bc8f549cb936a231c24696e58310a786af0a Mon Sep 17 00:00:00 2001 From: DorBenHarush Date: Tue, 11 Aug 2020 22:11:40 +0300 Subject: [PATCH 02/10] Update NOTICE --- NOTICE | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE b/NOTICE index 169639d7..7ffa2341 100644 --- a/NOTICE +++ b/NOTICE @@ -29,5 +29,6 @@ Robert Bosch GmbH Ingo Lütkebohle Ralph Lange + Dor Ben Harush Dor Ben Harush From 9ea745f8e31bd629978cefdd87a8e76b3e322f1c Mon Sep 17 00:00:00 2001 From: Dor Ben Harush <69308426+DorBenHarush@users.noreply.github.com> Date: Mon, 24 Aug 2020 08:51:38 +0300 Subject: [PATCH 03/10] Update config/freertos/esp32/create.sh Co-authored-by: Pablo Garrido --- config/freertos/esp32/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/freertos/esp32/create.sh b/config/freertos/esp32/create.sh index 690c3fcb..e5b20704 100755 --- a/config/freertos/esp32/create.sh +++ b/config/freertos/esp32/create.sh @@ -5,7 +5,7 @@ pushd $FW_TARGETDIR >/dev/null pushd toolchain >/dev/null git clone -b v4.0.1 --recursive https://github.com/espressif/esp-idf.git pushd esp-idf/components - #add the esp32-camera reposirtoy to the components dircetory + #add the esp32-camera repository to the components directory git clone https://github.com/espressif/esp32-camera.git popd mkdir espressif From 319893f631ad00f78653efc120910e712ce9b092 Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Tue, 1 Sep 2020 18:27:09 +0300 Subject: [PATCH 04/10] Update NOTICE --- NOTICE | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 7ffa2341..f41f33ce 100644 --- a/NOTICE +++ b/NOTICE @@ -29,6 +29,9 @@ Robert Bosch GmbH Ingo Lütkebohle Ralph Lange - Dor Ben Harush Dor Ben Harush + +Boston Engineering + Connor Lansdale + From 918c72ab342882464e61cc45fee71cb1462ef8fa Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Tue, 1 Sep 2020 18:29:52 +0300 Subject: [PATCH 05/10] Update NOTICE --- NOTICE | 3 --- 1 file changed, 3 deletions(-) diff --git a/NOTICE b/NOTICE index f41f33ce..b41eff3e 100644 --- a/NOTICE +++ b/NOTICE @@ -32,6 +32,3 @@ Robert Bosch GmbH Dor Ben Harush Dor Ben Harush -Boston Engineering - Connor Lansdale - From 87fd84568e2c300a2700d5faa9a494407352fa81 Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Wed, 30 Sep 2020 05:28:22 +0300 Subject: [PATCH 06/10] esp32cam notes --- config/freertos/esp32/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/freertos/esp32/README.md b/config/freertos/esp32/README.md index f9dc8672..a22df7ad 100644 --- a/config/freertos/esp32/README.md +++ b/config/freertos/esp32/README.md @@ -4,3 +4,10 @@ - You can run idf targets like `menuconfig` or `monitor` by specifing the target as an argument to the `build_firmware.sh` script - The GPIO pins for the configured serial port can be set with `menuconfig` (see `micro-ROS Transport Settings` menu) - ESP32 only runs in singlecore mode (`CONFIG_FREERTOS_UNICORE=y` setting) + + +# Notes for ESP32-CAMERA + +- SPIRAM is requierd only for ESP32-CAMERA and can cause a fatal error in ESP32 (Enable in `menuconfig Component config > ESP32-specific` OR add CONFIG_ESP32_SPIRAM_SUPPORT=y to `sdkconfig.defaults` file). +- Make sure that `rtc_gpio_desc` array is supported in `menuconfig: Component config > Driver configurations > RTCIO configuration` (set to TRUE) +- Choose your camera pins configuration in `menuconfig Camera configuration > Camera pins`. (`BOARD_ESP32CAM_AITHINKER` is default). From 605eb769d67ea5ef8c661b0f5d2faa6451f2cf3b Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Wed, 30 Sep 2020 09:11:14 +0300 Subject: [PATCH 07/10] IDF v4.1 --- config/freertos/esp32/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/freertos/esp32/create.sh b/config/freertos/esp32/create.sh index 25c1ad87..a4731495 100755 --- a/config/freertos/esp32/create.sh +++ b/config/freertos/esp32/create.sh @@ -3,7 +3,7 @@ pushd $FW_TARGETDIR >/dev/null mkdir toolchain pushd toolchain >/dev/null - git clone -b v4.0.1 --recursive https://github.com/espressif/esp-idf.git + git clone -b v4.1 --recursive https://github.com/espressif/esp-idf.git pushd esp-idf/components #add the esp32-camera repository to the components directory git clone https://github.com/espressif/esp32-camera.git From 3e163a2eefed15008d58066c7d8fa7d92335292c Mon Sep 17 00:00:00 2001 From: DorBenHarush Date: Wed, 30 Sep 2020 10:32:43 +0300 Subject: [PATCH 08/10] retrigger checks --- .github/workflows/ci.yml | 100 +++++------------- NOTICE | 5 +- README.md | 2 + .../freertos/crazyflie21/client-colcon.meta | 3 +- .../crazyflie21/client_uros_packages.repos | 2 +- config/freertos/esp32/README.md | 7 ++ config/freertos/esp32/build.sh | 3 +- config/freertos/esp32/client-colcon.meta | 3 +- .../freertos/esp32/client_uros_packages.repos | 2 +- config/freertos/esp32/configure.sh | 3 +- config/freertos/esp32/create.sh | 25 +++-- config/freertos/esp32/flash.sh | 3 +- .../freertos/nucleo_f446ze/client-colcon.meta | 3 +- .../nucleo_f446ze/client_uros_packages.repos | 2 +- .../olimex-stm32-e407/client-colcon.meta | 3 +- .../client_uros_packages.repos | 2 +- config/host/client_ros2_packages.txt | 2 + config/host/generic/build.sh | 8 ++ .../host/generic/client_host_packages.repos | 17 +++ config/host/generic/create.sh | 2 +- .../nuttx/generic/client_uros_packages.repos | 2 +- config/zephyr/generic/build.sh | 11 +- config/zephyr/generic/client-colcon.meta | 3 +- .../zephyr/generic/client_uros_packages.repos | 2 +- config/zephyr/generic/flash.sh | 9 ++ config/zephyr/generic/supported_platforms | 3 +- config/zephyr/list_apps.sh | 24 ++++- scripts/configure_firmware.sh | 4 +- scripts/create_firmware_ws.sh | 1 - 29 files changed, 144 insertions(+), 112 deletions(-) create mode 100644 config/host/client_ros2_packages.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb98c027..406b0d18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,28 +16,28 @@ jobs: with: path: src/micro_ros_setup - - name: dependencies + - name: Dependencies run: | apt update apt install -y python3-colcon-metadata python3-pip rosdep update rosdep install -y --from-paths src --ignore-src -y - - name: build + - name: Build run: | . /opt/ros/$ROS_DISTRO/setup.sh - colcon build --merge-install + colcon build - - name: installation + - name: Install micro-ROS build system run: | - (test -f install/lib/micro_ros_setup/build_firmware.sh) && true || false + (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 path: install - agent: + micro_ros_agent: runs-on: ubuntu-latest container: ros:${{github.base_ref}} needs: micro_ros_build @@ -61,77 +61,20 @@ jobs: # Workaround https://github.com/actions/upload-artifact/issues/38 - run: | - chmod +x -R install/lib/micro_ros_setup + 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 src - ros2 run micro_ros_setup build_agent.sh --merge-install + ros2 run micro_ros_setup create_agent_ws.sh + ros2 run micro_ros_setup build_agent.sh - name: installation run: | - (test -f install/lib/micro_ros_agent/micro_ros_agent) && true || false + (test -f install/micro_ros_agent/lib/micro_ros_agent/micro_ros_agent) && true || false - client_host: - runs-on: ubuntu-latest - container: ros:${{github.base_ref}} - needs: micro_ros_build - - steps: - - uses: actions/checkout@v2 - with: - path: src/micro_ros_setup - - - name: dependencies - run: | - apt update - apt install -y python3-colcon-metadata python3-pip - rosdep update - rosdep install -y --from-paths src --ignore-src -y - - - uses: actions/download-artifact@v1 - with: - name: micro_ros_build - path: install - - # Workaround https://github.com/actions/upload-artifact/issues/38 - - run: | - chmod +x -R install/lib/micro_ros_setup - chmod +x install/config/host/generic/*.sh - - # Skip rclc packages due to build fail. Once the issues with rclc are solved will be back to CI. - - name: build - run: | - . /opt/ros/$ROS_DISTRO/setup.sh - . install/local_setup.sh - ros2 run micro_ros_setup create_firmware_ws.sh host - colcon build --merge-install --metas src - - - name: installation - run: | - (test -f install/lib/micro_ros_demos_rclc/addtwoints_client/addtwoints_client) && true || false - (test -f install/lib/micro_ros_demos_rclc/addtwoints_server/addtwoints_server) && true || false - (test -f install/lib/micro_ros_demos_rclc/complex_msg_publisher/complex_msg_publisher) && true || false - (test -f install/lib/micro_ros_demos_rclc/complex_msg_subscriber/complex_msg_subscriber) && true || false - (test -f install/lib/micro_ros_demos_rclc/configured_publisher/configured_publisher) && true || false - (test -f install/lib/micro_ros_demos_rclc/configured_subscriber/configured_subscriber) && true || false - (test -f install/lib/micro_ros_demos_rclc/fibonacci_action_client/fibonacci_action_client) && true || false - (test -f install/lib/micro_ros_demos_rclc/fibonacci_action_server/fibonacci_action_server) && true || false - (test -f install/lib/micro_ros_demos_rclc/fragmented_publication/fragmented_publication) && true || false - (test -f install/lib/micro_ros_demos_rclc/fragmented_subscription/fragmented_subscription) && true || false - (test -f install/lib/micro_ros_demos_rclc/int32_multinode/int32_multinode) && true || false - (test -f install/lib/micro_ros_demos_rclc/int32_publisher/int32_publisher) && true || false - (test -f install/lib/micro_ros_demos_rclc/int32_publisher_subscriber/int32_publisher_subscriber) && true || false - (test -f install/lib/micro_ros_demos_rclc/int32_subscriber/int32_subscriber) && true || false - (test -f install/lib/micro_ros_demos_rclc/ping_pong/ping_pong) && true || false - (test -f install/lib/micro_ros_demos_rclc/string_publisher/string_publisher) && true || false - (test -f install/lib/micro_ros_demos_rclc/string_subscriber/string_subscriber) && true || false - (test -f install/lib/micro_ros_demos_rclc/timer/timer) && true || false - - #Build test for FreeRTOS and Zephyr - client_firmware: + micro_ros_client: runs-on: ubuntu-latest container: ros:${{github.base_ref}} needs: micro_ros_build @@ -140,6 +83,12 @@ jobs: fail-fast: false matrix: include: + - rtos: host + platform: null + configuration: null + transport_arguments: null + binary: 'install/micro_ros_demos_rclc/lib/micro_ros_demos_rclc/int32_publisher/int32_publisher' + - rtos: freertos platform: crazyflie21 configuration: crazyflie_position_publisher @@ -176,6 +125,12 @@ jobs: transport_arguments: -t serial-usb binary: 'firmware/build/zephyr/zephyr.bin' + - rtos: zephyr + platform: nucleo_h743zi + configuration: int32_publisher + transport_arguments: -t serial -d 3 + binary: 'firmware/build/zephyr/zephyr.bin' + - rtos: zephyr platform: host configuration: ping_pong @@ -203,7 +158,7 @@ jobs: with: path: src/micro_ros_setup - - name: dependencies + - name: Dependencies run: | apt update apt install -y python3-colcon-metadata python3-pip @@ -217,10 +172,9 @@ jobs: # Workaround https://github.com/actions/upload-artifact/issues/38 - run: | - chmod +x -R install/lib/micro_ros_setup - chmod +x -R install/config + chmod +x -R install - - name: build + - name: Configure and build micro-ROS run: | . /opt/ros/foxy/setup.sh . install/local_setup.sh @@ -228,6 +182,6 @@ jobs: ros2 run micro_ros_setup configure_firmware.sh ${{ matrix.configuration }} ${{ matrix.transport_arguments }} ros2 run micro_ros_setup build_firmware.sh - - name: binaries + - name: Check binaries run: | (test -f ${{ matrix.binary }}) && true || false diff --git a/NOTICE b/NOTICE index 7ffa2341..238d1151 100644 --- a/NOTICE +++ b/NOTICE @@ -29,6 +29,9 @@ Robert Bosch GmbH Ingo Lütkebohle Ralph Lange - +Boston Engineering + Connor Lansdale + Dor Ben Harush Dor Ben Harush + diff --git a/README.md b/README.md index b5d4ad22..642b23ad 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ This ROS 2 package is the entry point for building micro-ROS apps for different | [FreeRTOS](https://www.freertos.org/) | [Espressif ESP32](https://www.espressif.com/en/products/socs/esp32/overview) | v8.2.0 | `freertos esp32` | | [Zephyr](https://www.zephyrproject.org/) | [Olimex STM32-E407](https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware) | v2.3.0 | `zephyr olimex-stm32-e407` | | [Zephyr](https://www.zephyrproject.org/) | [ST B-L475E-IOT01A](https://docs.zephyrproject.org/latest/boards/arm/disco_l475_iot1/doc/index.html) | v2.3.0 | `zephyr discovery_l475_iot1` | +| [Zephyr](https://www.zephyrproject.org/) | [ST Nucleo H743ZI](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html) 1 | v2.3.0 | `zephyr nucleo_h743zi` | | [Zephyr](https://www.zephyrproject.org/) | [Zephyr emulator](https://docs.zephyrproject.org/2.3.0/boards/posix/native_posix/doc/index.html) | v2.3.0 | `zephyr host` | | Linux | *Host 2* | Ubuntu 18.04/20.04 | `host` | @@ -116,6 +117,7 @@ In summary, the supported configurations for transports are: | Crazyflie 2.1 | - | Custom Radio Link | - | | Espressif ESP32 | - | UART, WiFI UDP | - | | ST Nucleo F446ZE 1 | - | UART | - | +| ST Nucleo H743ZI 1 | - | - | UART | *1 Community supported, may have lack of official support* diff --git a/config/freertos/crazyflie21/client-colcon.meta b/config/freertos/crazyflie21/client-colcon.meta index 7cc2e0ed..178cf2a3 100644 --- a/config/freertos/crazyflie21/client-colcon.meta +++ b/config/freertos/crazyflie21/client-colcon.meta @@ -5,7 +5,8 @@ "-DENABLE_TESTING=OFF", "-DRCUTILS_NO_FILESYSTEM=ON", "-DRCUTILS_NO_LOGGING=ON", - "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", + "-DRCUTILS_NO_64_ATOMIC=ON" ] }, "microxrcedds_client":{ diff --git a/config/freertos/crazyflie21/client_uros_packages.repos b/config/freertos/crazyflie21/client_uros_packages.repos index 2f941f95..bf27a621 100644 --- a/config/freertos/crazyflie21/client_uros_packages.repos +++ b/config/freertos/crazyflie21/client_uros_packages.repos @@ -37,7 +37,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros # interim, until crosscompile fix is available in foxy branch ros2/tinydir_vendor: diff --git a/config/freertos/esp32/README.md b/config/freertos/esp32/README.md index f9dc8672..a22df7ad 100644 --- a/config/freertos/esp32/README.md +++ b/config/freertos/esp32/README.md @@ -4,3 +4,10 @@ - You can run idf targets like `menuconfig` or `monitor` by specifing the target as an argument to the `build_firmware.sh` script - The GPIO pins for the configured serial port can be set with `menuconfig` (see `micro-ROS Transport Settings` menu) - ESP32 only runs in singlecore mode (`CONFIG_FREERTOS_UNICORE=y` setting) + + +# Notes for ESP32-CAMERA + +- SPIRAM is requierd only for ESP32-CAMERA and can cause a fatal error in ESP32 (Enable in `menuconfig Component config > ESP32-specific` OR add CONFIG_ESP32_SPIRAM_SUPPORT=y to `sdkconfig.defaults` file). +- Make sure that `rtc_gpio_desc` array is supported in `menuconfig: Component config > Driver configurations > RTCIO configuration` (set to TRUE) +- Choose your camera pins configuration in `menuconfig Camera configuration > Camera pins`. (`BOARD_ESP32CAM_AITHINKER` is default). diff --git a/config/freertos/esp32/build.sh b/config/freertos/esp32/build.sh index 84c53db5..bf6e0b1f 100755 --- a/config/freertos/esp32/build.sh +++ b/config/freertos/esp32/build.sh @@ -5,8 +5,7 @@ EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_esp32_extensions export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf -export VIRTUAL_ENV="$FW_TARGETDIR/toolchain/python_env" -export PATH="$VIRTUAL_ENV/bin:$PATH" +eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) . $IDF_PATH/export.sh diff --git a/config/freertos/esp32/client-colcon.meta b/config/freertos/esp32/client-colcon.meta index a9cde9ec..bf9a5915 100644 --- a/config/freertos/esp32/client-colcon.meta +++ b/config/freertos/esp32/client-colcon.meta @@ -10,7 +10,8 @@ "cmake-args": [ "-DENABLE_TESTING=OFF", "-DRCUTILS_NO_FILESYSTEM=ON", - "-DRCUTILS_NO_THREAD_SUPPORT=ON" + "-DRCUTILS_NO_THREAD_SUPPORT=ON", + "-DRCUTILS_NO_64_ATOMIC=ON" ] }, "microxrcedds_client": { diff --git a/config/freertos/esp32/client_uros_packages.repos b/config/freertos/esp32/client_uros_packages.repos index 5951d1ff..d9a20d58 100644 --- a/config/freertos/esp32/client_uros_packages.repos +++ b/config/freertos/esp32/client_uros_packages.repos @@ -37,7 +37,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros # Remove this when it returns to ros2.repos ros2/tinydir_vendor: diff --git a/config/freertos/esp32/configure.sh b/config/freertos/esp32/configure.sh index f1017fb0..ef881685 100755 --- a/config/freertos/esp32/configure.sh +++ b/config/freertos/esp32/configure.sh @@ -61,8 +61,7 @@ UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf -export VIRTUAL_ENV="$FW_TARGETDIR/toolchain/python_env" -export PATH="$VIRTUAL_ENV/bin:$PATH" +eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) . $IDF_PATH/export.sh diff --git a/config/freertos/esp32/create.sh b/config/freertos/esp32/create.sh index 690c3fcb..a4731495 100755 --- a/config/freertos/esp32/create.sh +++ b/config/freertos/esp32/create.sh @@ -3,22 +3,29 @@ pushd $FW_TARGETDIR >/dev/null mkdir toolchain pushd toolchain >/dev/null - git clone -b v4.0.1 --recursive https://github.com/espressif/esp-idf.git - pushd esp-idf/components - #add the esp32-camera reposirtoy to the components dircetory - git clone https://github.com/espressif/esp32-camera.git - popd + git clone -b v4.1 --recursive https://github.com/espressif/esp-idf.git + pushd esp-idf/components + #add the esp32-camera repository to the components directory + git clone https://github.com/espressif/esp32-camera.git + popd + mkdir espressif export IDF_TOOLS_PATH=$(pwd)/espressif + export IDF_PATH=$(pwd)/esp-idf + alias python=python3 echo "Installing ESP-IDF tools" python3 esp-idf/tools/idf_tools.py install + + echo "Installing ESP-IDF virtualenv" + python3 esp-idf/tools/idf_tools.py install-python-env + + eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) + + . $IDF_PATH/export.sh - python3 -m venv --system-site-packages python_env - export VIRTUAL_ENV=$(pwd)/python_env - export PATH="$VIRTUAL_ENV/bin:$PATH" + pip3 install catkin_pkg lark-parser empy - pip install -r esp-idf/requirements.txt popd >/dev/null # Import repos diff --git a/config/freertos/esp32/flash.sh b/config/freertos/esp32/flash.sh index fb02c429..3322c221 100755 --- a/config/freertos/esp32/flash.sh +++ b/config/freertos/esp32/flash.sh @@ -3,8 +3,7 @@ EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_esp32_extensions export IDF_TOOLS_PATH=$FW_TARGETDIR/toolchain/espressif export IDF_PATH=$FW_TARGETDIR/toolchain/esp-idf -export VIRTUAL_ENV="$FW_TARGETDIR/toolchain/python_env" -export PATH="$VIRTUAL_ENV/bin:$PATH" +eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system) . $IDF_PATH/export.sh diff --git a/config/freertos/nucleo_f446ze/client-colcon.meta b/config/freertos/nucleo_f446ze/client-colcon.meta index f38fb07c..10715a73 100644 --- a/config/freertos/nucleo_f446ze/client-colcon.meta +++ b/config/freertos/nucleo_f446ze/client-colcon.meta @@ -10,7 +10,8 @@ "cmake-args": [ "-DENABLE_TESTING=OFF", "-DRCUTILS_NO_FILESYSTEM=ON", - "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", + "-DRCUTILS_NO_64_ATOMIC=ON" ] }, "microxrcedds_client": { diff --git a/config/freertos/nucleo_f446ze/client_uros_packages.repos b/config/freertos/nucleo_f446ze/client_uros_packages.repos index 5951d1ff..d9a20d58 100644 --- a/config/freertos/nucleo_f446ze/client_uros_packages.repos +++ b/config/freertos/nucleo_f446ze/client_uros_packages.repos @@ -37,7 +37,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros # Remove this when it returns to ros2.repos ros2/tinydir_vendor: diff --git a/config/freertos/olimex-stm32-e407/client-colcon.meta b/config/freertos/olimex-stm32-e407/client-colcon.meta index f38fb07c..5408fc23 100644 --- a/config/freertos/olimex-stm32-e407/client-colcon.meta +++ b/config/freertos/olimex-stm32-e407/client-colcon.meta @@ -10,7 +10,8 @@ "cmake-args": [ "-DENABLE_TESTING=OFF", "-DRCUTILS_NO_FILESYSTEM=ON", - "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", + "-DRCUTILS_NO_64_ATOMIC=ON" ] }, "microxrcedds_client": { diff --git a/config/freertos/olimex-stm32-e407/client_uros_packages.repos b/config/freertos/olimex-stm32-e407/client_uros_packages.repos index 5951d1ff..d9a20d58 100644 --- a/config/freertos/olimex-stm32-e407/client_uros_packages.repos +++ b/config/freertos/olimex-stm32-e407/client_uros_packages.repos @@ -37,7 +37,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros # Remove this when it returns to ros2.repos ros2/tinydir_vendor: diff --git a/config/host/client_ros2_packages.txt b/config/host/client_ros2_packages.txt new file mode 100644 index 00000000..07de46c1 --- /dev/null +++ b/config/host/client_ros2_packages.txt @@ -0,0 +1,2 @@ +keep: + none diff --git a/config/host/generic/build.sh b/config/host/generic/build.sh index bb86d162..af73abbb 100755 --- a/config/host/generic/build.sh +++ b/config/host/generic/build.sh @@ -1,2 +1,10 @@ #!/bin/bash +colcon build --packages-up-to rosidl_typesupport_microxrcedds_c --metas src $@ +colcon build --packages-up-to rosidl_typesupport_microxrcedds_cpp --metas src $@ + +set +o nounset +. /opt/ros/$ROS_DISTRO/setup.bash +. install/local_setup.bash +set -o nounset + colcon build --metas src $@ diff --git a/config/host/generic/client_host_packages.repos b/config/host/generic/client_host_packages.repos index 6363a8fa..a50a43a3 100644 --- a/config/host/generic/client_host_packages.repos +++ b/config/host/generic/client_host_packages.repos @@ -26,3 +26,20 @@ repositories: type: git url: https://github.com/micro-ROS/micro-ROS-demos.git version: foxy + +# Required messages packages + + ros2/common_interfaces: + type: git + url: https://github.com/ros2/common_interfaces + version: foxy + + ros2/example_interfaces: + type: git + url: https://github.com/ros2/example_interfaces + version: foxy + + ros2/rcl_interfaces: + type: git + url: https://github.com/ros2/rcl_interfaces + version: foxy diff --git a/config/host/generic/create.sh b/config/host/generic/create.sh index 14003e8d..c8c8d196 100755 --- a/config/host/generic/create.sh +++ b/config/host/generic/create.sh @@ -1,5 +1,5 @@ # populate the workspace -ros2 run micro_ros_setup create_ws.sh src $PREFIX/config/client_ros2_packages.txt $PREFIX/config/$RTOS/$PLATFORM/client_host_packages.repos +ros2 run micro_ros_setup create_ws.sh src $PREFIX/config/$RTOS/client_ros2_packages.txt $PREFIX/config/$RTOS/$PLATFORM/client_host_packages.repos # add appropriate colcon.meta cp $PREFIX/config/$RTOS/$PLATFORM/client-host-colcon.meta src/colcon.meta diff --git a/config/nuttx/generic/client_uros_packages.repos b/config/nuttx/generic/client_uros_packages.repos index 5c4e6cd3..3e94bf98 100644 --- a/config/nuttx/generic/client_uros_packages.repos +++ b/config/nuttx/generic/client_uros_packages.repos @@ -33,7 +33,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros uros/rosidl_typesupport: type: git url: https://github.com/micro-ROS/rosidl_typesupport.git diff --git a/config/zephyr/generic/build.sh b/config/zephyr/generic/build.sh index 7e5a555e..e62e16d2 100755 --- a/config/zephyr/generic/build.sh +++ b/config/zephyr/generic/build.sh @@ -12,7 +12,12 @@ pushd $FW_TARGETDIR >/dev/null unset UROS_APP export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) - export UROS_APP_FOLDER="$FW_TARGETDIR/zephyr_apps/apps/$UROS_APP" + + if [ -v UROS_CUSTOM_APP_FOLDER ]; then + export UROS_APP_FOLDER="$UROS_CUSTOM_APP_FOLDER/$UROS_APP" + else + export UROS_APP_FOLDER="$FW_TARGETDIR/zephyr_apps/apps/$UROS_APP" + fi if [ -d "$UROS_APP_FOLDER" ]; then echo "Selected app: $UROS_APP" @@ -36,6 +41,8 @@ pushd $FW_TARGETDIR >/dev/null export BOARD="olimex_stm32_e407" elif [ "$PLATFORM" = "nucleo_f401re" ]; then export BOARD="nucleo_f401re" + elif [ "$PLATFORM" = "nucleo_h743zi" ]; then + export BOARD="nucleo_h743zi" elif [ "$PLATFORM" = "host" ]; then export BOARD="native_posix" else @@ -62,5 +69,5 @@ pushd $FW_TARGETDIR >/dev/null fi # Build Zephyr + app - west build -b $BOARD -p auto $UROS_APP_FOLDER -- -DCONF_FILE=$UROS_APP_FOLDER/$CONF_FILE -G'Unix Makefiles' -DCMAKE_VERBOSE_MAKEFILE=ON + west build -b $BOARD -p auto $UROS_APP_FOLDER -- -DCONF_FILE=$UROS_APP_FOLDER/$CONF_FILE -G'Unix Makefiles' -DCMAKE_VERBOSE_MAKEFILE=ON -DMICRO_ROS_FIRMWARE_DIR=$FW_TARGETDIR popd >/dev/null diff --git a/config/zephyr/generic/client-colcon.meta b/config/zephyr/generic/client-colcon.meta index 63a9b4cd..85944570 100644 --- a/config/zephyr/generic/client-colcon.meta +++ b/config/zephyr/generic/client-colcon.meta @@ -23,7 +23,8 @@ "-DENABLE_TESTING=OFF", "-DRCUTILS_NO_FILESYSTEM=ON", "-DRCUTILS_NO_THREAD_SUPPORT=ON", - "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON", + "-DRCUTILS_NO_64_ATOMIC=ON" ] }, "microxrcedds_client": { diff --git a/config/zephyr/generic/client_uros_packages.repos b/config/zephyr/generic/client_uros_packages.repos index b74ef281..9759836d 100644 --- a/config/zephyr/generic/client_uros_packages.repos +++ b/config/zephyr/generic/client_uros_packages.repos @@ -21,7 +21,7 @@ repositories: uros/tracetools: type: git url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing - version: foxy + version: foxy_microros uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils diff --git a/config/zephyr/generic/flash.sh b/config/zephyr/generic/flash.sh index eef47511..e606aee0 100755 --- a/config/zephyr/generic/flash.sh +++ b/config/zephyr/generic/flash.sh @@ -25,6 +25,15 @@ elif [ "$PLATFORM" = "olimex-stm32-e407" ]; then fi openocd -f $PROGRAMMER -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/zephyr/zephyr.bin 0x08000000" -c "reset" -c "exit" + + elif [ "$PLATFORM" = "nucleo_h743zi" ]; then + if lsusb -d 0483:374e;then + PROGRAMMER=interface/stlink.cfg + TARGET=stm32h7x.cfg + fi + + openocd -f $PROGRAMMER -f target/$TARGET -c init -c "reset halt" -c "flash write_image erase build/zephyr/zephyr.bin 0x08000000" -c "reset run; exit" + else echo "build/zephyr/zephyr.bin not found: please compile before flashing." fi diff --git a/config/zephyr/generic/supported_platforms b/config/zephyr/generic/supported_platforms index 6b5f2198..990f32d1 100644 --- a/config/zephyr/generic/supported_platforms +++ b/config/zephyr/generic/supported_platforms @@ -1,3 +1,4 @@ discovery_l475_iot1 olimex-stm32-e407 -nucleo_f401re \ No newline at end of file +nucleo_f401re +nucleo_h743zi diff --git a/config/zephyr/list_apps.sh b/config/zephyr/list_apps.sh index 46c19fa2..a6e4648d 100644 --- a/config/zephyr/list_apps.sh +++ b/config/zephyr/list_apps.sh @@ -1,14 +1,28 @@ function print_available_apps { echo "Available apps for Zephyr and $PLATFORM:" - pushd $FW_TARGETDIR/zephyr_apps/apps >/dev/null - for app in $(ls -d */ | cut -f1 -d'/'); do - echo "+-- $app" - done + + if [ -v UROS_CUSTOM_APP_FOLDER ]; then + UROS_ZEPHYR_APPS=$UROS_CUSTOM_APP_FOLDER + else + UROS_ZEPHYR_APPS=$FW_TARGETDIR/zephyr_apps/apps + fi + + pushd $UROS_ZEPHYR_APPS >/dev/null + for app in $(ls -d */ | cut -f1 -d'/'); do + echo "+-- $app" + done popd >/dev/null } function check_available_app { - pushd $FW_TARGETDIR/zephyr_apps/apps >/dev/null + + if [ -v UROS_CUSTOM_APP_FOLDER ]; then + UROS_ZEPHYR_APPS=$UROS_CUSTOM_APP_FOLDER + else + UROS_ZEPHYR_APPS=$FW_TARGETDIR/zephyr_apps/apps + fi + + pushd $UROS_ZEPHYR_APPS >/dev/null if [ ! -d $1 ]; then echo "App $1 for Zephyr not available" print_available_apps diff --git a/scripts/configure_firmware.sh b/scripts/configure_firmware.sh index f09fdec6..e8c79153 100755 --- a/scripts/configure_firmware.sh +++ b/scripts/configure_firmware.sh @@ -20,12 +20,12 @@ fi if [ $PLATFORM != "generic" ] && [ -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 1 + exit 0 fi else if [ ! -f $PREFIX/config/$RTOS/$PLATFORM/configure.sh ]; then echo "No configuration step needed for $RTOS platform $PLATFORM" - exit 1 + exit 0 fi fi diff --git a/scripts/create_firmware_ws.sh b/scripts/create_firmware_ws.sh index fff0b5ce..282d7f5b 100755 --- a/scripts/create_firmware_ws.sh +++ b/scripts/create_firmware_ws.sh @@ -71,7 +71,6 @@ echo $PLATFORM >> $FW_TARGETDIR/PLATFORM SKIP="microxrcedds_agent microxrcedds_client microcdr rosidl_typesupport_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_opensplice_cpp rosidl_typesupport_opensplice_c rmw_connext_cpp rmw_opensplice_cpp ros-foxy-cyclonedds ros-foxy-rmw-cyclonedds-cpp" # Installing common packages -sudo apt update rosdep update rosdep install -y --from-paths src -i src --rosdistro foxy --skip-keys="$SKIP" From 449bdc790392435cba3a769c7ccc83726d2d93fd Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Wed, 28 Oct 2020 22:55:24 +0200 Subject: [PATCH 09/10] Update README.md --- config/freertos/esp32/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/freertos/esp32/README.md b/config/freertos/esp32/README.md index a22df7ad..dbdcd89a 100644 --- a/config/freertos/esp32/README.md +++ b/config/freertos/esp32/README.md @@ -8,6 +8,9 @@ # Notes for ESP32-CAMERA -- SPIRAM is requierd only for ESP32-CAMERA and can cause a fatal error in ESP32 (Enable in `menuconfig Component config > ESP32-specific` OR add CONFIG_ESP32_SPIRAM_SUPPORT=y to `sdkconfig.defaults` file). +- SPIRAM is requierd only for ESP32-CAMERA and can cause a fatal error in ESP32 (Enable in `menuconfig Component config > ESP32-specific` OR add `CONFIG_ESP32_SPIRAM_SUPPORT=y` to `sdkconfig.defaults` file). - Make sure that `rtc_gpio_desc` array is supported in `menuconfig: Component config > Driver configurations > RTCIO configuration` (set to TRUE) + OR write this line `CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC=y` to `sdk.defaults`. - Choose your camera pins configuration in `menuconfig Camera configuration > Camera pins`. (`BOARD_ESP32CAM_AITHINKER` is default). + + From 83f4e534a91f323453ca149e119615c2f7b0fc56 Mon Sep 17 00:00:00 2001 From: Dor Ben Harush Date: Wed, 28 Oct 2020 23:04:54 +0200 Subject: [PATCH 10/10] Update README.md --- config/freertos/esp32/README.md | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/config/freertos/esp32/README.md b/config/freertos/esp32/README.md index dbdcd89a..693af1a7 100644 --- a/config/freertos/esp32/README.md +++ b/config/freertos/esp32/README.md @@ -12,5 +12,46 @@ - Make sure that `rtc_gpio_desc` array is supported in `menuconfig: Component config > Driver configurations > RTCIO configuration` (set to TRUE) OR write this line `CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC=y` to `sdk.defaults`. - Choose your camera pins configuration in `menuconfig Camera configuration > Camera pins`. (`BOARD_ESP32CAM_AITHINKER` is default). +- In order to view the images you will need to create a cv_bridge: +``` +#!/usr/bin/env python3 +import rclpy +from rclpy.node import Node +from std_msgs.msg import String +from cv_bridge import CvBridge, CvBridgeError +from sensor_msgs.msg import CompressedImage +import cv2 +import numpy as np + + + + +class MinimalSubscriber(Node): + + def __init__(self, ): + super().__init__('minimal_subscriber') + self.subscription = self.create_subscription(CompressedImage, 'freertos_picture_publisher', self.listener_callback, 10) + self.subscription # prevent unused variable warning + self.bridge = CvBridge() + def listener_callback(self, image_message): + self.get_logger().info('recieved an image') + + #recieve image and co nvert to cv2 image + cv2.imshow('esp32_image', self.cv_image) + cv2.waitKey(3) + + + + +def main(args=None): + rclpy.init(args=args) + minimal_subscriber = MinimalSubscriber() + + rclpy.spin(minimal_subscriber) + minimal_subscriber.destroy_node() + rclpy.shutdown() + +if __name__ == '__main__': + main()