Skip to content

Commit 66f75ac

Browse files
committed
Describle the idea of ros2_control profiles
1 parent 453431d commit 66f75ac

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ros2_control profiles
2+
3+
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
4+
5+
We would need a new service and topic message types, for instance as below:
6+
7+
```
8+
controller_manager_msgs/Profile
9+
10+
string name
11+
string[] controllers_list
12+
string metadata
13+
```
14+
15+
```
16+
#controller_manager_msgs/Profiles
17+
18+
controller_manager_msgs/Profile[] profiles
19+
```
20+
21+
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.
22+
23+
```
24+
# controller_manager_msgs/SwitchProfiles
25+
26+
string[] activate_profiles
27+
string[] deactivate_profiles
28+
-----
29+
string message
30+
bool success
31+
```
32+
33+
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
34+
35+
An example controller profile yaml will look like:
36+
37+
Example 1:
38+
```yaml
39+
cartesian_impedance_control:
40+
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"]
41+
metadata:
42+
input_type: topic
43+
input_topic_name: "/cartesian_impedance_controller/reference"
44+
description: "A profile to set the robot in cartesian impedance control mode"
45+
```
46+
47+
Example 2:
48+
49+
```yaml
50+
joints_torque_controllers:
51+
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"]
52+
metadata:
53+
description: "A profile to start the torque controller for all the joints"
54+
55+
linear_mpc_controller:
56+
controllers_list: ["linear_mpc_controller"]
57+
metadata:
58+
description: "A profile to start the MPC controller"
59+
```

0 commit comments

Comments
 (0)