@@ -351,14 +351,6 @@ void URPositionHardwareInterface::readBitsetData(const std::unique_ptr<rtde::Dat
351351
352352return_type URPositionHardwareInterface::read ()
353353{
354- robot_status_resource_.mode = RobotMode::UNKNOWN;
355- robot_status_resource_.e_stopped = TriState::UNKNOWN;
356- robot_status_resource_.drives_powered = TriState::UNKNOWN;
357- robot_status_resource_.motion_possible = TriState::UNKNOWN;
358- robot_status_resource_.in_motion = TriState::UNKNOWN;
359- robot_status_resource_.in_error = TriState::UNKNOWN;
360- robot_status_resource_.error_code = 0 ;
361-
362354 std::unique_ptr<rtde::DataPackage> data_pkg = ur_driver_->getDataPackage ();
363355
364356 if (data_pkg)
@@ -393,7 +385,6 @@ return_type URPositionHardwareInterface::read()
393385 readBitsetData<uint32_t >(data_pkg, " tool_analog_input_types" , tool_analog_input_types_);
394386
395387 // TODO logic for sending other stuff to higher level interface
396- extractRobotStatus ();
397388
398389 // pausing state follows runtime state when pausing
399390 if (runtime_state_ == static_cast <uint32_t >(rtde::RUNTIME_STATE::PAUSED))
@@ -483,56 +474,6 @@ return_type URPositionHardwareInterface::write()
483474 }
484475}
485476
486- void URPositionHardwareInterface::extractRobotStatus ()
487- {
488- robot_status_resource_.mode =
489- robot_status_bits_[urcl::toUnderlying (rtde::UrRtdeRobotStatusBits::IS_TEACH_BUTTON_PRESSED)] ? RobotMode::MANUAL :
490- RobotMode::AUTO;
491-
492- robot_status_resource_.e_stopped =
493- safety_status_bits_[urcl::toUnderlying (rtde::UrRtdeSafetyStatusBits::IS_EMERGENCY_STOPPED)] ? TriState::TRUE :
494- TriState::FALSE ;
495-
496- // Note that this is true as soon as the drives are powered,
497- // even if the brakes are still closed
498- // which is in slight contrast to the comments in the
499- // message definition
500- robot_status_resource_.drives_powered =
501- robot_status_bits_[urcl::toUnderlying (rtde::UrRtdeRobotStatusBits::IS_POWER_ON)] ? TriState::TRUE :
502- TriState::FALSE ;
503-
504- // I found no way to reliably get information if the robot is moving
505- robot_status_resource_.in_motion = TriState::UNKNOWN;
506-
507- if ((safety_status_bits_ & IN_ERROR_BITSET).any ())
508- {
509- robot_status_resource_.in_error = TriState::TRUE ;
510- }
511- else
512- {
513- robot_status_resource_.in_error = TriState::FALSE ;
514- }
515-
516- // Motion is not possible if controller is either in error or in safeguard stop.
517- // TODO: Check status of robot program "external control" here as well
518- if (robot_status_resource_.in_error == TriState::TRUE ||
519- safety_status_bits_[urcl::toUnderlying (rtde::UrRtdeSafetyStatusBits::IS_SAFEGUARD_STOPPED)])
520- {
521- robot_status_resource_.motion_possible = TriState::FALSE ;
522- }
523- else if (robot_mode_ == ur_dashboard_msgs::msg::RobotMode::RUNNING)
524- {
525- robot_status_resource_.motion_possible = TriState::TRUE ;
526- }
527- else
528- {
529- robot_status_resource_.motion_possible = TriState::FALSE ;
530- }
531-
532- // the error code, if any, is not transmitted by this protocol
533- // it can and should be fetched separately
534- robot_status_resource_.error_code = 0 ;
535- }
536477
537478void URPositionHardwareInterface::handleRobotProgramState (bool program_running)
538479{
0 commit comments