File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -676,9 +676,6 @@ void HardwareInterface::extractRobotStatus()
676676 robot_status_resource_.drives_powered =
677677 robot_status_bits_[toUnderlying (UrRtdeRobotStatusBits::IS_POWER_ON)] ? TriState::TRUE : TriState::FALSE ;
678678
679- robot_status_resource_.motion_possible =
680- robot_mode_ == ur_dashboard_msgs::RobotMode::RUNNING ? TriState::TRUE : TriState::FALSE ;
681-
682679 // I found no way to reliably get information if the robot is moving
683680 robot_status_resource_.in_motion = TriState::UNKNOWN;
684681
@@ -691,6 +688,18 @@ void HardwareInterface::extractRobotStatus()
691688 robot_status_resource_.in_error = TriState::FALSE ;
692689 }
693690
691+ // Motion is not possible if controller is either in error or in safeguard stop.
692+ // TODO: Check status of robot program "external control" here as well
693+ if (robot_status_resource_.in_error == TriState::TRUE ||
694+ safety_status_bits_[toUnderlying (UrRtdeSafetyStatusBits::IS_SAFEGUARD_STOPPED)])
695+ {
696+ robot_status_resource_.motion_possible = TriState::FALSE ;
697+ }
698+ else
699+ {
700+ robot_status_resource_.motion_possible = TriState::TRUE ;
701+ }
702+
694703 // the error code, if any, is not transmitted by this protocol
695704 // it can and should be fetched seperately
696705 robot_status_resource_.error_code = 0 ;
You can’t perform that action at this time.
0 commit comments