Skip to content

Conversation

@destogl
Copy link
Member

@destogl destogl commented Feb 9, 2022

Resolves ros-controls/ros2_control#600

QUESTION: Should we actually make all the commands to be one-shot per default?

@destogl destogl self-assigned this Feb 9, 2022
@destogl destogl requested a review from bmagyar February 9, 2022 19:11
Copy link
Contributor

@ejalaa12 ejalaa12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from that I think that's would be a useful addition.

1. extension of `hardware_interface/component_parser.cpp` to understand `one_shot` and `async` arguments on (command) interfaces
1. extension of `hardware_interface/handle.hpp` to add this attribute into command interface handle (read/write handle)
1. extension of `hardware_interface/handle.hpp` with getters on the interface to automatically reset value to "NaN" when interface is read
1. propose extension of hardware interfaces to use "handle" and do not access directly to the values as it is currently done.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that hardware interface would use Handle instead of double pointer?
Do you also propose to make the State/Command Interface use the handle as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they are now “Handles” that support only double types. There are few options how to support other types, which we will do in general in the future.

# Purpose and Use
The proposed functionality has two purposes:
- adding additional information in the hardware if and when a command has changed; and
- signaling to a controller that hardware interface has read and used a variable (async commands).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would that be done ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By resetting the values. The explained concepts enables that.

Copy link
Contributor

@ejalaa12 ejalaa12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this document lgtm.
I like the idea of async, so that interfaces that take a while to apply a command don't block the main control loop.

<param name="initial_position">2.78</param>
</joint>
<gpio name="flange_analog_IOs">
<command_interface name="analog_output1" data_type="double" sync="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't you mean "async" here?

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

Successfully merging this pull request may close these issues.

“One-shot”/”Trigger” interfaces (and controllers)

2 participants