From 66f75acda5bac2cbcaafa64da20006b8669bd923 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Wed, 24 Sep 2025 16:55:00 +0200 Subject: [PATCH 1/2] Describle the idea of ros2_control profiles --- design_drafts/ros2_control_profiles.md | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 design_drafts/ros2_control_profiles.md diff --git a/design_drafts/ros2_control_profiles.md b/design_drafts/ros2_control_profiles.md new file mode 100644 index 0000000..7c9d6dd --- /dev/null +++ b/design_drafts/ros2_control_profiles.md @@ -0,0 +1,59 @@ +# ros2_control profiles + +When a system has multiple controllers or a chain of controllers then switching between different control modes is quite a hassle as all the respective controllers needs to be activated and deactivated. In order to handle those cases, I propose something called profiles in the ros2_control framework which is a separate package or a separate python node that handles these transmission. Every package is free to define their own profiles and we will be getting that information at runtime using the [ament_resource_index](https://github.com/ament/ament_cmake/blob/master/ament_cmake_core/doc/resource_index.md#implementation). This allows flexibility and modularity for the design + +We would need a new service and topic message types, for instance as below: + +``` +controller_manager_msgs/Profile + +string name +string[] controllers_list +string metadata +``` + +``` +#controller_manager_msgs/Profiles + +controller_manager_msgs/Profile[] profiles +``` + +The above `controller_manager_msgs/Profiles` can be used to get the list the profiles and also to publish the information of active profiles from the profile manager and to know the information of the available profiles, which will be depending on the configured controllers. + +``` +# controller_manager_msgs/SwitchProfiles + +string[] activate_profiles +string[] deactivate_profiles +----- +string message +bool success +``` + +We will need a profile manager that exposes the service `~/switch_profiles`. The profile manager is responsible to read the assets and then expose the service, so that the user can switch profiles as he intended + +An example controller profile yaml will look like: + +Example 1: +```yaml +cartesian_impedance_control: + controllers_list : ["cartesian_impedance_controller", "arm_left_1_joint_torque_controller", "arm_left_2_joint_torque_controller", "arm_left_3_joint_torque_controller", "arm_left_4_joint_torque_controller", "arm_left_5_joint_torque_controller", "arm_left_6_joint_torque_controller", "arm_left_7_joint_torque_controller"] + metadata: + input_type: topic + input_topic_name: "/cartesian_impedance_controller/reference" + description: "A profile to set the robot in cartesian impedance control mode" +``` + +Example 2: + +```yaml +joints_torque_controllers: + controllers_list : ["arm_left_1_joint_torque_controller", "arm_left_2_joint_torque_controller", "arm_left_3_joint_torque_controller", "arm_left_4_joint_torque_controller", "arm_left_5_joint_torque_controller", "arm_left_6_joint_torque_controller", "arm_left_7_joint_torque_controller"] + metadata: + description: "A profile to start the torque controller for all the joints" + +linear_mpc_controller: + controllers_list: ["linear_mpc_controller"] + metadata: + description: "A profile to start the MPC controller" +``` \ No newline at end of file From d18c8b97da965eedf0a03a8c00f048ae5a2b026f Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Wed, 24 Sep 2025 20:11:59 +0200 Subject: [PATCH 2/2] Update design_drafts/ros2_control_profiles.md Co-authored-by: Bence Magyar --- design_drafts/ros2_control_profiles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design_drafts/ros2_control_profiles.md b/design_drafts/ros2_control_profiles.md index 7c9d6dd..63f4139 100644 --- a/design_drafts/ros2_control_profiles.md +++ b/design_drafts/ros2_control_profiles.md @@ -1,6 +1,6 @@ # ros2_control profiles -When a system has multiple controllers or a chain of controllers then switching between different control modes is quite a hassle as all the respective controllers needs to be activated and deactivated. In order to handle those cases, I propose something called profiles in the ros2_control framework which is a separate package or a separate python node that handles these transmission. Every package is free to define their own profiles and we will be getting that information at runtime using the [ament_resource_index](https://github.com/ament/ament_cmake/blob/master/ament_cmake_core/doc/resource_index.md#implementation). This allows flexibility and modularity for the design +When a system has multiple controllers or a chain of controllers then switching between different control modes is quite a hassle as all the respective controllers needs to be activated and deactivated. In order to handle those cases, I propose something called profiles in the ros2_control framework which is a separate package or a separate python node that handles these transitions. Every package is free to define their own profiles and we will be getting that information at runtime using the [ament_resource_index](https://github.com/ament/ament_cmake/blob/master/ament_cmake_core/doc/resource_index.md#implementation). This allows flexibility and modularity for the design We would need a new service and topic message types, for instance as below: