From 8103c3c2bbf52bc2cae5ff95fc61f06dd5792b62 Mon Sep 17 00:00:00 2001 From: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com> Date: Thu, 11 May 2023 14:37:41 +0200 Subject: [PATCH 1/8] Update rolling sources (#99) * Deprecate galactic Signed-off-by: acuadros95 * Update rolling sources Signed-off-by: acuadros95 * Fix rolling repo name Signed-off-by: acuadros95 * Set version for teensy compiler Signed-off-by: acuadros95 * Add penv activate Signed-off-by: acuadros95 * Test with previous compiler version Signed-off-by: acuadros95 * Test with prepend Signed-off-by: acuadros95 * Test with nosys.specs Signed-off-by: acuadros95 * Fix test Signed-off-by: acuadros95 * Fix test Signed-off-by: acuadros95 * Remove unnecesary change Signed-off-by: acuadros95 * Update repos with micro-ROS fork Signed-off-by: acuadros95 --------- Signed-off-by: acuadros95 --- .github/workflows/ci.yml | 2 +- README.md | 3 +- ci/extra_packages/extra_packages.repos | 2 +- ci/platformio.ini | 10 ------ extra_script.py | 6 +++- metas/common.meta | 3 +- microros_utils/library_builder.py | 9 ++--- microros_utils/repositories.py | 48 +++++--------------------- 8 files changed, 23 insertions(+), 60 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31a7248d..94d3b7d1 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, portenta_h7_m7_galactic, portenta_h7_m7_foxy, portenta_h7_m7_rolling, teensy41_custom, pico] + platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, portenta_h7_m7_foxy, portenta_h7_m7_rolling, teensy41_custom, pico] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 0012e730..9507560c 100755 --- a/README.md +++ b/README.md @@ -85,7 +85,6 @@ A explanation for adding custom targets is also present ### ROS 2 distribution The target ROS 2 distribution can be configured with the `board_microros_distro = `, supported values are: - `humble` *(default value)* - - `galactic` - `rolling` - `foxy` @@ -207,7 +206,7 @@ It is also possible to use custom transports on a `micro-XRCE Agent` instance. M ## Examples A simple publisher project using serial transport is available on the [examples](./examples) directory, this examples is meant to be modified with the user board. -- More micro-ROS usage examples are available on [micro-ROS-demos/rclc](https://github.com/micro-ROS/micro-ROS-demos/tree/galactic/rclc). +- More micro-ROS usage examples are available on [micro-ROS-demos/rclc](https://github.com/micro-ROS/micro-ROS-demos/tree/humble/rclc). - For a complete micro-ROS tutorial, check [Programming with rcl and rclc](https://micro.ros.org/docs/tutorials/programming_rcl_rclc/overview/) documentation. ## Purpose of the Project diff --git a/ci/extra_packages/extra_packages.repos b/ci/extra_packages/extra_packages.repos index 1deca123..724270ef 100755 --- a/ci/extra_packages/extra_packages.repos +++ b/ci/extra_packages/extra_packages.repos @@ -2,4 +2,4 @@ repositories: control_msgs: type: git url: https://github.com/ros-controls/control_msgs - version: galactic-devel \ No newline at end of file + version: humble \ No newline at end of file diff --git a/ci/platformio.ini b/ci/platformio.ini index c7becb18..94c10af0 100644 --- a/ci/platformio.ini +++ b/ci/platformio.ini @@ -1,13 +1,3 @@ -; Galactic test -[env:portenta_h7_m7_galactic] -platform = ststm32 -board = portenta_h7_m7 -framework = arduino -board_microros_transport = serial -board_microros_distro = galactic -lib_deps = - ../ - ; Foxy test [env:portenta_h7_m7_foxy] platform = ststm32 diff --git a/extra_script.py b/extra_script.py index 33700b9f..990922a1 100644 --- a/extra_script.py +++ b/extra_script.py @@ -94,7 +94,8 @@ def build_microros(*args, **kwargs): "{} {} -fno-rtti -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='".format(' '.join(env['CXXFLAGS']), ' '.join(env['CCFLAGS'])) ) - builder = library_builder.Build(library_folder=main_path, packages_folder=extra_packages_path, distro=microros_distro) + python_env_path = env['PROJECT_CORE_DIR'] + "/penv/bin/activate" + builder = library_builder.Build(library_folder=main_path, packages_folder=extra_packages_path, distro=microros_distro, python_env=python_env_path) builder.run('{}/metas/{}'.format(main_path, selected_board_meta), cmake_toolchain.path, microros_user_meta) ####################################################### @@ -132,6 +133,9 @@ def update_env(): main_path + "/platform_code", main_path + "/platform_code/{}/{}".format(framework, microros_transport)]) + if (board == "teensy31" or board == "teensy35" or board == "teensy36"): + projenv.Append(LINKFLAGS=["--specs=nosys.specs"]) + # Add micro-ROS defines to user application projenv.Append(CPPDEFINES=[('MICRO_ROS_TRANSPORT_{}_{}'.format(framework.upper(), microros_transport.upper()), 1)]) projenv.Append(CPPDEFINES=[('MICRO_ROS_DISTRO_{} '.format(microros_distro.upper()), 1)]) diff --git a/metas/common.meta b/metas/common.meta index 8986dc87..ea572219 100644 --- a/metas/common.meta +++ b/metas/common.meta @@ -14,8 +14,7 @@ "rcl": { "cmake-args": [ "-DBUILD_TESTING=OFF", - "-DRCL_COMMAND_LINE_ENABLED=OFF", - "-DRCL_LOGGING_ENABLED=OFF" + "-DRCL_MICROROS=ON" ] }, "rcutils": { diff --git a/microros_utils/library_builder.py b/microros_utils/library_builder.py index 4556cea1..381dd373 100644 --- a/microros_utils/library_builder.py +++ b/microros_utils/library_builder.py @@ -33,7 +33,7 @@ def __init__(self, path, cc, cxx, ar, cflags, cxxflags): self.path = os.path.realpath(file.name) class Build: - def __init__(self, library_folder, packages_folder, distro): + def __init__(self, library_folder, packages_folder, distro, python_env): self.library_folder = library_folder self.packages_folder = packages_folder self.build_folder = library_folder + "/build" @@ -51,6 +51,7 @@ def __init__(self, library_folder, packages_folder, distro): self.library = self.library_path + "/libmicroros.a" self.includes = self.library_path+ '/include' self.library_name = "microros" + self.python_env = python_env self.env = {} def run(self, meta, toolchain, user_meta = ""): @@ -99,7 +100,7 @@ def download_dev_environment(self): def build_dev_environment(self): print("Building micro-ROS dev dependencies") - command = "cd {} && colcon build --cmake-args -DBUILD_TESTING=OFF".format(self.dev_folder) + command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF".format(self.dev_folder, self.python_env) result = run_cmd(command, env=self.env) if 0 != result.returncode: @@ -173,7 +174,7 @@ def build_mcu_environment(self, meta_file, toolchain_file, user_meta = ""): print("Building micro-ROS library") common_meta_path = self.library_folder + '/metas/common.meta' - colcon_command = 'colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={}'.format(common_meta_path, meta_file, user_meta, toolchain_file) + colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={}'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file) command = "cd {} && . {}/install/setup.sh && {}".format(self.mcu_folder, self.dev_folder, colcon_command) result = run_cmd(command, env=self.env) @@ -211,7 +212,7 @@ def package_mcu_library(self): shutil.copytree(self.build_folder + "/mcu/install/include", self.includes) # Fix include paths - if self.distro not in ["galactic", "foxy"]: + if self.distro not in ["foxy"]: include_folders = os.listdir(self.includes) for folder in include_folders: diff --git a/microros_utils/repositories.py b/microros_utils/repositories.py index b88e6cfc..16884900 100644 --- a/microros_utils/repositories.py +++ b/microros_utils/repositories.py @@ -75,21 +75,13 @@ class Sources: Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "humble"), Repository("ament_index", "https://github.com/ament/ament_index", "humble") ], - 'galactic': [ - Repository("ament_cmake", "https://github.com/ament/ament_cmake", "galactic"), - Repository("ament_lint", "https://github.com/ament/ament_lint", "galactic"), - Repository("ament_package", "https://github.com/ament/ament_package", "galactic"), - Repository("googletest", "https://github.com/ament/googletest", "galactic"), - Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "galactic"), - Repository("ament_index", "https://github.com/ament/ament_index", "galactic") - ], 'rolling': [ - Repository("ament_cmake", "https://github.com/ament/ament_cmake", "rolling", "master"), - Repository("ament_lint", "https://github.com/ament/ament_lint", "rolling", "master"), - Repository("ament_package", "https://github.com/ament/ament_package", "rolling", "master"), - Repository("googletest", "https://github.com/ament/googletest", "rolling", "ros2"), - Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "rolling", "master"), - Repository("ament_index", "https://github.com/ament/ament_index", "rolling", "master") + Repository("ament_cmake", "https://github.com/ament/ament_cmake", "rolling"), + Repository("ament_lint", "https://github.com/ament/ament_lint", "rolling"), + Repository("ament_package", "https://github.com/ament/ament_package", "rolling"), + Repository("googletest", "https://github.com/ament/googletest", "rolling"), + Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "rolling"), + Repository("ament_index", "https://github.com/ament/ament_index", "rolling") ], 'foxy': [ Repository("ament_cmake", "https://github.com/ament/ament_cmake", "foxy"), @@ -124,28 +116,6 @@ class Sources: Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "humble"), Repository("ros2_tracing", "https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing", "humble"), ], - 'galactic': [ - Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "galactic", "ros2"), - Repository("Micro-XRCE-DDS-Client", "https://github.com/eProsima/Micro-XRCE-DDS-Client", "galactic", "ros2"), - Repository("rcl", "https://github.com/micro-ROS/rcl", "galactic"), - Repository("rclc", "https://github.com/ros2/rclc", "galactic"), - Repository("micro_ros_utilities", "https://github.com/micro-ROS/micro_ros_utilities", "galactic"), - Repository("rcutils", "https://github.com/micro-ROS/rcutils", "galactic"), - Repository("micro_ros_msgs", "https://github.com/micro-ROS/micro_ros_msgs", "galactic"), - Repository("rmw-microxrcedds", "https://github.com/micro-ROS/rmw-microxrcedds", "galactic"), - Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "galactic"), - Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "galactic"), - Repository("rosidl", "https://github.com/ros2/rosidl", "galactic"), - Repository("rmw", "https://github.com/ros2/rmw", "galactic"), - Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "galactic"), - Repository("rosidl_defaults", "https://github.com/ros2/rosidl_defaults", "galactic"), - Repository("unique_identifier_msgs", "https://github.com/ros2/unique_identifier_msgs", "galactic"), - Repository("common_interfaces", "https://github.com/ros2/common_interfaces", "galactic"), - Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "galactic"), - Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "galactic"), - Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "galactic"), - Repository("ros2_tracing", "https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing", "galactic"), - ], 'rolling': [ Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "rolling", "ros2"), Repository("Micro-XRCE-DDS-Client", "https://github.com/eProsima/Micro-XRCE-DDS-Client", "rolling", "ros2"), @@ -162,12 +132,13 @@ class Sources: Repository("rmw", "https://github.com/ros2/rmw", "rolling"), Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "rolling"), Repository("rosidl_defaults", "https://github.com/ros2/rosidl_defaults", "rolling"), + Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "rolling"), Repository("unique_identifier_msgs", "https://github.com/ros2/unique_identifier_msgs", "rolling"), Repository("common_interfaces", "https://github.com/ros2/common_interfaces", "rolling"), Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "rolling"), Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "rolling"), Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "rolling"), - Repository("ros2_tracing", "https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing", "rolling"), + Repository("ros2_tracing", "https://github.com/ros2/ros2_tracing", "rolling"), ], 'foxy': [ Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "foxy", "ros2"), @@ -195,7 +166,6 @@ class Sources: ignore_packages = { 'humble': ['rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], - 'galactic': ['rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], - 'rolling': ['rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], + 'rolling': ['test_tracetools', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], 'foxy': [ 'rosidl_typesupport_introspection_c', 'rosidl_typesupport_introspection_cpp', 'rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'] } \ No newline at end of file From 88c4ea8e0b6448932c0847a9ef065c182b7c5439 Mon Sep 17 00:00:00 2001 From: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com> Date: Fri, 9 Jun 2023 14:18:56 +0200 Subject: [PATCH 2/8] Iron release (#102) * Iron release and deprecate foxy Signed-off-by: acuadros95 * Fix ros tracing repo Signed-off-by: acuadros95 * Add missing repo Signed-off-by: acuadros95 * Add rosidl_dynamic_typesupport fork Signed-off-by: acuadros95 * Remove duplicated branch Signed-off-by: acuadros95 --------- Signed-off-by: acuadros95 --- .github/workflows/ci.yml | 2 +- README.md | 6 +-- ci/platformio.ini | 6 +-- extra_script.py | 4 +- microros_utils/library_builder.py | 15 +++--- microros_utils/repositories.py | 86 ++++++++++++++++--------------- 6 files changed, 60 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94d3b7d1..788a7e34 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, portenta_h7_m7_foxy, portenta_h7_m7_rolling, teensy41_custom, pico] + platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, portenta_h7_m7_humble, portenta_h7_m7_rolling, teensy41_custom, pico] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 9507560c..1c458098 100755 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ A explanation for adding custom targets is also present ### ROS 2 distribution The target ROS 2 distribution can be configured with the `board_microros_distro = `, supported values are: - - `humble` *(default value)* + - `humble` + - `iron` *(default value)* - `rolling` - - `foxy` ### Transport configuration The transport can be configured with the `board_microros_transport = `, supported values and configurations are: @@ -206,7 +206,7 @@ It is also possible to use custom transports on a `micro-XRCE Agent` instance. M ## Examples A simple publisher project using serial transport is available on the [examples](./examples) directory, this examples is meant to be modified with the user board. -- More micro-ROS usage examples are available on [micro-ROS-demos/rclc](https://github.com/micro-ROS/micro-ROS-demos/tree/humble/rclc). +- More micro-ROS usage examples are available on [micro-ROS-demos/rclc](https://github.com/micro-ROS/micro-ROS-demos/tree/iron/rclc). - For a complete micro-ROS tutorial, check [Programming with rcl and rclc](https://micro.ros.org/docs/tutorials/programming_rcl_rclc/overview/) documentation. ## Purpose of the Project diff --git a/ci/platformio.ini b/ci/platformio.ini index 94c10af0..3fb85b85 100644 --- a/ci/platformio.ini +++ b/ci/platformio.ini @@ -1,10 +1,10 @@ -; Foxy test -[env:portenta_h7_m7_foxy] +; Humble test +[env:portenta_h7_m7_humble] platform = ststm32 board = portenta_h7_m7 framework = arduino board_microros_transport = serial -board_microros_distro = foxy +board_microros_distro = humble lib_deps = ../ diff --git a/extra_script.py b/extra_script.py index 990922a1..5fb4421c 100644 --- a/extra_script.py +++ b/extra_script.py @@ -34,8 +34,8 @@ selected_board_meta = boards_metas[board] if board in boards_metas else "colcon.meta" -# Retrieve the required transport. Default humble -microros_distro = global_env.BoardConfig().get("microros_distro", "humble") +# Retrieve the required transport. Default iron +microros_distro = global_env.BoardConfig().get("microros_distro", "iron") # Retrieve the required transport. Default serial microros_transport = global_env.BoardConfig().get("microros_transport", "serial") diff --git a/microros_utils/library_builder.py b/microros_utils/library_builder.py index 381dd373..3fed134f 100644 --- a/microros_utils/library_builder.py +++ b/microros_utils/library_builder.py @@ -212,13 +212,12 @@ def package_mcu_library(self): shutil.copytree(self.build_folder + "/mcu/install/include", self.includes) # Fix include paths - if self.distro not in ["foxy"]: - include_folders = os.listdir(self.includes) + include_folders = os.listdir(self.includes) - for folder in include_folders: - folder_path = self.includes + "/{}".format(folder) - repeated_path = folder_path + "/{}".format(folder) + for folder in include_folders: + folder_path = self.includes + "/{}".format(folder) + repeated_path = folder_path + "/{}".format(folder) - if os.path.exists(repeated_path): - shutil.copytree(repeated_path, folder_path, copy_function=shutil.move, dirs_exist_ok=True) - shutil.rmtree(repeated_path) + if os.path.exists(repeated_path): + shutil.copytree(repeated_path, folder_path, copy_function=shutil.move, dirs_exist_ok=True) + shutil.rmtree(repeated_path) diff --git a/microros_utils/repositories.py b/microros_utils/repositories.py index 16884900..fc247b7f 100644 --- a/microros_utils/repositories.py +++ b/microros_utils/repositories.py @@ -75,6 +75,14 @@ class Sources: Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "humble"), Repository("ament_index", "https://github.com/ament/ament_index", "humble") ], + 'iron': [ + Repository("ament_cmake", "https://github.com/ament/ament_cmake", "iron"), + Repository("ament_lint", "https://github.com/ament/ament_lint", "iron"), + Repository("ament_package", "https://github.com/ament/ament_package", "iron"), + Repository("googletest", "https://github.com/ament/googletest", "iron"), + Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "iron"), + Repository("ament_index", "https://github.com/ament/ament_index", "iron") + ], 'rolling': [ Repository("ament_cmake", "https://github.com/ament/ament_cmake", "rolling"), Repository("ament_lint", "https://github.com/ament/ament_lint", "rolling"), @@ -82,14 +90,6 @@ class Sources: Repository("googletest", "https://github.com/ament/googletest", "rolling"), Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "rolling"), Repository("ament_index", "https://github.com/ament/ament_index", "rolling") - ], - 'foxy': [ - Repository("ament_cmake", "https://github.com/ament/ament_cmake", "foxy"), - Repository("ament_lint", "https://github.com/ament/ament_lint", "foxy"), - Repository("ament_package", "https://github.com/ament/ament_package", "foxy"), - Repository("googletest", "https://github.com/ament/googletest", "foxy"), - Repository("ament_cmake_ros", "https://github.com/ros2/ament_cmake_ros", "foxy"), - Repository("ament_index", "https://github.com/ament/ament_index", "foxy") ] } @@ -114,58 +114,60 @@ class Sources: Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "humble"), Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "humble"), Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "humble"), - Repository("ros2_tracing", "https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing", "humble"), + Repository("ros2_tracing", "https://github.com/ros2/ros2_tracing", "humble"), + ], + 'iron': [ + Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "iron", "ros2"), + Repository("Micro-XRCE-DDS-Client", "https://github.com/eProsima/Micro-XRCE-DDS-Client", "iron", "ros2"), + Repository("rcl", "https://github.com/micro-ROS/rcl", "iron"), + Repository("rclc", "https://github.com/ros2/rclc", "iron"), + Repository("micro_ros_utilities", "https://github.com/micro-ROS/micro_ros_utilities", "iron"), + Repository("rcutils", "https://github.com/micro-ROS/rcutils", "iron"), + Repository("micro_ros_msgs", "https://github.com/micro-ROS/micro_ros_msgs", "iron"), + Repository("rmw-microxrcedds", "https://github.com/micro-ROS/rmw-microxrcedds", "iron"), + Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "iron"), + Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "iron"), + Repository("rosidl", "https://github.com/ros2/rosidl", "iron"), + Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "iron"), + Repository("rosidl_core", "https://github.com/ros2/rosidl_core", "iron"), + Repository("rmw", "https://github.com/ros2/rmw", "iron"), + Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "iron"), + Repository("rosidl_defaults", "https://github.com/ros2/rosidl_defaults", "iron"), + Repository("unique_identifier_msgs", "https://github.com/ros2/unique_identifier_msgs", "iron"), + Repository("common_interfaces", "https://github.com/ros2/common_interfaces", "iron"), + Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "iron"), + Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "iron"), + Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "iron"), + Repository("ros2_tracing", "https://github.com/ros2/ros2_tracing", "iron"), ], 'rolling': [ Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "rolling", "ros2"), Repository("Micro-XRCE-DDS-Client", "https://github.com/eProsima/Micro-XRCE-DDS-Client", "rolling", "ros2"), - Repository("rcl", "https://github.com/micro-ROS/rcl", "rolling", "master"), - Repository("rclc", "https://github.com/ros2/rclc", "rolling", "master"), - Repository("micro_ros_utilities", "https://github.com/micro-ROS/micro_ros_utilities", "rolling", "main"), - Repository("rcutils", "https://github.com/micro-ROS/rcutils", "rolling", "master"), - Repository("micro_ros_msgs", "https://github.com/micro-ROS/micro_ros_msgs", "rolling", "main"), - Repository("rmw-microxrcedds", "https://github.com/micro-ROS/rmw-microxrcedds", "rolling", "main"), - Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "rolling", "master"), - Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "rolling", "main"), + Repository("rcl", "https://github.com/micro-ROS/rcl", "rolling"), + Repository("rclc", "https://github.com/ros2/rclc", "rolling"), + Repository("micro_ros_utilities", "https://github.com/micro-ROS/micro_ros_utilities", "rolling"), + Repository("rcutils", "https://github.com/micro-ROS/rcutils", "rolling"), + Repository("micro_ros_msgs", "https://github.com/micro-ROS/micro_ros_msgs", "rolling"), + Repository("rmw-microxrcedds", "https://github.com/micro-ROS/rmw-microxrcedds", "rolling"), + Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "rolling"), + Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "rolling"), Repository("rosidl", "https://github.com/ros2/rosidl", "rolling"), + Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "rolling"), Repository("rosidl_core", "https://github.com/ros2/rosidl_core", "rolling"), Repository("rmw", "https://github.com/ros2/rmw", "rolling"), Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "rolling"), Repository("rosidl_defaults", "https://github.com/ros2/rosidl_defaults", "rolling"), - Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "rolling"), Repository("unique_identifier_msgs", "https://github.com/ros2/unique_identifier_msgs", "rolling"), Repository("common_interfaces", "https://github.com/ros2/common_interfaces", "rolling"), Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "rolling"), Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "rolling"), Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "rolling"), Repository("ros2_tracing", "https://github.com/ros2/ros2_tracing", "rolling"), - ], - 'foxy': [ - Repository("micro-CDR", "https://github.com/eProsima/micro-CDR", "foxy", "ros2"), - Repository("Micro-XRCE-DDS-Client", "https://github.com/eProsima/Micro-XRCE-DDS-Client", "foxy", "ros2"), - Repository("rcl", "https://github.com/micro-ROS/rcl", "foxy"), - Repository("rclc", "https://github.com/ros2/rclc", "foxy"), - Repository("rcutils", "https://github.com/micro-ROS/rcutils", "foxy"), - Repository("micro_ros_msgs", "https://github.com/micro-ROS/micro_ros_msgs", "foxy"), - Repository("rmw-microxrcedds", "https://github.com/micro-ROS/rmw-microxrcedds", "foxy"), - Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "foxy"), - Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "foxy"), - Repository("tinydir_vendor", "https://github.com/ros2/tinydir_vendor", "foxy", "master"), - Repository("rosidl", "https://github.com/ros2/rosidl", "foxy"), - Repository("rmw", "https://github.com/ros2/rmw", "foxy"), - Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "foxy"), - Repository("rosidl_defaults", "https://github.com/ros2/rosidl_defaults", "foxy"), - Repository("unique_identifier_msgs", "https://github.com/ros2/unique_identifier_msgs", "foxy"), - Repository("common_interfaces", "https://github.com/ros2/common_interfaces", "foxy"), - Repository("test_interface_files", "https://github.com/ros2/test_interface_files", "foxy"), - Repository("rmw_implementation", "https://github.com/ros2/rmw_implementation", "foxy"), - Repository("rcl_logging", "https://github.com/ros2/rcl_logging", "foxy"), - Repository("ros2_tracing", "https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing", "foxy", "foxy_microros"), ] } ignore_packages = { 'humble': ['rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], - 'rolling': ['test_tracetools', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], - 'foxy': [ 'rosidl_typesupport_introspection_c', 'rosidl_typesupport_introspection_cpp', 'rcl_logging_log4cxx', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'] + 'iron': ['test_tracetools', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'], + 'rolling': ['test_tracetools', 'rcl_logging_spdlog', 'rcl_yaml_param_parser', 'rclc_examples'] } \ No newline at end of file From 9414ef914d081d8570e03c3eefaa70245aa25f08 Mon Sep 17 00:00:00 2001 From: acuadros95 Date: Mon, 12 Jun 2023 09:37:46 +0200 Subject: [PATCH 3/8] Changelog Signed-off-by: acuadros95 --- CHANGELOG.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fc14b561..53d021af 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package micro_ros_platformio ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Iron release (`#102 `_) +* Update rolling sources (`#99 `_) +* Set rmw default implementation (`#62 `_) +* Add rosidl_core (`#54 `_) +* Fix Arduino with POSIX (`#48 `_) +* Fix generation of idedata (`#44 `_) +* micro_ros_platformio works on Raspberry Pi Pico (`#39 `_) +* Fix native ethernet (`#37 `_) +* Fix user meta path (`#34 `_) +* Fix project environment modifications (`#36 `_) +* Fix wifi transport setup (`#29 `_) + 1.0.0 (2022-05-25) ------------------ * Add humble as default ROS2 distro (`#27 `_) From 35db5a9e1a2df6d88b6235db7051a05bd83bb1d1 Mon Sep 17 00:00:00 2001 From: acuadros95 Date: Mon, 12 Jun 2023 09:37:54 +0200 Subject: [PATCH 4/8] 2.0.0 --- CHANGELOG.rst | 4 ++-- package.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 53d021af..32a74cbc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package micro_ros_platformio ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.0.0 (2023-06-12) +------------------ * Iron release (`#102 `_) * Update rolling sources (`#99 `_) * Set rmw default implementation (`#62 `_) diff --git a/package.xml b/package.xml index 7ddf3b84..89ad7a7d 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ micro_ros_platformio - 1.0.0 + 2.0.0 micro-ROS tools for Platform.IO Pablo Garrido Apache License 2.0 From 79f8dc24edbe6fa1c9287c25b664b3410f97588b Mon Sep 17 00:00:00 2001 From: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com> Date: Tue, 25 Jul 2023 08:56:44 +0200 Subject: [PATCH 5/8] Remove micro-ROS fork (#110) * Remove micro-ROS fork Signed-off-by: acuadros95 * Add venv install Signed-off-by: acuadros95 --------- Signed-off-by: acuadros95 --- .github/actions/platformio-env/action.yml | 2 +- microros_utils/repositories.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/platformio-env/action.yml b/.github/actions/platformio-env/action.yml index b49efc02..f273d7e9 100644 --- a/.github/actions/platformio-env/action.yml +++ b/.github/actions/platformio-env/action.yml @@ -8,7 +8,7 @@ runs: run: | apt update export DEBIAN_FRONTEND=noninteractive - apt install -y git curl python3 python3-pip git cmake + apt install -y git curl python3 python3-pip python3-venv git cmake python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" echo 'export PATH=$PATH:~/.platformio/penv/bin' >> ~/.bashrc diff --git a/microros_utils/repositories.py b/microros_utils/repositories.py index fc247b7f..1d545d10 100644 --- a/microros_utils/repositories.py +++ b/microros_utils/repositories.py @@ -128,7 +128,7 @@ class Sources: Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "iron"), Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "iron"), Repository("rosidl", "https://github.com/ros2/rosidl", "iron"), - Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "iron"), + Repository("rosidl_dynamic_typesupport", "https://github.com/ros2/rosidl_dynamic_typesupport", "iron"), Repository("rosidl_core", "https://github.com/ros2/rosidl_core", "iron"), Repository("rmw", "https://github.com/ros2/rmw", "iron"), Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "iron"), @@ -152,7 +152,7 @@ class Sources: Repository("rosidl_typesupport", "https://github.com/micro-ROS/rosidl_typesupport", "rolling"), Repository("rosidl_typesupport_microxrcedds", "https://github.com/micro-ROS/rosidl_typesupport_microxrcedds", "rolling"), Repository("rosidl", "https://github.com/ros2/rosidl", "rolling"), - Repository("rosidl_dynamic_typesupport", "https://github.com/micro-ROS/rosidl_dynamic_typesupport", "rolling"), + Repository("rosidl_dynamic_typesupport", "https://github.com/ros2/rosidl_dynamic_typesupport", "rolling"), Repository("rosidl_core", "https://github.com/ros2/rosidl_core", "rolling"), Repository("rmw", "https://github.com/ros2/rmw", "rolling"), Repository("rcl_interfaces", "https://github.com/ros2/rcl_interfaces", "rolling"), From fdeb1ea74500c8276a34342ec9fa1d47d6b99947 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Mon, 4 Sep 2023 11:47:44 +0200 Subject: [PATCH 6/8] Update Ubuntu in CI (#118) * Update CI * Update PlatformIO installer --- .github/actions/platformio-env/action.yml | 3 ++- .github/workflows/ci.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/platformio-env/action.yml b/.github/actions/platformio-env/action.yml index f273d7e9..9e42843d 100644 --- a/.github/actions/platformio-env/action.yml +++ b/.github/actions/platformio-env/action.yml @@ -9,6 +9,7 @@ runs: apt update export DEBIAN_FRONTEND=noninteractive apt install -y git curl python3 python3-pip python3-venv git cmake - python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" + curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py + python3 get-platformio.py echo 'export PATH=$PATH:~/.platformio/penv/bin' >> ~/.bashrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 788a7e34..d9cbcc34 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,8 @@ on: jobs: micro_ros_platformio: - runs-on: ubuntu-20.04 - container: ubuntu:20.04 + runs-on: ubuntu-22.04 + container: ubuntu:22.04 strategy: fail-fast: false From 841dc1396eb1d54d61b66781768359ed00d5de6c Mon Sep 17 00:00:00 2001 From: Kuba Kaflik Date: Mon, 4 Sep 2023 15:14:40 +0200 Subject: [PATCH 7/8] Use GNU binutils on MacOS (#116) * GNU ar for MacOS * Fix ranlib for library packaging * add README * Update library_builder.py --- README.md | 11 +++++++++++ microros_utils/library_builder.py | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1c458098..fd2842e8 100755 --- a/README.md +++ b/README.md @@ -52,6 +52,17 @@ The community is encouraged to open pull request with custom use cases. ```bash apt install -y git cmake python3-pip ``` + +### Platform specific requirements + +#### MacOS + +XCode command line tools are distributed with toolchain that is not fully compatible with micro-ROS build process. +To fix this, install GNU [binutils](https://www.gnu.org/software/binutils/) using [Homebrew](https://brew.sh/): + +```bash +brew install binutils +``` ## How to add to your project diff --git a/microros_utils/library_builder.py b/microros_utils/library_builder.py index 3fed134f..766d8d35 100644 --- a/microros_utils/library_builder.py +++ b/microros_utils/library_builder.py @@ -55,7 +55,7 @@ def __init__(self, library_folder, packages_folder, distro, python_env): self.env = {} def run(self, meta, toolchain, user_meta = ""): - if os.path.exists(self.library_path): + if os.path.exists(self.library): print("micro-ROS already built") return @@ -183,6 +183,7 @@ def build_mcu_environment(self, meta_file, toolchain_file, user_meta = ""): sys.exit(1) def package_mcu_library(self): + binutils_path = self.resolve_binutils_path() aux_folder = self.build_folder + "/aux" shutil.rmtree(aux_folder, ignore_errors=True) @@ -194,12 +195,12 @@ def package_mcu_library(self): if f.endswith('.a'): os.makedirs(aux_folder + "/naming", exist_ok=True) os.chdir(aux_folder + "/naming") - os.system("ar x {}".format(root + "/" + f)) + os.system("{}ar x {}".format(binutils_path, root + "/" + f)) for obj in [x for x in os.listdir() if x.endswith('obj')]: os.rename(obj, '../' + f.split('.')[0] + "__" + obj) os.chdir(aux_folder) - command = "ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); rm *.o *.obj 2> /dev/null; ranlib libmicroros.a" + command = "{binutils}ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); rm *.o *.obj 2> /dev/null; {binutils}ranlib libmicroros.a".format(binutils=binutils_path) result = run_cmd(command) if 0 != result.returncode: @@ -221,3 +222,15 @@ def package_mcu_library(self): if os.path.exists(repeated_path): shutil.copytree(repeated_path, folder_path, copy_function=shutil.move, dirs_exist_ok=True) shutil.rmtree(repeated_path) + + def resolve_binutils_path(self): + if sys.platform == "darwin": + homebrew_binutils_path = "/opt/homebrew/opt/binutils/bin/" + if os.path.exists(homebrew_binutils_path): + return homebrew_binutils_path + + print("ERROR: GNU binutils not found. ({}) Please install binutils with homebrew: brew install binutils" + .format(homebrew_binutils_path)) + sys.exit(1) + + return "" From e87705fab34ff23f2d117d0185f19fc8698ff081 Mon Sep 17 00:00:00 2001 From: MARUYAMA Norihiro Date: Tue, 24 Oct 2023 15:49:48 +0900 Subject: [PATCH 8/8] Use python bundled in platformIO inside colcon build command by cmake option. (#108) --- microros_utils/library_builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microros_utils/library_builder.py b/microros_utils/library_builder.py index 766d8d35..10774005 100644 --- a/microros_utils/library_builder.py +++ b/microros_utils/library_builder.py @@ -100,7 +100,7 @@ def download_dev_environment(self): def build_dev_environment(self): print("Building micro-ROS dev dependencies") - command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF".format(self.dev_folder, self.python_env) + command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF -DPython3_EXECUTABLE=`which python`".format(self.dev_folder, self.python_env) result = run_cmd(command, env=self.env) if 0 != result.returncode: @@ -174,7 +174,7 @@ def build_mcu_environment(self, meta_file, toolchain_file, user_meta = ""): print("Building micro-ROS library") common_meta_path = self.library_folder + '/metas/common.meta' - colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={}'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file) + colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={} -DPython3_EXECUTABLE=`which python`'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file) command = "cd {} && . {}/install/setup.sh && {}".format(self.mcu_folder, self.dev_folder, colcon_command) result = run_cmd(command, env=self.env)