Skip to content

missing default read implementeation for HardwareComponentInterface #2734

@christianrauch

Description

@christianrauch

Describe the bug
HardwareComponentInterface::read is purely virtual while HardwareComponentInterface::write has a default implementation returning OK. This is inconsistent, as both should either be unimplemented or default to OK.

By the current design, an ActuatorInterface has to implement read, while a SensorInterface does not have to implement a write. In fact, SensorInterface::write overrides HardwareComponentInterface::write with the exact same behaviour of return return_type::OK;.

To Reproduce
Steps to reproduce the behavior:

  1. implement a ActuatorInterface
  2. you have to implement a ActuatorInterface::read that does nothing

Expected behavior
HardwareComponentInterface::read and HardwareComponentInterface::write should both be either be purely virtual or default implemented. ActuatorInterface::read should be default implemented either via HardwareComponentInterface::read if this has a default implementation, or by a custom default implementation similar to SensorInterface::write.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu
  • Version jazzy

Additional context
Add any other context about the problem here, especially include any modifications to ros2_control that relate to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions