File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,20 @@ bool URConfigurationController::getRobotSoftwareVersion(
119119 RCLCPP_WARN (get_node ()->get_logger (), " Robot software version not set yet." );
120120 return false ;
121121 }
122- return robot_software_version_.try_get ([resp](const std::shared_ptr<VersionInformation> ptr) {
122+ int tries = 0 ;
123+ while (!robot_software_version_.try_get ([resp](const std::shared_ptr<VersionInformation> ptr) {
123124 resp->major = ptr->major ;
124125 resp->minor = ptr->minor ;
125126 resp->build = ptr->build ;
126127 resp->bugfix = ptr->bugfix ;
127- });
128+ })) {
129+ if (tries > 10 ) {
130+ return false ;
131+ }
132+ rclcpp::sleep_for (std::chrono::milliseconds (50 ));
133+ tries++;
134+ }
135+ return true ;
128136}
129137} // namespace ur_controllers
130138
You can’t perform that action at this time.
0 commit comments