roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Design usage of DynamicJointState as a means to host joint per-interface values

Open bmagyar opened this issue 5 years ago • 1 comments

Idea: Still use handles to avoid searching the dictionary structure. Pass collection of requested handles (with pointers to the right doubles in the structure) to controllers. Avoid interface-based type on handles but serve them as separate collections?

bmagyar avatar May 28 '20 09:05 bmagyar

Hi Bence,

I agree with you and I tried to do this in the example concept ros-controls/ros2_control#80

The main issue for me was how properly assign handles between virtual components, i.e. Actuators and Sensors, and the component which implements a protocol for specific hardware. The problem is the following:

  • imagine a robot with one joint, with actuator with "position" interface and a sensor with "velocity" and "acceleration" interface**
  • According to your description in the design file the data would look as follows:
DynamicJointState:
    joint_names: ["joint1"]
    interface_values: [
        interface_names: ["position", "velocity", "acceleration"]
        values: [...]
        ]
  • now we have to somehow assign these values to subclasses for which would be nice to have interface_names and values access
  • if we give access to the whole interface_value, aside from data-access issue, the problem is to find the right filed where the data should be stored
  • After some thoughts, I came to the conclusion that it would be very nice to split interface_values for each robot interface, i.e. Sensors and Actuators. This would changed the DynamicJointState message so that interface_values is a matrix, i.e. double array. So the above example would look like: DynamicJointState: joint_names: ["joint1"] interface_values: [ interface_value: [ interface_names: ["position"] values: [...] ], interface_value: [ interface_names: ["velocity", "acceleration"] values: [...] ] ] ]
- in this way, one would work on "InterfaceValue" level, which is IMHO better since each component knows also the semantic of a value. Then one could do some sanity checks to be sure that one is working on proper data as opposed to double pointers

What do you think about that?

** real world example would be a robot where we can control position and read position, velocity and acceleration data

destogl avatar Jun 02 '20 20:06 destogl