Recent Changes - Search:

Tracking

Hardware

Software

Mega Plan

Etc.

V2PacketFormats

Serial Packets

The startup handshake is two-part. The Uno sends an ACK message to initiate. The Pi responds with a CFG packet. The Uno then responds with an ACK.

Any transmission errors result in the sending of a NAK. Upon receipt of a NAK, the receiving system will automatically resend the last packet transmitted.

Socket connected systems may send packets directly through on a retransmit message. For these messages, described in the later section on socket packets, there is no checksum. That is computed on the Pi in the retransmit process. This simplifies the client code necessary for controlling the robots.

The general framing is as follows:

HeaderLengthPayloadChecksum

Sample Packet - Move Foward 10cm/s

0xBD0xBD0xBD3DMS100x53

Header The header/synchronization sequence uses three sequential octets consisting of 0xBD. This byte was selected because it would not naturally appear in packets.

0xBD0xBD0xBD

Length This is a single octet and represents the number of octets in the payload.

Checksum This is a single octet and is the XOR combination of all octets in the payload and the length.

Payload

Packet TypeCommand Code OneCommand Code TwoData

The valid payloads are as follows:

Claw OpenDGO
Claw CloseDGC
Claw SetDGS<pos>(0 to 30)
Claw Can CloseDGG
Camera UpDCU
Camera DownDCD
Camera SetDCS<pos> (0 to 100)
MoveDMS<speed>(-100 to 100)
Move to DistanceDMD<speed>(-100 to 100)<dist> (0 to x meters)
Differential WheelsDMW<left speed>(-100 to 100)<right speed> (-100 to 100)
RotationDRC<speed> (-100 to 100)
Degree RotationDRD<speed> (-100 to 100)<degree> (0 to 359)
StopDST
ConfigurationCFG<gripper><l_wheel_stop><r_wheel_stop><servo model><id><ip 3><ip 4>
AcknowledgeACK
Non-AcknowledgeNAK
EmergencyEMG
SensorSEN<battery><ir1><ir2><ir3><ir4><ir5>
... continued<l_bump><h_bump><spd 0><spd 1><spd 2><int 0><int 1><int2>

TCP Socket Packets

The general framing is as follows:

Packet LengthData

Sample Packet - Retransmit to Uno - Close Claw

6RT3DCG

Header The header/synchronization sequence is handled by TCP.

Packet Length This is the total length of the Data

Data The valid data segments are as follows:

Start BehaviorBS<c/lua>(0 - C, 1 - Lua)<behavior name>
AcknowledgeAK
Non-AcknowledgeNK
EmergencyEM
CalibrationCP<gripper><l_wheel><r_wheel><servo model><id><ip_3><ip_4>
RetransmitRT<payload len><payload (same as Serial)>
Edit - History - Print - Recent Changes - Search
Page last modified on November 17, 2013, at 02:22 PM