Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bmagyar opened this issue May 28, 2020 · 1 comment

Comments

@bmagyar
Copy link
Member

bmagyar commented May 28, 2020

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?

@destogl
Copy link
Member

destogl commented Jun 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants