From 554ed2615df17c74be9ea72180e379416bcffd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=A0togl?= Date: Tue, 23 Feb 2021 22:43:28 +0100 Subject: [PATCH 1/3] Propose additional privitive types for interface-handles. --- .../types_of_command_and_state_interfaces.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 design_drafts/types_of_command_and_state_interfaces.md diff --git a/design_drafts/types_of_command_and_state_interfaces.md b/design_drafts/types_of_command_and_state_interfaces.md new file mode 100644 index 0000000..b9448bd --- /dev/null +++ b/design_drafts/types_of_command_and_state_interfaces.md @@ -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). + +## 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. + +## Problem +The ros2_control supports only `double` variable type to exchnage data between hardware and controllers. +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`. +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. From 4f224f43e59b196c4f9bcb2606fc554f8d148ebb Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Tue, 23 Mar 2021 09:31:17 +0000 Subject: [PATCH 2/3] Apply suggestions from code review --- design_drafts/types_of_command_and_state_interfaces.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design_drafts/types_of_command_and_state_interfaces.md b/design_drafts/types_of_command_and_state_interfaces.md index b9448bd..7bfe84a 100644 --- a/design_drafts/types_of_command_and_state_interfaces.md +++ b/design_drafts/types_of_command_and_state_interfaces.md @@ -11,6 +11,6 @@ The ros2_control supports only `double` variable type to exchnage data between h 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`. +Extend [`ReadOnlyHandle`](https://github.com/ros-controls/ros2_control/blob/93b15787f1d2e16dd41d202cebff5fdbef56e19d/hardware_interface/include/hardware_interface/handle.hpp#L31) to accept other primitive types like `bool`, `int`, and unsigned types. 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. From 5a00fb8af3e44eaab48ae534d8a0ca279501ea78 Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Tue, 23 Mar 2021 09:33:24 +0000 Subject: [PATCH 3/3] Apply suggestions from code review --- design_drafts/types_of_command_and_state_interfaces.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design_drafts/types_of_command_and_state_interfaces.md b/design_drafts/types_of_command_and_state_interfaces.md index 7bfe84a..f13abfb 100644 --- a/design_drafts/types_of_command_and_state_interfaces.md +++ b/design_drafts/types_of_command_and_state_interfaces.md @@ -4,10 +4,10 @@ For introduction the file about general [purpose inputs/outputs in ros2_control] ## 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. +For example, a vacuum valve at the robot has "on" (true) and "off" (false) states. ## Problem -The ros2_control supports only `double` variable type to exchnage data between hardware and controllers. +Currently, the `ros2_control` framework supports only the `double` type to exchange data between hardware and controllers. This is confusing for users and it would be clearer if also boolean and integer values can be transported. ## Possible solution