|
|
@ -36,6 +36,7 @@ struct RobotImp {
|
|
|
|
RESETTING_SUBNODE,
|
|
|
|
RESETTING_SUBNODE,
|
|
|
|
SUSBCRIBING_SUBNODE,
|
|
|
|
SUSBCRIBING_SUBNODE,
|
|
|
|
SETTING_MOVEMENT_MODE,
|
|
|
|
SETTING_MOVEMENT_MODE,
|
|
|
|
|
|
|
|
SUBSCRIBING_GIMBAL_STATUS,
|
|
|
|
SENDING_HEARTBEAT,
|
|
|
|
SENDING_HEARTBEAT,
|
|
|
|
WAITING,
|
|
|
|
WAITING,
|
|
|
|
READY,
|
|
|
|
READY,
|
|
|
@ -170,6 +171,14 @@ robot_work(Robot robot) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case SUBSCRIBING_GIMBAL_STATUS:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
add_sub_msg ( &req, robot->seq++, true, 21, 1, DDS_GIMBAL_BASE );
|
|
|
|
|
|
|
|
req_send(robot->client->sdk_conn, &req);
|
|
|
|
|
|
|
|
robot->state = WAITING;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case READY:
|
|
|
|
case READY:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(robot->dirty_wheels) {
|
|
|
|
if(robot->dirty_wheels) {
|
|
|
@ -279,6 +288,17 @@ robot_work(Robot robot) {
|
|
|
|
robot->state = STOPPED;
|
|
|
|
robot->state = STOPPED;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
robot->state = SUBSCRIBING_GIMBAL_STATUS;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ADD_SUB_MSG_CMD:
|
|
|
|
|
|
|
|
if(resp.resp.sub.retcode) {
|
|
|
|
|
|
|
|
robot->state = STOPPED;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(resp.resp.sub.ack_node_id != host2byte(CLIENT_HOST, CLIENT_INDEX)) {
|
|
|
|
|
|
|
|
robot->state = STOPPED;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
robot->state = SENDING_HEARTBEAT;
|
|
|
|
robot->state = SENDING_HEARTBEAT;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SDK_HEARTBEAT_CMD:
|
|
|
|
case SDK_HEARTBEAT_CMD:
|
|
|
|