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(
119
119
RCLCPP_WARN (get_node ()->get_logger (), " Robot software version not set yet." );
120
120
return false ;
121
121
}
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) {
123
124
resp->major = ptr->major ;
124
125
resp->minor = ptr->minor ;
125
126
resp->build = ptr->build ;
126
127
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 ;
128
136
}
129
137
} // namespace ur_controllers
130
138
You can’t perform that action at this time.
0 commit comments