-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add connection timeout and respawn options #105
base: master
Are you sure you want to change the base?
Conversation
multisense_ros/src/ros_driver.cpp
Outdated
if (Status_Ok != status_result) { | ||
|
||
if (ros::Time::now() - last_warning > warn_delay) { | ||
ROS_WARN("multisense_ros: lost connection with camera"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning is fairly aggressive. Consider softening the language.
} | ||
|
||
if (timeout > ros::Duration{0} && ros::Time::now() - last_status > timeout) { | ||
ROS_ERROR("multisense_ros: shutting down due to connection timeout"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider changing this to something like "reinitializing connection with the MultiSense"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what less harsh comment would be applicable. During shutdown, we only respawn if the respawn argument was also passed, so I don't quite want to say that here. After this comment, we also exit with an error code, so it seems acceptable to be harsh
ros::spinOnce(); | ||
|
||
system::StatusMessage statusMessage; | ||
const auto status_result = d->getDeviceStatus(statusMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only get updated at 1Hz under the hood.
const auto status_result = d->getDeviceStatus(statusMessage); | ||
if (Status_Ok != status_result) { | ||
|
||
if (ros::Time::now() - last_warning > warn_delay) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this might be too chatty when a single status message is dropped
@mattalvarado I have updated so it does not print a warning until the status message has been missing for a full second, and only print at 1Hz to match the status message publish rate. The comment in the launch file for the camera_timeout setting also indicates times of 3s or more should be preferred |
The
camera_timeout_s
will cause the multisense node to shut down if it cannot communicate with the camera forcamera_timeout_s
seconds. Setting this value <=0 will disable the timeout checkThe
respawn
being true means the multisense launch file will attempt to re-launch the node if it is shut downUsed together these two options can be used to automatically re-connect to a camera after it is disconnected/reconnected or power cycled