dynamixel_motor icon indicating copy to clipboard operation
dynamixel_motor copied to clipboard

Added motor error warning mechanism

Open albertoramonj opened this issue 10 years ago • 6 comments

Hi Anton,

We've added a mechanism to warn high level nodes if there is any errors with the servos (now just FatalErrorCodeErrors, such as an overload error). We have created a new custom message named MotorError.msg and added the code necessary to publish the topic with the error info.

MotorError.msg

string error_type            # error type
string error_message         # error message
string extra_info            # extra info such a joint number, port...

dynamixel_serial_proxy.py

except dynamixel_io.FatalErrorCodeError, fece:
                    rospy.logerr(fece)
                    me = MotorError()
                    me.error_type = "FatalErrorCodeError"
                    me.error_message = fece.message
                    me.extra_info = fece.message.split(' ')[3][1:] # get the servo_id
                    pub = rospy.Publisher('dynamixel_motor_errors', MotorError, queue_size=None)
                    pub.publish(me)

Best,

Alberto.

albertoramonj avatar Oct 14 '14 11:10 albertoramonj

Hi @arebgun did you check this PR? We would like to merge the changes in your repo.

VGonPa avatar Oct 21 '14 08:10 VGonPa

Hi @VGonPa, I would really like to avoid merging extraneous stuff like formatting changes. Can you prepare a more targeted pull request that just adds the new features? Thanks!

arebgun avatar Oct 22 '14 22:10 arebgun

Hi,

the chages are made to make the code more compliant with PEP8.

If you want we can modify the push request to make it without the PEP8 modifications and later on make another PR to upload the PEP8 changes.

VGonPa avatar Oct 23 '14 14:10 VGonPa

I think what @arebgun wanted to mention might have been that the commits should be separated per code style change and functionality change -- mixing those 2 into a single commit makes the review and code tracking in the future really difficult. Ref. http://stackoverflow.com/a/2049159/577001

130s avatar Dec 27 '14 08:12 130s

OK, it makes complete sense to me. If you agree, that's what I'm going to do: first I will commit the PEP8 related changes, and once they are merged I will send the other ones.

VGonPa avatar Jan 08 '15 21:01 VGonPa

If we could just skip the PEP8 formatting changes that would be preferable, I really don't care for 79 character line limit among other things.

arebgun avatar Feb 24 '15 02:02 arebgun