|
|
|
@ -28,8 +28,6 @@ struct RobotImp {
|
|
|
|
|
|
|
|
|
|
bool sdk_mode;
|
|
|
|
|
|
|
|
|
|
float x, y, z;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
CONNECTING_TO_PROXY_PORT,
|
|
|
|
|
SETTING_SDK_CONNECTION,
|
|
|
|
@ -38,7 +36,6 @@ struct RobotImp {
|
|
|
|
|
RESETTING_SUBNODE,
|
|
|
|
|
SUSBCRIBING_SUBNODE,
|
|
|
|
|
SETTING_MOVEMENT_MODE,
|
|
|
|
|
SUBSCRIBING_POSITION_STATUS,
|
|
|
|
|
SENDING_HEARTBEAT,
|
|
|
|
|
WAITING,
|
|
|
|
|
READY,
|
|
|
|
@ -173,14 +170,6 @@ robot_work(Robot robot) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case SUBSCRIBING_POSITION_STATUS:
|
|
|
|
|
{
|
|
|
|
|
add_sub_msg ( &req, robot->seq++, true, 20, 1, DDS_POSITION );
|
|
|
|
|
req_send(robot->client->dev_conn, &req);
|
|
|
|
|
robot->state = WAITING;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case READY:
|
|
|
|
|
{
|
|
|
|
|
if(robot->dirty_wheels) {
|
|
|
|
@ -255,8 +244,6 @@ robot_work(Robot robot) {
|
|
|
|
|
switch(resp.header.cmd) {
|
|
|
|
|
case 0:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
case SET_SDK_CONNECTION_CMD:
|
|
|
|
|
// TODO: Do more with this
|
|
|
|
|
if(resp.resp.sdkconn.retcode) {
|
|
|
|
@ -292,13 +279,6 @@ robot_work(Robot robot) {
|
|
|
|
|
robot->state = STOPPED;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
robot->state = SUBSCRIBING_POSITION_STATUS;
|
|
|
|
|
break;
|
|
|
|
|
case ADD_SUB_MSG_CMD:
|
|
|
|
|
if(resp.resp.sub.retcode) {
|
|
|
|
|
robot->state = STOPPED;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
robot->state = SENDING_HEARTBEAT;
|
|
|
|
|
break;
|
|
|
|
|
case SDK_HEARTBEAT_CMD:
|
|
|
|
@ -308,12 +288,6 @@ robot_work(Robot robot) {
|
|
|
|
|
}
|
|
|
|
|
robot->state = READY;
|
|
|
|
|
break;
|
|
|
|
|
case PUSH_PERIOD_MSG_CMD:
|
|
|
|
|
// assume it is a position status for now
|
|
|
|
|
robot->x = resp.resp.push.position.x;
|
|
|
|
|
robot->y = resp.resp.push.position.y;
|
|
|
|
|
robot->z = resp.resp.push.position.z;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|