From 289f83f89b244e7a99a5b9c0096997107d37e0ec Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Mon, 6 Jan 2025 07:31:49 +0000 Subject: [PATCH 1/5] feat!(controllers): remove robot description parameter --- source/modulo_controllers/README.md | 4 +- ...dulo_controllers_controller_interface.json | 9 ----- .../src/ControllerInterface.cpp | 3 -- .../src/RobotControllerInterface.cpp | 38 +++++++++---------- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/source/modulo_controllers/README.md b/source/modulo_controllers/README.md index c1a863b2b..b19925edb 100644 --- a/source/modulo_controllers/README.md +++ b/source/modulo_controllers/README.md @@ -10,7 +10,6 @@ parameters, predicates, and services. It supports the following parameters: - `hardware_name` [string]: the name of the hardware interface -- `robot_description` [string]: the string formatted content of the controller's URDF description - `joints` [string_array]: a vector of joint names that the controller will claim - `activation_timeout` [double]: the seconds to wait for valid data on state interfaces before activating - `input_validity_period` [double]: the maximum age of an input state before discarding it as expired @@ -43,8 +42,7 @@ joint command or access the joint state using the `set_joint_command()` and `get ### Robot model and URDF -If a controller needs a robot model, a `robot_model::Model` will be configured from URDF information. To support this, -the `robot_description` must be specified. +If a controller needs a robot model, a `robot_model::Model` will be configured from URDF information. The robot model is used to calculate the CartesianState of a task frame from the JointState using forward kinematics, which is available to derived classes using the `get_cartesian_state()` method. diff --git a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json index 8a58baa9c..4882bd964 100644 --- a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json +++ b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json @@ -26,15 +26,6 @@ "optional": true, "internal": true }, - { - "display_name": "Robot description", - "description": "The string formatted content of the controller's URDF description", - "parameter_name": "robot_description", - "parameter_type": "string", - "default_value": null, - "optional": true, - "internal": true - }, { "display_name": "Activation timeout", "description": "The seconds to wait for valid data on the state interfaces before activating (in seconds)", diff --git a/source/modulo_controllers/src/ControllerInterface.cpp b/source/modulo_controllers/src/ControllerInterface.cpp index 41ea23c9a..7d6c9dec3 100644 --- a/source/modulo_controllers/src/ControllerInterface.cpp +++ b/source/modulo_controllers/src/ControllerInterface.cpp @@ -18,9 +18,6 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn Contro try { add_parameter(std::make_shared>("hardware_name"), "The name of the hardware interface"); - add_parameter( - std::make_shared>("robot_description"), - "The string formatted content of the controller's URDF description"); add_parameter( std::make_shared>>("joints"), "A vector of joint names that the controller will claim"); diff --git a/source/modulo_controllers/src/RobotControllerInterface.cpp b/source/modulo_controllers/src/RobotControllerInterface.cpp index e3b23dcde..225aa403c 100644 --- a/source/modulo_controllers/src/RobotControllerInterface.cpp +++ b/source/modulo_controllers/src/RobotControllerInterface.cpp @@ -57,27 +57,25 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn RobotC } rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn RobotControllerInterface::on_configure() { - if (*get_parameter("robot_description")) { - std::stringstream timestamp; - timestamp << std::time(nullptr); - auto urdf_path = "/tmp/" + hardware_name_ + "_" + timestamp.str(); - try { - robot_model::Model::create_urdf_from_string(get_parameter_value("robot_description"), urdf_path); - if (load_geometries_) { - robot_ = std::make_shared(hardware_name_, urdf_path, [](const std::string& package_name) { - return ament_index_cpp::get_package_share_directory(package_name) + "/"; - }); - RCLCPP_DEBUG(get_node()->get_logger(), "Generated robot model with collision features"); - } else { - robot_ = std::make_shared(hardware_name_, urdf_path); - RCLCPP_DEBUG(get_node()->get_logger(), "Generated robot model"); - } - } catch (const std::exception& ex) { - RCLCPP_WARN( - get_node()->get_logger(), - "Could not generate robot model with temporary urdf from string content at path %s: %s", urdf_path.c_str(), - ex.what()); + std::stringstream timestamp; + timestamp << std::time(nullptr); + auto urdf_path = "/tmp/" + hardware_name_ + "_" + timestamp.str(); + try { + robot_model::Model::create_urdf_from_string(get_robot_description(), urdf_path); + if (load_geometries_) { + robot_ = std::make_shared(hardware_name_, urdf_path, [](const std::string& package_name) { + return ament_index_cpp::get_package_share_directory(package_name) + "/"; + }); + RCLCPP_DEBUG(get_node()->get_logger(), "Generated robot model with collision features"); + } else { + robot_ = std::make_shared(hardware_name_, urdf_path); + RCLCPP_DEBUG(get_node()->get_logger(), "Generated robot model"); } + } catch (const std::exception& ex) { + RCLCPP_WARN( + get_node()->get_logger(), + "Could not generate robot model with temporary urdf from string content at path %s: %s", urdf_path.c_str(), + ex.what()); } if (robot_model_required_ && robot_ == nullptr) { RCLCPP_ERROR(get_node()->get_logger(), "Robot model is not available even though it's required by the controller."); From e55cebf9128fac20581f1fb5c5f9e4c2b7896383 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 7 Jan 2025 10:30:40 +0100 Subject: [PATCH 2/5] docs: changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 313a012b3..ea98abbfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Release Versions: +- [5.1.0](#510) - [5.0.2](#502) - [5.0.1](#501) - [5.0.0](#500) @@ -18,6 +19,10 @@ Release Versions: - [2.1.1](#211) - [2.1.0](#210) +## Upcoming changes + +feat!(controllers): remove robot description parameter (#186) + ## 5.1.0 ### December 16th, 2024 From 684e9f19ab1eeb321a1917e265ba435da0f13b62 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 14 Jan 2025 09:55:05 +0100 Subject: [PATCH 3/5] fix: update tag --- aica-package.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aica-package.toml b/aica-package.toml index e350c7402..92f28c045 100644 --- a/aica-package.toml +++ b/aica-package.toml @@ -1,7 +1,7 @@ -#syntax=ghcr.io/aica-technology/package-builder:v1.3.0 +#syntax=ghcr.io/aica-technology/package-builder:v1.3.2 [metadata] -version = "5.1.0" +version = "6.0.0" description = "Modular ROS 2 extension library for dynamic composition of components and controllers with the AICA robotics framework" [metadata.collection] @@ -9,7 +9,7 @@ name = "modulo" [build] type = "ros" -image = "v2.0.0-jazzy" +image = "v2.1.0-rc1-jazzy" [build.dependencies] "@aica/foss/control-libraries" = "v9.0.0" From 6b9742a1cf58e6e4eda83c384bbe987fb898c61f Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:03:45 +0100 Subject: [PATCH 4/5] fix: changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea98abbfb..9ff6e81d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Release Versions: ## Upcoming changes -feat!(controllers): remove robot description parameter (#186) +feat(controllers)!: remove robot description parameter (#186) ## 5.1.0 From f60a5a1ca6f002f914e2f3063fde6bee9db71b37 Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:04:23 +0100 Subject: [PATCH 5/5] revert: version change --- aica-package.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aica-package.toml b/aica-package.toml index 92f28c045..b18d1dcc7 100644 --- a/aica-package.toml +++ b/aica-package.toml @@ -1,7 +1,7 @@ #syntax=ghcr.io/aica-technology/package-builder:v1.3.2 [metadata] -version = "6.0.0" +version = "5.1.0" description = "Modular ROS 2 extension library for dynamic composition of components and controllers with the AICA robotics framework" [metadata.collection]