doosan-robotics / doosan-robot

ROS for Doosan Robot
BSD 3-Clause "New" or "Revised" License
125 stars 62 forks source link

Programmatically recover from Safe Stop -> Exception "cannot signal semaphore: count would exceed maximum" #206

Open buswayne opened 4 months ago

buswayne commented 4 months ago

Hello, as in previous request, we are also trying to programmatically recover the robot when a safe stop happens.

We have seen that in dsr_hw_interface.cpp in OnMonitoringStateCB(const ROBOT_STATE eState) when the robot goes into Safe Stop, it actually throws the exception "cannot signal semaphore: count would exceed maximum", resulting in the robot to turn off and requiring manual restart.

We fixed it commenting the set_robot_control command makes the exception to go away.

Why is it happening in the first place? Is it safe to comment out that line? Thanks

        case STATE_SAFE_STOP:
            std::cout << "AHHH" << std::endl;
            if (g_bHasControlAuthority) {
                std::cout << "OHHH" << std::endl;
                Drfl.set_safe_stop_reset_type(SAFE_STOP_RESET_TYPE_DEFAULT);
                std::cout << "UHHH" << std::endl;
                // Drfl.set_robot_control(CONTROL_RESET_SAFET_STOP);
                std::cout << "EHHH" << std::endl;
            }
            break;