How to enforce joint limits specified in the hardware_interface::InterfaceInfo struct at the hardware_interface level?

asked 2022-04-21 19:38:57 -0500

updated 2022-04-22 12:36:57 -0500

The hardware_interface::InterfaceInfo struct, has min, max and initial_value fields, but I couldn't find any code where those limits are actually enforced when controllers set values on the CommandInterface (via LoanedCommandInterface) objects. These configured limits don't seem to be easily available for lookup by custom controllers either, since the InterfaceInfo object for the command interfaces is only available at the hardware_interface level.

Furthermore, it seems like the CommandInterface class cannot be extended with a custom set_value() implementation (in order to directly apply said limits, or other custom constraints) either, because:

  • the ReadWriteHandle::set_value() function is not declared virtual, and
  • the CommandInterface objects are always operated on via a static-typed CommandInterface reference (not a polymorphic pointer).

How then, is one to enforce these InterfaceInfo limits?

Some sample code links would be greatly appreciated.

Thanks in advance.

edit retag flag offensive close merge delete