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

Propose additional primitive types for interface-handles. #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions design_drafts/types_of_command_and_state_interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Extension of types used for command and state interfaces

For introduction the file about general [purpose inputs/outputs in ros2_control](non_joint_command_interfaces.md).
Copy link
Member

Choose a reason for hiding this comment

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

? need more detail

Copy link
Member

Choose a reason for hiding this comment

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

Link does not work for me?


## Motivation
Many GPIO values used in modern robots are logical and not numeric values.
For example vacuum valve at the robot has "on" (true) and "off" (false) states.
bmagyar marked this conversation as resolved.
Show resolved Hide resolved

## Problem
The ros2_control supports only `double` variable type to exchnage data between hardware and controllers.
bmagyar marked this conversation as resolved.
Show resolved Hide resolved
This is confusing for users and it would be clearer if also boolean and integer values can be transported.

## Possible solution
Extend [`ReadOnlyHandle`](https://github.com/ros-controls/ros2_control/blob/93b15787f1d2e16dd41d202cebff5fdbef56e19d/hardware_interface/include/hardware_interface/handle.hpp#L31) to aceept other privitive types like `bool`, `int`, and `uint`.
bmagyar marked this conversation as resolved.
Show resolved Hide resolved
This could be simply done by templating the class, or to keep it restricted implementing constructors, getters and setters for those types.
The latter could become complex to keep track about specific types.
Copy link
Member

Choose a reason for hiding this comment

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

Since we are at it, I'd look for a solution that works for any type instead of adding support for a few hard coded ones.

Copy link
Member Author

Choose a reason for hiding this comment

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

The link is to the file in PR #38