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

Mechanism for failed init() #3

Open
galou opened this issue Jan 29, 2016 · 3 comments
Open

Mechanism for failed init() #3

galou opened this issue Jan 29, 2016 · 3 comments

Comments

@galou
Copy link

galou commented Jan 29, 2016

The function init() has prototypevoid ros_control_boilerplate::GenericHWInterface::init(). There is thus no way to specify a failed hardware initialization other than throwing an exception. Is this the intended way to do it? Maybe a bool ros_control_boilerplate::GenericHWInterface::init() would make sense?

@davetcoleman
Copy link
Member

Good point. For code this low level, though, is there any error handling you would do if you received a false? Could you not just add a loop inside init() that continued to attempt to reconnect to your hardware until you got the response you wanted?

@galou
Copy link
Author

galou commented Feb 4, 2016

I don't need an error handling outside the init() function but from what you say, the standard way to do it is to loop inside the init() function, probably better with a ROS_WARNING, until the connection to the hardware is successful.
If I understand the philosophy, the only way one should go out of the init() function is after success in connecting to the hardware.

@davetcoleman
Copy link
Member

I'm not certain I'm right or wrong, and there probably isn't a standard philosophy at this point. Are you saying you really want a bool return value?

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

No branches or pull requests

2 participants