Skip to content

Commit 098248c

Browse files
authored
add controller interfaces remapping proposal (#61)
1 parent 37d9c7d commit 098248c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

design_drafts/interfaces_remapping.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Controller Interfaces Remapping
2+
3+
The idea of this approach is similar to the Topics, Parameters, Services and nodes in traditional ROS 2 approach. Remapping interfaces allows reusing the interfaces requested by the controller's ``state`` and ``command`` interface configuration and remap it to another interface instance. This helps to reduce the complexity of the controllers and the interfaces they can be used.
4+
5+
For instance, a controller that uses ``effort`` as the interface type in combination with the ``joint`` names, however, there might be cases where the joints use a combination of ``prismatic`` and ``revolute`` joint types with the corresponding ``force`` and ``torque`` interfaces from the hardware. By allowing the remapping of interfaces, this exact controller can be used and these ``force`` and ``torque`` interfaces are remapped to the ``effort`` interfaces of the controller. Thereby, reduing the complexity at the controller design to support various interfaces.
6+
7+
The proposed remapping approach is for each of the controllers to be able to define the ``remap`` parameter namespace and define the ``state`` and ``command`` interfaces. The following would be an example of the controller that remaps its interfaces
8+
9+
```yaml
10+
arm_controller:
11+
ros__parameters:
12+
type: joint_trajectory_controller/JointTrajectoryController
13+
joints:
14+
- arm_1_joint
15+
- arm_2_joint
16+
- arm_3_joint
17+
- arm_4_joint
18+
- arm_5_joint
19+
- arm_6_joint
20+
- arm_7_joint
21+
command_interfaces:
22+
- effort
23+
state_interfaces:
24+
- position
25+
- velocity
26+
remap:
27+
state_interfaces:
28+
arm_2_joint/position: "arm_2_joint/absolute_encoder/position"
29+
command_interfaces:
30+
arm_1_joint/effort: "arm_1_joint/torque"
31+
arm_2_joint/effort: "arm_2_joint/torque"
32+
arm_3_joint/effort: "arm_3_joint/force"
33+
arm_4_joint/effort: "arm_4_joint/torque"
34+
arm_5_joint/effort: "arm_5_joint/force"
35+
arm_6_joint/effort: "arm_6_joint/force"
36+
arm_7_joint/effort: "arm_7_joint/torque"
37+
38+
```
39+
40+
The idea is to just change the multiple ``state_interface_configuration`` and ``command_interface_configuration`` method called inside the Controller Manager with a new method that just shows the remapped part, this way it is very transparent to the user as no modifications are really needed by the controller itself. It is also better to print the remappings at the configure stage, so that the user is aware of any possible issues if it may cause. I believe the usecases from this approach is beyond the above explained usecase, and simple design of the controllers does go in favor with this approach.

0 commit comments

Comments
 (0)