error_code.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef ERROR_CODE__H
  2. #define ERROR_CODE__H
  3. //error
  4. #define RC_ERROR_INDEX_BEYOND_MIN_CODE 0x00000001
  5. #define RC_ERROR_INDEX_BEYOND_MAX_CODE 0x00000002
  6. #define RC_ERROR_DRIVER_ENABLE_FAILED_CODE 0x00000003
  7. #define RC_ERROR_IMU_DATA_IS_NOT_CORRECT_CODE 0x00000004
  8. #define RC_ERROR_DRIVER_BEYOND_LIMIT_CAN_NOT_ENABLE_CODE 0x00000005
  9. #define RC_ERROR_DRIVER_NEED_POS_CALIBRATE_CODE 0x00000006
  10. #define RC_ERROR_BATTARY_LEVEL_IS_TOO_LOW_CODE 0x00000007
  11. #define RC_ERROR_DRIVER_ENCODER_HAS_BEEN_RESET_CODE 0x00000008
  12. #define RC_ERROR_ROBOT_ESTOP_OCCURRED_CODE 0x00000009
  13. #define RC_ERROR_LIEDOWN_POSTURE_WITH_LEGS_PLACED_CODE 0x0000000A
  14. #define RC_ERROR_DRIVER_ENABLED_FAILED_WITHIN_DEADLINE_CODE 0x0000000B
  15. #define RC_ERROR_DRIVER_ENABLE_CANNOT_PASS_SELFCHECK_CODE 0x0000000C
  16. #define RC_ERROR_RUNTIME_BUS_NET_CANNOT_BUILD_CODE 0x0000000D
  17. #define RC_ERROR_CODE_CUR_MAX_INDEX 0x0000000E
  18. #define RC_ERROR_MAX_INDEX_CODE (CODE_WHEEL_NUM * 32)
  19. #define RC_ERROR_INDEX_BEYOND_MIN_MSG "The Error index value beyond the min limit."
  20. #define RC_ERROR_INDEX_BEYOND_MAX_MSG "The Error index value beyond the max limit."
  21. #define RC_ERROR_DRIVER_ENABLE_FAILED_MSG "The driver enable failed."
  22. #define RC_ERROR_IMU_DATA_IS_NOT_CORRECT_MSG "The IMU data is not correct. Please check IMU."
  23. #define RC_ERROR_DRIVER_BEYOND_LIMIT_CAN_NOT_ENABLE_MSG "The joint is beyond limit, so can't enable. please rotate the joint."
  24. #define RC_ERROR_DRIVER_NEED_POS_CALIBRATE_MSG "The driver's position need calibrate after power on."
  25. #define RC_ERROR_BATTARY_LEVEL_IS_TOO_LOW_MSG "The Robot's battary is too low, must estop!"
  26. #define RC_ERROR_DRIVER_ENCODER_HAS_BEEN_RESET_MSG "The Dirver's Encoder has been reset. You need recalibrate the robot joint position!"
  27. #define RC_ERROR_ROBOT_ESTOP_OCCURRED_MSG "The Robot has been EStoped!"
  28. #define RC_ERROR_LIEDOWN_POSTURE_WITH_LEGS_PLACED_MSG "The Robot's lie down posture is not correct."
  29. #define RC_ERROR_DRIVER_ENABLED_FAILED_WITHIN_DEADLINE_MSG "The Robot's can't completed driver enable within the deadline."
  30. #define RC_ERROR_DRIVER_ENABLE_CANNOT_PASS_SELFCHECK_MSG "The Robot's can't pass self check, so driver can't be Enabled."
  31. #define RC_ERROR_RUNTIME_BUS_NET_CANNOT_BUILD_MSG "The Robot's runtime bus net can't be build, please check line and slaves."
  32. #define RC_JOINT_ERROR_CLEAR_7303_FAILED_CODE 0x00000001
  33. #define RC_JOINT_ERROR_STATUS_WORD_ERROR_CODE 0x00000002
  34. #define RC_JOINT_ERROR_OVER_VOLTAGE_CODE 0x00000003
  35. #define RC_JOINT_ERROR_STO_DISABLE_CODE 0x00000004
  36. #define RC_JOINT_ERROR_POS_BEYOND_LIMIT_CODE 0x00000005
  37. #define RC_JOINT_ERROR_VEL_BEYOND_LIMIT_CODE 0x00000006
  38. #define RC_JOINT_ERROR_FORCE_BEYOND_LIMIT_CODE 0x00000007
  39. #define RC_JOINT_ERROR_POS_BEYOND_A_LOOP_CODE 0x00000008
  40. #define RC_JOINT_ERROR_POSITION_GAP_TOO_BIG_CODE 0x00000009
  41. #define RC_JOINT_ERROR_TRQ_SENSOR_IS_NOT_CORRECT_CODE 0x0000000A
  42. #define RC_JOINT_ERROR_ENCODER_BISERBIT_CODE 0x0000000B
  43. #define RC_JOINT_ERROR_ENCODER_BISWNBIT_CODE 0x0000000C
  44. #define RC_JOINT_ERROR_ENCODER_BATTERY_CODE 0x0000000D
  45. #define RC_JOINT_ERROR_MOTOR_FAULT_OCCURED_CODE 0x0000000E
  46. #define RC_JOINT_ERROR_DRIVER_FAULT_OCCURED_CODE 0x0000000F
  47. #define RC_JOINT_ERROR_DRIVER_CPU_TEMPERATURE_TOO_HEIGH_CODE 0x00000010
  48. #define RC_JOINT_ERROR_DRIVER_TEMPERATURE_TOO_HEIGH_CODE 0x00000011
  49. #define RC_JOINT_ERROR_MOTOR_TEMPERATURE_TOO_HEIGH_CODE 0x00000012
  50. #define RC_JOINT_ERROR_CODE_CUR_MAX_INDEX 0x00000013
  51. #define RC_JOINT_ERROR_MAX_INDEX_CODE (JOINT_CODE_WHEEL_NUM * 32)
  52. #define RC_JOINT_ERROR_CLEAR_7303_FAILED_MSG "Clear driver's 7303 error, calibrate encode vlaue failed."
  53. #define RC_JOINT_ERROR_STATUS_WORD_ERROR_MSG "The Driver has error, the status word is error.Maybe is 7303, but not sure. Please check log."
  54. #define RC_JOINT_ERROR_OVER_VOLTAGE_MSG "The driver's valtage is too high."
  55. #define RC_JOINT_ERROR_STO_DISABLE_MSG "Maybe the driver's STO button is disable. Please check and release it."
  56. #define RC_JOINT_ERROR_POS_BEYOND_LIMIT_MSG "The driver's position is beyond the limit."
  57. #define RC_JOINT_ERROR_VEL_BEYOND_LIMIT_MSG "The driver's velocity is beyond the limit."
  58. #define RC_JOINT_ERROR_FORCE_BEYOND_LIMIT_MSG "The driver's force is beyond the limit."
  59. #define RC_JOINT_ERROR_POS_BEYOND_A_LOOP_MSG "Driver position beyond a loop."
  60. #define RC_JOINT_ERROR_POSITION_GAP_TOO_BIG_MSG "The driver's position occurred a huge springboard."
  61. #define RC_JOINT_ERROR_TRQ_SENSOR_IS_NOT_CORRECT_MSG "The driver's trq sensor is not correct."
  62. #define RC_JOINT_ERROR_ENCODER_BISERBIT_MSG "7303 error BisErBit."
  63. #define RC_JOINT_ERROR_ENCODER_BISWNBIT_MSG "7303 error BisWnBit."
  64. #define RC_JOINT_ERROR_ENCODER_BATTERY_MSG "Driver encoder battery 7303 error BisWnBit."
  65. #define RC_JOINT_ERROR_MOTOR_FAULT_OCCURED_MSG "The motor has error. Please stop Robot."
  66. #define RC_JOINT_ERROR_DRIVER_FAULT_OCCURED_MSG "The driver has error. Please stop Robot."
  67. #define RC_JOINT_ERROR_DRIVER_CPU_TEMPERATURE_TOO_HEIGH_MSG "The driver's cpu temperature is too high. Please stop Robot."
  68. #define RC_JOINT_ERROR_DRIVER_TEMPERATURE_TOO_HEIGH_MSG "The driver's temperature is too high. Please stop Robot."
  69. #define RC_JOINT_ERROR_MOTOR_TEMPERATURE_TOO_HEIGH_MSG "The motor's temperature is too high. Please stop Robot."
  70. //warnning
  71. #define RC_WARN_MASTER_DATA_PACKET_LOSS_CODE 0x00000001
  72. #define RC_WARN_BATTARY_LEVEL_IS_TOO_LOW_CODE 0x00000002
  73. #define RC_WARN_CODE_CUR_MAX_INDEX 0x00000003
  74. #define RC_WARN_MAX_INDEX_CODE (CODE_WHEEL_NUM * 32)
  75. #define RC_WARN_MASTER_DATA_PACKET_LOSS_MSG "The EtherCat Master's data packet lossed."
  76. #define RC_WARN_BATTARY_LEVEL_IS_TOO_LOW_MSG "The Robot's battary is too low, please charge!"
  77. #define RC_JOINT_WARN_CODE_CUR_MAX_INDEX 0x00000001
  78. #define RC_JOINT_WARN_MAX_INDEX_CODE (JOINT_CODE_WHEEL_NUM * 32)
  79. //note
  80. #define RC_NOTE_DRIVER_TEMPERATURE_TOO_HIGH_CODE 0x00000001
  81. #define RC_NOTE_CODE_CUR_MAX_INDEX 0x00000002
  82. #define RC_NOTE_MAX_INDEX_CODE (CODE_WHEEL_NUM * 32)
  83. #define RC_NOTE_DRIVER_TEMPERATURE_TOO_HIGH_MSG "The driver's temperature is too high."
  84. #define RC_JOINT_NOTE_CODE_CUR_MAX_INDEX 0x00000001
  85. #define RC_JOINT_NOTE_MAX_INDEX_CODE (JOINT_CODE_WHEEL_NUM * 32)
  86. #endif