Yaskawa-Global / motoros2

ROS 2 (rcl, rclc & micro-ROS) node for MotoPlus-compatible Yaskawa Motoman robot controllers
96 stars 18 forks source link

Cryptic error codes from mpStartJob #102

Closed ted-miller closed 1 year ago

ted-miller commented 1 year ago

When enabling a motion mode, the software tries to start the INFORM job. If it fails to start that job, it returns a cryptic error code. You would need to reference the MotoPlus documentation to find the definition.

Ex: Can't start 'INIT_ROS' because: 0x3040

We should map the error codes to a lookup table with human-readable strings.

0x0000 Normal end
0x2010 Robot is in operation
0x2030 In HOLD status (PP)
0x2040 In HOLD status (External)
0x2050 In HOLD status (Command)
0x2060 In error/alarm status
0x2070 In SERVO OFF status
0x2080 Wrong operation mode
0x3040 The home position is not registered
0x3050 Out of range (ABSO data)
0x3400 Cannot operate MASTER JOB
0x3410 The JOB name is already registered in another task.
0x4040 Specified JOB not found
aigallegos commented 1 year ago

Hi I would like to be assigned this. I'm pretty sure I can fix the problem I am just new to open source. Thanks!

ted-miller commented 1 year ago

Thanks @aigallegos. We appreciate the help!

When you have a solution worked up, please submit a pull request to the main branch. If you need any info, let us know.

gavanderhoorn commented 1 year ago

This was actually explicitly left as a TODO a couple of versions ago. We might have been too hasty removing those TODOs.

One is still left, here:

https://github.com/Yaskawa-Global/motoros2/blob/c2453273e80dfe2841d5338b08d489af943c5214/src/MotionControl.c#L1253-L1256

which I believe should also be addressed.

We should map the error codes to a lookup table with human-readable strings.

I believe we already have a function which does this:

https://github.com/Yaskawa-Global/motoros2/blob/c2453273e80dfe2841d5338b08d489af943c5214/src/ErrorHandling.c#L11-L33

AFAICT, it maps the status codes you list.