Skip to content

Commit 44a9db2

Browse files
committed
Robot status: motion possible depends on error bits instead of robot mode
1 parent f6596c2 commit 44a9db2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ur_robot_driver/src/ros/hardware_interface.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)