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

Warn user when a resource is taking a long time to initialize #1757

Open
EzraBrooks opened this issue Sep 18, 2024 · 6 comments
Open

Warn user when a resource is taking a long time to initialize #1757

EzraBrooks opened this issue Sep 18, 2024 · 6 comments

Comments

@EzraBrooks
Copy link

Is your feature request related to a problem? Please describe.
When developing a custom robot, our driver was freezing when connecting to a particular motor. This resulted in the /controller_manager never advertising the services, because the resource manager never marked the components as initialized.

Describe the solution you'd like
We eventually figured out that it was our fault, but it would've been very useful to have the resource manager log a warning indicating that the resources had taken a really long time to start.

@saikishor
Copy link
Member

Hello @EzraBrooks!

There are some logs printed in debug mode. Right here : https://github.com/ros-controls/ros2_control/blob/master/hardware_interface%2Fsrc%2Fsystem.cpp#L269-L275. Does this help?

The idea is that each hardware takes its own time to initialize and activate, so most of these are decoupled from read and write cycles.

@christophfroehlich
Copy link
Contributor

Could we add a timeout for the initialization? And add it as a parameter to the hardware_spawner?

@saikishor
Copy link
Member

Could we add a timeout for the initialization? And add it as a parameter to the hardware_spawner?

I don't know if we have control over the initialisation time, as we don't spawn in a different thread to account for the time. Could be, but I'm not sure

@EzraBrooks
Copy link
Author

EzraBrooks commented Sep 19, 2024

If I run into the problem again today, I can try bumping the log level to debug and see if those logs are useful, but this is my last day hands-on with this particular robot and I need to get some other stuff working, so no promises on that front :/

@saikishor
Copy link
Member

If I run into the problem again today, I can try bumping the log level to debug and see if those logs are useful, but this is my last day hands-on with this particular robot and I need to get some other stuff working, so no promises on that front :/

Sure. Thank you!

@EzraBrooks
Copy link
Author

unfortunately I wasn't able to get around to that test. I do like @christophfroehlich's idea if possible, though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants