Skip to content

Enable to ignore fatal errors#97

Open
pazeshun wants to merge 1 commit intoarebgun:masterfrom
pazeshun:ignore-fatal-errors
Open

Enable to ignore fatal errors#97
pazeshun wants to merge 1 commit intoarebgun:masterfrom
pazeshun:ignore-fatal-errors

Conversation

@pazeshun
Copy link
Contributor

@pazeshun pazeshun commented Jul 6, 2022

When a Dynamixel motor detects some dangerous situations, the motor goes torque off:
https://emanual.robotis.com/docs/en/dxl/mx/mx-28/#shutdown
However, we sometimes want the motor to ignore the error and continue working.
For example, when we use the motor in robotic fingers and these fingers grasp an object, these fingers should continue exerting strong force not to drop the object.
In that situation, the motor continues detecting a big load, easily goes into Overload Error, and torque off.

To avoid this problem, we can remove errors from Shutdown (and Alarm LED) register of the motor to prevent torque off due to these errors.
However, even when we do that, these errors are included in every response from the motor.
dynamixel_motor detects them and prints many error messages (especially when Overload Error):

if not error_code & DXL_OVERHEATING_ERROR == 0:
msg = 'Overheating Error ' + ex_message
exception = FatalErrorCodeError(msg, error_code)
if not error_code & DXL_OVERLOAD_ERROR == 0:
msg = 'Overload Error ' + ex_message
exception = FatalErrorCodeError(msg, error_code)
if not error_code & DXL_INPUT_VOLTAGE_ERROR == 0:
msg = 'Input Voltage Error ' + ex_message
exception = NonfatalErrorCodeError(msg, error_code)
if not error_code & DXL_ANGLE_LIMIT_ERROR == 0:
msg = 'Angle Limit Error ' + ex_message
exception = NonfatalErrorCodeError(msg, error_code)
if not error_code & DXL_RANGE_ERROR == 0:
msg = 'Range Error ' + ex_message
exception = NonfatalErrorCodeError(msg, error_code)
if not error_code & DXL_CHECKSUM_ERROR == 0:
msg = 'Checksum Error ' + ex_message
exception = NonfatalErrorCodeError(msg, error_code)
if not error_code & DXL_INSTRUCTION_ERROR == 0:
msg = 'Instruction Error ' + ex_message
exception = NonfatalErrorCodeError(msg, error_code)

except dynamixel_io.FatalErrorCodeError, fece:
rospy.logerr(fece)
except dynamixel_io.NonfatalErrorCodeError, nfece:
self.error_counts['non_fatal'] += 1
rospy.logdebug(nfece)
except dynamixel_io.ChecksumError, cse:
self.error_counts['checksum'] += 1
rospy.logdebug(cse)
except dynamixel_io.DroppedPacketError, dpe:
self.error_counts['dropped'] += 1
rospy.logdebug(dpe.message)

This PR enables to suppress that phenomenon by setting rosparam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments