puesto que se pretente hacer una arquitectura cliente-servidor para iniciar los modos de funcionamiento, obtener los datos y la imagen que el robot captura o para poder controlarlo en el modo manual, nos hace falta definir un protocolo de mensajes para que puedan conversar entre el cliente y el servidor. Para este proposito he definido el siguiente formato de tramas de mensajes que intercambian:
Client-Server Communication
Init robot (TCP):
Client request:
SMS_INIT |
Server response confirmation:
SMS_INIT | SMS_ACK | "Server state: INIT" |
Server response error:
SMS_INIT | SMS_CRITICAL_ERROR | "server can't init due to call has failed" |
Exe Mode N (TCP):
Client request:
SMS_EXE_MODE_N |
Server response confirmation:
SMS_EXE_MODE_N | SMS_ACK | “(Server State): Running mode N” | MapaData(*) |
(*) Only in modes 1, 2 and 3
Server response error:
SMS_EXE_MODE_N | SMS_CRITICAL_ERROR | 1)"server can't run strategy due to the state wasn't ST_INIT" 2) "server can't run strategy due to init function failed" |
Robot and Camera commands (only on mode 6) (UDP):
Client request:
SMS_COM_ADVANCE | SMS_COM_GO_BACK | SMS_COM_TURN_RIGHT | SMS_COM_TURN_LEFT | SMS_COM_TILT_UP | SMS_COM_TILT_DOWN | SMS_COM_PAN_RIGHT | SMS_COM_PAN_LEFT | SMS_COM_CAM_RST | SMS_COM_STOP |
Cancel active mode (TCP):
Client request:
SMS_CANCEL |
Server response confirmation:
SMS_CANCEL | SMS_ACK | "Stopped mode N" |
Server response error:
SMS_CANCEL | SMS_WARNING | "Couldn't stop mode due to it wasn's running" |
Get data without image (UDP):
Client request:
SMS_RETURN_TEXT |
Server response:
SMS_RETURN_TEXT | GoalReached (*) | PosRobotX | PosRobotY | RobotTh |
idMark | posMarkX | posMarkY | MarkTh | UseMarkInfo (**) |
“date and time” |
(*) Some modes finished when reach one goal: 0 or 1
(**) 0 or 1 if use or not the position estimation.
Get data with image (UDP):
Client request:
SMS_RETURN_IMAGE |
Server response:
SMS_RETURN_IMAGE | GoalReached (*) | PosRobotX | PosRobotY | RobotTh |
idMark | posMarkX | posMarkY | MarkTh | UseMarkInfo (**) |
“date and time” | ImageData |
(*) Some modes finished when reach one goal: 0 or 1
(**) 0 or 1 if use or not the position estimation.
Saludos!!
No hay comentarios:
Publicar un comentario