00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef MOTOMAN_DIRECT_MESSAGE_H
00033 #define MOTOMAN_DIRECT_MESSAGE_H
00034
00035 #define ROS_MAX_JOINT 10
00036
00037
00038
00039
00040
00041
00042 typedef struct
00043 {
00044 int length;
00045 } SmPrefix;
00046
00047
00048
00049
00050
00051 typedef enum
00052 {
00053 ROS_MSG_ROBOT_STATUS = 13,
00054 ROS_MSG_JOINT_TRAJ_PT_FULL = 14,
00055 ROS_MSG_JOINT_FEEDBACK = 15,
00056 ROS_MSG_MOTO_MOTION_CTRL = 2001,
00057 ROS_MSG_MOTO_MOTION_REPLY = 2002
00058 } SmMsgType;
00059
00060
00061 typedef enum
00062 {
00063 ROS_COMM_INVALID = 0,
00064 ROS_COMM_TOPIC = 1,
00065 ROS_COMM_SERVICE_RESQUEST = 2,
00066 ROS_COMM_SERVICE_REPLY = 3
00067 } SmCommType;
00068
00069
00070 typedef enum
00071 {
00072 ROS_REPLY_INVALID = 0,
00073 ROS_REPLY_SUCCESS = 1,
00074 ROS_REPLY_FAILURE = 2,
00075 } SmReplyType;
00076
00077
00078 typedef struct
00079 {
00080 SmMsgType msgType;
00081 SmCommType commType;
00082 SmReplyType replyType;
00083 } SmHeader;
00084
00085
00086
00087
00088
00089 typedef struct
00090 {
00091 int drives_powered;
00092 int e_stopped;
00093 int error_code;
00094 int in_error;
00095 int in_motion;
00096 int mode;
00097 int motion_possible;
00098 } SmBodyRobotStatus;
00099
00100
00101 typedef struct
00102 {
00103 int groupNo;
00104 int sequence;
00105 int validFields;
00106 float time;
00107 float pos[ROS_MAX_JOINT];
00108 float vel[ROS_MAX_JOINT];
00109 float acc[ROS_MAX_JOINT];
00110 } SmBodyJointTrajPtFull;
00111
00112
00113 typedef struct
00114 {
00115 int groupNo;
00116 int validFields;
00117 float time;
00118 float pos[ROS_MAX_JOINT];
00119 float vel[ROS_MAX_JOINT];
00120 float acc[ROS_MAX_JOINT];
00121 } SmBodyJointFeedback;
00122
00123
00124 typedef enum
00125 {
00126 ROS_CMD_CHECK_MOTION_READY = 200101,
00127 ROS_CMD_CHECK_QUEUE_CNT = 200102,
00128 ROS_CMD_STOP_MOTION = 200111,
00129 ROS_CMD_START_TRAJ_MODE = 200121,
00130 ROS_CMD_STOP_TRAJ_MODE = 200122,
00131 ROS_CMD_DISCONNECT = 200130
00132 } SmCommandType;
00133
00134
00135 typedef struct
00136 {
00137 int groupNo;
00138 int sequence;
00139 SmCommandType command;
00140 float data[ROS_MAX_JOINT];
00141 } SmBodyMotoMotionCtrl;
00142
00143
00144 typedef enum
00145 {
00146 ROS_RESULT_SUCCESS = 0,
00147 ROS_RESULT_TRUE = 0,
00148 ROS_RESULT_BUSY = 1,
00149 ROS_RESULT_FAILURE = 2,
00150 ROS_RESULT_FALSE = 2,
00151 ROS_RESULT_INVALID = 3,
00152 ROS_RESULT_ALARM = 4,
00153 ROS_RESULT_NOT_READY = 5,
00154 ROS_RESULT_MP_FAILURE = 6
00155 } SmResultType;
00156
00157 typedef enum
00158 {
00159 ROS_RESULT_INVALID_UNSPECIFIED = 3000,
00160 ROS_RESULT_INVALID_MSGSIZE,
00161 ROS_RESULT_INVALID_MSGHEADER,
00162 ROS_RESULT_INVALID_MSGTYPE,
00163 ROS_RESULT_INVALID_GROUPNO,
00164 ROS_RESULT_INVALID_SEQUENCE,
00165 ROS_RESULT_INVALID_COMMAND,
00166 ROS_RESULT_INVALID_DATA = 3010,
00167 ROS_RESULT_INVALID_DATA_START_POS,
00168 ROS_RESULT_INVALID_DATA_POSITION,
00169 ROS_RESULT_INVALID_DATA_SPEED,
00170 ROS_RESULT_INVALID_DATA_ACCEL,
00171 ROS_RESULT_INVALID_DATA_INSUFFICIENT
00172 } SmInvalidSubCode;
00173
00174
00175 typedef enum
00176 {
00177 ROS_RESULT_NOT_READY_UNSPECIFIED = 5000,
00178 ROS_RESULT_NOT_READY_ALARM,
00179 ROS_RESULT_NOT_READY_ERROR,
00180 ROS_RESULT_NOT_READY_ESTOP,
00181 ROS_RESULT_NOT_READY_NOT_PLAY,
00182 ROS_RESULT_NOT_READY_NOT_REMOTE,
00183 ROS_RESULT_NOT_READY_SERVO_OFF,
00184 ROS_RESULT_NOT_READY_HOLD,
00185 ROS_RESULT_NOT_READY_NOT_STARTED,
00186 ROS_RESULT_NOT_READY_WAITING_ROS,
00187 ROS_RESULT_NOT_READY_SKILLSEND
00188 } SmNotReadySubcode;
00189
00190
00191 typedef struct
00192 {
00193 int groupNo;
00194 int sequence;
00195 int command;
00196 SmResultType result;
00197 int subcode;
00198 float data[ROS_MAX_JOINT];
00199 } SmBodyMotoMotionReply;
00200
00201
00202 typedef union
00203 {
00204 SmBodyRobotStatus robotStatus;
00205 SmBodyJointTrajPtFull jointTrajData;
00206 SmBodyJointFeedback jointFeedback;
00207 SmBodyMotoMotionCtrl motionCtrl;
00208 SmBodyMotoMotionReply motionReply;
00209 } SmBody;
00210
00211
00212
00213
00214
00215 struct _SimpleMsg
00216 {
00217 SmPrefix prefix;
00218 SmHeader header;
00219 SmBody body;
00220 } __attribute__((__packed__));
00221 typedef struct _SimpleMsg SimpleMsg;
00222
00223 #endif