Difference between revisions of "RCwiproc"

From RoboJackets Wiki
Jump to navigation Jump to search
Line 24: Line 24:
 
<br>
 
<br>
 
===Our Protocol===
 
===Our Protocol===
For the robocup competition our teams robots will need to implement a wireless RF protocol in order to communicate with a host computer. This protocol will allow the host to contol each robot directly and for the robots to provide information about themselves to the host. To facilltate this communication a set of Rx and Tx 900mHz RF modules will be used to send and recieve packets of serial data . Each packet will be lead by a header to intiate communication, followed by a data identifing the type of msg being sent, its length in bytes, which robot the msg is for, the data, and a checksum to determine if there is an error. Below is the general form of each packet. <br>
+
A vital part of our robocup team is its communication system. Therefore an effective means of sending information across this system will need to be realized with a protocol of some sort. In general our protocol needs to allow the host to command movements and actions to the robots, while allowing the robots to provide status information back to the host. The medium will be RF signals in the 900mHz range. This means that we can assume an appreciable dropped packet rate, and interfereance from other teams, and devices. Binary data clocked at 57Kbps will be our vocabulary, and the msg format will be in packets of varying length. Specifically each packet will be divided in bytes, with the first byte consisting of a know header. This will be followed by bytes containg the msg ID, its length, who its intended for, the data being sent, and a checksum. The checksum will be a sum of all the ones in the msg represented as an unsigned 8-bit number. Below in the figure is a a detail of what each packet will look like.  
 
+
<br>
 +
<br>
 +
The information that will be sent along the wireless link will be determined by the ID of the msg encapsulating it.  Other factors such as the msg destination and its DLC or data length code will further refine the msg. In the table below are the defintions for each msg. Some msg will require an acknowledgment or ACK from the recipient. An ACK will be realized as a msg of a different ID, and that msg is specified in the msg description in the table.
 
<br>
 
<br>
The type of msg being sent will determine the length of that packet and what data it contains. In the table below is a summary of each msg type.
+
<br>
{| style="text-align:left; width:800px; height:200px" cellspacing="0" cellpadding="5"
+
{| style="text-align:left; width:95%; height:400px" cellspacing="0" cellpadding="5"
|-style="border:.5px solid black; border-bottom:0px; background:#909090;"
+
|-style="border:1px solid black; border-bottom:1px; background:#909090"
! MsgID !! Hex !! Type !! Description !!
+
! MsgID !! ID !! ACK? !! To !! DLC !! Data Format !! Description
 
|-  
 
|-  
 
! style="border:.5px solid black; border-bottom:0px; background:#909090;" | Wakeup  
 
! style="border:.5px solid black; border-bottom:0px; background:#909090;" | Wakeup  
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x01
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x01
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Yes
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Establish communication with each robot on the field.  
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Individual robots
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 0
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | None
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Host polls for each robot individually. When this msg is recieved by a robot it responds with a status msg indicating that it is ready for action.
 
|-
 
|-
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Start (0x02)
+
 
 +
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Go/Start
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x02
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x02
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Yes
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Command to start main process on robots.
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Individual robots
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 0
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | None
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Intiates main process on robots.
 +
|-
  
|-
+
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Vx Vy and Theta   
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Velocity and Theta   
 
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x03
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x03
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack not required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | No
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Msg containing theta, speed, kick, Dribble and other cmds and data. Can be broadcast to all once robot is in main process. Can be broadcast to each robot in stop state.
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | All robots
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 15
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | See below
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Streaming data sent to all robots in one msg.
 
|-
 
|-
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Status
+
 
 +
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Stop
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x04
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x04
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | No
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Each robot sends status msgs to the host individually at 10Hz. No broadcast to all since only recipent of these msgs is the host.
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | All robots
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 0
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | None
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Stops all robot motion.
 
|-
 
|-
 +
 
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Shoot Ball
 
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Shoot Ball
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x05
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x05
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Yes
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Indicated robot is told to shoot.
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Individual robots
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 1
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Robot Angle
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Commands robot to take the shot. May be folded into msg 0x04
 
|-
 
|-
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Stop
+
! style="border:.5px solid black; border-bottom:0px; background:#909090" | Robot Stop
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x06
 
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | 0x06
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Ack not required
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Yes
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0" | Stops all robot motion. Broadcast to all only
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Individual robots
|}
+
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | 0
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | None
 +
| style="border:.5px solid black; border-bottom:0px; background:#d0d0d0;" | Commands an indivdual robot to stop.
 +
|-
 +
 
 
<br>
 
<br>
 
(Flow charts on how msgs are sent)
 
(Flow charts on how msgs are sent)

Revision as of 14:23, 10 August 2006

Wireless Protocol

The host will send each robot velocity, direction, and shoot directives, at a rate of about 40-50 Hz. (This data rate still needs to be confirmed with testing) In such a way the enitre system (host, camera, and robot) will behave as a real-time system. The robot will send its current error status, battery voltage, wheel velocity, unique ID, and whether or not it has the ball to the host but at the much slower rate of 10Hz.

To Do

  • Research protocols
    • UDP (User Datagram Protocol) - Dropping UDP as a choice in protocol. Would need a module that implements it already
    • Protocol Book
  • Determine the rate at which to update robots - Will need to find theoretical base for this and confirm with test.
  • Specify a custom protocol - Remeber to do Visio graph of packet structure
  • Evaluate and compare UDP to a custom protocol

Protocol Structure

What is a Protocol?

A protocol is a set of rules to define how two or more entities comunicate. It contains 5 basic elements:

  • A service definition - What information will the protocol provide the entities that utilize it?
  • A set of assumptions - What is assumed to in the protocol? What isn't?
  • A vocabulary - What will be the forms of data that I will use to communicate with this protocol
  • A format/encoding - How will my vocabulary coherantly fit together to form larger msgs, and cmds
  • A set of procedural rules - How will I intiate communication? How are the entities using this protocol indentied? What are thier roles?

Other considerations such as the medium are not specifically stated in the protocol but influence how the protocol is formed. Consider the difference between Wi-Fi where one router can talk to multiple devices versus communication between a wired video game controller and a console.

As an example of a protocol consider the english language in its vocal form. The service it provides is a means of conveying thoughts thruogh the use of sound. It assumes that all the parties involved can speak and understand english, that the medium is such that the transmission of sound waves is possible, and that meaning of the vocabulary used is the same among all parties involved. Its vocabulary is made up of 26 letters that by themselves or in groups represent a set of vocal patterns generated and recieved by all the parties involved. In this abstract defintion of vocabulary, it is not words but rather letters and the sounds they make that form the protocol. The basic format of the english language is such that the vocabulary of letters is formed into words, which each carry the meaning of the thought being conveyed. The procedural rules change based on the situation. Sometimes one person is communicating with a group of passive listeners, at other times several people are communicating with one person at once. There are even times (eavesdropping) where one or more parties are listening to a speaker not directly communicating to them.

Our Protocol

A vital part of our robocup team is its communication system. Therefore an effective means of sending information across this system will need to be realized with a protocol of some sort. In general our protocol needs to allow the host to command movements and actions to the robots, while allowing the robots to provide status information back to the host. The medium will be RF signals in the 900mHz range. This means that we can assume an appreciable dropped packet rate, and interfereance from other teams, and devices. Binary data clocked at 57Kbps will be our vocabulary, and the msg format will be in packets of varying length. Specifically each packet will be divided in bytes, with the first byte consisting of a know header. This will be followed by bytes containg the msg ID, its length, who its intended for, the data being sent, and a checksum. The checksum will be a sum of all the ones in the msg represented as an unsigned 8-bit number. Below in the figure is a a detail of what each packet will look like.

The information that will be sent along the wireless link will be determined by the ID of the msg encapsulating it. Other factors such as the msg destination and its DLC or data length code will further refine the msg. In the table below are the defintions for each msg. Some msg will require an acknowledgment or ACK from the recipient. An ACK will be realized as a msg of a different ID, and that msg is specified in the msg description in the table.


(Flow charts on how msgs are sent)

Articles

Links

Wireless Hompage

MsgID ID ACK? To DLC Data Format Description
Wakeup 0x01 Yes Individual robots 0 None Host polls for each robot individually. When this msg is recieved by a robot it responds with a status msg indicating that it is ready for action.
Go/Start 0x02 Yes Individual robots 0 None Intiates main process on robots.
Vx Vy and Theta 0x03 No All robots 15 See below Streaming data sent to all robots in one msg.
Stop 0x04 No All robots 0 None Stops all robot motion.
Shoot Ball 0x05 Yes Individual robots 1 Robot Angle Commands robot to take the shot. May be folded into msg 0x04
Robot Stop 0x06 Yes Individual robots 0 None Commands an indivdual robot to stop.