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

[ Report mock_hardware ] - Provide information whether we are running on mock hardware or not #1021

Closed
firesurfer opened this issue Jun 14, 2024 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@firesurfer
Copy link
Contributor

Feature summary

In our system we have several components that are either mocked or that control real hardware. For testing purposes it is really useful to mix both modes.

I couldn't figure out a way yet to determine whether a UR hardware interface is mocked or running or real hardware.

I think it would be nice of the status controller could provide that information. What do you think?

Implementation

I have no idea what the best way to implement this is. For my own ros2 control hardware interfaces I solved it by not using the generic mock components but by providing my own mocked interface in the communication layer below. So the hardware interface is always loaded and I can provide a StateInterface with the needed information.

@firesurfer firesurfer added the enhancement New feature or request label Jun 14, 2024
@fmauch
Copy link
Collaborator

fmauch commented Jun 19, 2024

How exactly would you plan to use it?

ros2 control list_hardware_components already provides that information:

$ ros2 control list_hardware_components
Hardware Component 1
        name: ur5e
        type: system
        plugin name: ur_robot_driver/URPositionHardwareInterface
        state: id=3 label=active
$ ros2 control list_hardware_components
[INFO] [1718785882.878497337] [_ros2cli_2761454]: waiting for service /controller_manager/list_hardware_components to become available...
Hardware Component 1
        name: ur5e
        type: system
        plugin name: mock_components/GenericSystem
        state: id=3 label=active

Obviously, wrapping this in a service call or even broadcasting this via a topic might be an appropriate thing to do, but that would have to be handled inside ros2_control. Would this cover your use-case?


Edit: Thinking about my comment, the cli talks to the controller_manager using services, as well, so that information is also available in ros2 service call /controller_manager/list_hardware_components controller_manager_msgs/srv/ListHardwareComponents

@fmauch fmauch added the question Further information is requested label Jun 19, 2024
@firesurfer
Copy link
Contributor Author

I wasn't aware of the possibility to request the type of plugin via ros2 control. Thanks for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants