Go to Post Tolerance, forgiveness, humor, and lessons learned are tools we can find here. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-10-2009, 16:06
JimWright949's Avatar
JimWright949 JimWright949 is offline
The Owen Day of Seattle
AKA: Jim Wright
FRC #4542 (Titanium Talons)
Team Role: Mentor
 
Join Date: Sep 2003
Rookie Year: 2003
Location: Redmond, WA
Posts: 94
JimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to behold
cRio to DS packet spec.

Hello all,

I'm working on a personal project where I'm hooking a Gumstix mini computer to an iCreate. The Gumstix has 802.11 on it and I was thinking of using a FIRST drivers station as the thing on my end to control it.

In order to do this I will need to learn the packet communication between the two so I can implement the code that the cRio has on it onto the Gumstix. I was thinking of sniffing the packets on our practice robot which is at my house currently, but then I thought someone else may already have this info and can share it with me. So….

Does anyone have the packet communication between the DS and the cRio that they can share with me?

-Jim
Reply With Quote
  #2   Spotlight this post!  
Unread 21-10-2009, 18:46
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: cRio to DS packet spec.

I was working on somthing similar, but I never finished coding it.

You can view the source code and documentation I was working on on Codeplex, but the documentation is really more of note for myself than usable documentation.

The data from the DS to robot is defined as:
Code:
#define USER_CONTROL_DATA_SIZE 984 //This number is from memory, it wasn't in this chuck of code from my docs.

struct FRCControlData{
	UINT16 packetIndex;
	union {
		UINT8 control;
		struct {
			UINT8 reset : 1;
			UINT8 notEStop : 1;
			UINT8 enabled : 1;
			UINT8 autonomous : 1;
			UINT8 :1;
			UINT8 resync : 1;
			UINT8 cRIOChkSum :1;
			UINT8 fpgaChkSum :1;
		};
	};
	UINT8 dsDigitalIn;
	UINT16 teamID;

	char dsID_Alliance;
	char dsID_Position;

	union {
		INT8 stick0Axes[6];
		struct {
			INT8 stick0Axis1;
			INT8 stick0Axis2;
			INT8 stick0Axis3;
			INT8 stick0Axis4;
			INT8 stick0Axis5;
			INT8 stick0Axis6;
		};
	};
	UINT16 stick0Buttons;		// Left-most 4 bits are unused

	union {
		INT8 stick1Axes[6];
		struct {
			INT8 stick1Axis1;
			INT8 stick1Axis2;
			INT8 stick1Axis3;
			INT8 stick1Axis4;
			INT8 stick1Axis5;
			INT8 stick1Axis6;
		};
	};
	UINT16 stick1Buttons;		// Left-most 4 bits are unused

	union {
		INT8 stick2Axes[6];
		struct {
			INT8 stick2Axis1;
			INT8 stick2Axis2;
			INT8 stick2Axis3;
			INT8 stick2Axis4;
			INT8 stick2Axis5;
			INT8 stick2Axis6;
		};
	};
	UINT16 stick2Buttons;		// Left-most 4 bits are unused

	union {
		INT8 stick3Axes[6];
		struct {
			INT8 stick3Axis1;
			INT8 stick3Axis2;
			INT8 stick3Axis3;
			INT8 stick3Axis4;
			INT8 stick3Axis5;
			INT8 stick3Axis6;
		};
	};
	UINT16 stick3Buttons;		// Left-most 4 bits are unused

	//Analog inputs are 10 bit right-justified
	UINT16 analog1;
	UINT16 analog2;
	UINT16 analog3;
	UINT16 analog4;

	UINT64 cRIOChecksum;
	UINT32 FPGAChecksum0;
	UINT32 FPGAChecksum1;
	UINT32 FPGAChecksum2;
	UINT32 FPGAChecksum3;

	char versionData[8];
};

/**
 * Structure for DS to robot control packets
 */
typedef struct {
	FRCControlData commonData;
	char userDefined[USER_CONTROL_DATA_SIZE];
	INT32 crcPad;
	INT32 crcChecksum;
} ControlData;
I never finished decyphering the robot to DS data, but here is what I think I know.

1 byte - ?
2 bytes - battery voltage
5 bytes -?
6 bytes - robot MAC address
14 bytes - ?
2 bytes - reply ID(ID of previous packet sent from DS)
936 bytes - user configureable data
4 bytes - crc pad
4 bytes - crc32

They use some weird data formating for some data. If it isn't simpy encoded data here are the conversions I have recorded.

Battery voltage (vb.net)
Code:
Dim batteryBytes = reader.ReadBytes(2)
        BatteryVoltage = Convert.ToDecimal(batteryBytes(0).ToString("x")) + (Convert.ToDecimal(batteryBytes(1).ToString("x")) / 100.0)
Team number (vb.net)
Code:
    Public Function ReadTeamNumber(ByVal reader As BinaryReader) As Integer
        Dim temp1 = reader.ReadByte()
        Dim temp2 = reader.ReadByte()
        Return temp1 * 100 + temp2
    End Function
DS/Comm version: ASCII enocded text

Alliance, 0x52 = 1, 0x42 = 2

Control byte - see DS to robot data structure

Notes:

If I remember correctly, the DS sends the full data structure even if the robot isn't replying. It just sets the disabled bit to 1. This could mean you don't have to implement the reply logic, but you would some saftey features.
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 21-10-2009 at 18:49.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-10-2009, 12:49
JimWright949's Avatar
JimWright949 JimWright949 is offline
The Owen Day of Seattle
AKA: Jim Wright
FRC #4542 (Titanium Talons)
Team Role: Mentor
 
Join Date: Sep 2003
Rookie Year: 2003
Location: Redmond, WA
Posts: 94
JimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to behold
Re: cRio to DS packet spec.

Eric,

Thanks this is what I needed.

-Jim
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DS -> PC Packet Description rfrank Programming 1 16-02-2009 15:03
New dashboard packet spec Ameya Programming 2 08-01-2004 19:59
sponsor packet AlbertW Fundraising 9 13-07-2003 05:22
sponsor packet AlbertW Computer Graphics 5 12-07-2003 07:27
Team packet? rollncoast General Forum 7 30-05-2002 07:14


All times are GMT -5. The time now is 05:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi