Skip to content

Commit 58f6e54

Browse files
committed
Removed all robot status stuff
1 parent cafd37d commit 58f6e54

File tree

3 files changed

+0
-97
lines changed

3 files changed

+0
-97
lines changed

ur_robot_driver/include/ur_robot_driver/hardware_interface.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
// ROS
4949
#include "rclcpp/macros.hpp"
5050

51-
#include "ur_robot_driver/robot_status_interface.h"
52-
5351
using hardware_interface::Actuator;
5452
using hardware_interface::HardwareInfo;
5553
using hardware_interface::return_type;
@@ -96,12 +94,6 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
9694
return_type read() final;
9795
return_type write() final;
9896

99-
/*!
100-
* \brief Read and evaluate data in order to set robot status properties for industrial
101-
* robot status interface
102-
*/
103-
void extractRobotStatus();
104-
10597
/*!
10698
* \brief Callback to handle a change in the current state of the URCaps program running on the
10799
* robot. Executed only on the state change.
@@ -130,8 +122,6 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
130122
urcl::vector6d_t urcl_ft_sensor_measurements_;
131123
urcl::vector6d_t urcl_tcp_pose_;
132124

133-
RobotStatus robot_status_resource_{};
134-
135125
bool packet_read_;
136126

137127
uint32_t runtime_state_;

ur_robot_driver/include/ur_robot_driver/robot_status_interface.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,6 @@ void URPositionHardwareInterface::readBitsetData(const std::unique_ptr<rtde::Dat
351351

352352
return_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

537478
void URPositionHardwareInterface::handleRobotProgramState(bool program_running)
538479
{

0 commit comments

Comments
 (0)