|
|
|
@ -36,6 +36,7 @@ struct RobotImp {
|
|
|
|
|
RESETTING_SUBNODE,
|
|
|
|
|
SUSBCRIBING_SUBNODE,
|
|
|
|
|
SETTING_MOVEMENT_MODE,
|
|
|
|
|
SUBSCRIBING_GIMBAL_STATUS,
|
|
|
|
|
SENDING_HEARTBEAT,
|
|
|
|
|
WAITING,
|
|
|
|
|
READY,
|
|
|
|
@ -170,6 +171,14 @@ robot_work(Robot robot) {
|
|
|
|
|
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:
|
|
|
|
|
{
|
|
|
|
|
if(robot->dirty_wheels) {
|
|
|
|
@ -279,6 +288,17 @@ robot_work(Robot robot) {
|
|
|
|
|
robot->state = STOPPED;
|
|
|
|
|
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;
|
|
|
|
|
break;
|
|
|
|
|
case SDK_HEARTBEAT_CMD:
|
|
|
|
|