![]() |
Re: Using a DS to control a FRC robot
There are two choices for getting the images.
What I'd recommend is to put the camera on the external switch beside the cRIO. With that, you can make direct requests to the camera requesting a JPEG. The Axis website documents the syntax of the request -- it is part of the VAPIX API. The way the camera has been used the last few years is to put it behind the cRIO soft-switch. The command to the camera is then made on the cRIO, and the contents are retransmitted to the DS. There is actually a third way, involving making a pass-thru for the cRIO TCP stack, but again, I'd suggest the first approach. Greg McKaskle |
Re: Using a DS to control a FRC robot
For the system disable, I would suggest a deadman using the L button, so the robot is only enabled while the L button is pressed.
|
Re: Using a DS to control a FRC robot
so something like this:
Code:
while(keysDown() & KEY_L) { |
Re: Using a DS to control a FRC robot
No, not quite.
You still want to *communicate* with the robot regardless of its state. Just use the L key to determine whether the robot is enabled or not. |
Re: Using a DS to control a FRC robot
or then:
Code:
while (1) { //in nds programming, while (1) loops are common |
Re: Using a DS to control a FRC robot
Could it be that the driver station simply sends a flattened string of this datatype?
![]() |
Re: Using a DS to control a FRC robot
Quote:
The packet needs to be sent to port 1110 on the robot; the standard DS does this every 20 ms. The robot->DS packet is quite different. I'll post the full info once I've double-checked it in my Python implementation. |
Re: Using a DS to control a FRC robot
Well, here's what I've guessed so far:
name – datatype – length (bytes) battery – sgl – 4 dsDigitalOut – u8 – 1 updateNumber – u8 – 1 userDataHigh – string – 0<980* userDataHighLength – i32 – 4 userDataLow – string – 0<980* userDataLowLength – i32 – 4 errorData – string – 0<980* errorDataLength – i32 – 4 subtotal: 18 * the length of userDataHigh + userDataLow + errorData may be no greater than 980 bytes. total: 980 + subtotal = 998 I know the total SHOULD be 1024, so this leaves 26 bytes unaccounted for. |
Re: Using a DS to control a FRC robot
as far as a protocol for controlling the robot, what would you suggest?
my thoughts are sending signals like "f" for forward, etc. |
Re: Using a DS to control a FRC robot
1 Attachment(s)
Quote:
It's really easy to make. (I've attached a LabVIEW implementation) |
Re: Using a DS to control a FRC robot
Quote:
|
Re: Using a DS to control a FRC robot
ok, can you please include the code in line-based format? i cannot read labview files or code
|
Re: Using a DS to control a FRC robot
It's right on the wikipedia page.
Code:
#define MOD_ADLER 65521 |
Re: Using a DS to control a FRC robot
Quote:
DS Dst Port 1150 1024 bytes (1152 if setUserDsLcdData() called) Sent immediately after DS packet received (in response) 0x0: current control byte (echoed copy of FRCCommonControlData.control) 0x1: Battery voltage (integer portion in BCD) 0x37 if no code 0x2: Battery voltage (fractional portion in BCD) 0x37 if no code 0x3: DS Digital outputs 0x4-0x7: ? 0x8-0x9: teamID (big endian integer) 0xa-0xf: cRIO MAC address, in order, as bytes (e.g. 00,80,2f,11,4d,ac) 0x10-0x17: FPGA version? "06300800" 0x18-0x1d: ? 0x1e-0x1f: current command packet index (echoed copy of FRCCommonControlData.packetIndex) 0x20: User Data update number (from setStatusData()) 0x21-0x24: User string length (32-bit big endian) 0x25 - X: User string - setStatusData() userDataHigh X+1 - X+4: Error string length (32-bit big endian) X+5 - Y: Error string - setErrorData() Y+1 - Y+4: User data length (32-bit big endian) Y+5 - 0x3d7: User data - setStatusData() userDataLow 0x3d8 - 0x3f7: overrideIOConfig() data (DSEIO status_block_t), followed by 0s 0x3f8 - 0x3fb: 0 0x3fc - 0x3ff: big endian CRC32 of 0-0x3ff (with 0 in CRC field) If setUserDsLcdData() called: 0x400: 0x9f 0x401: 0xff 0x402 - 0x47f: LCD contents, padded with spaces (0x20) split into 6 lines of 21 chars, top-to-bottom, left-to-right This is copy and paste from my work in progress doc on the subject. |
Re: Using a DS to control a FRC robot
For the DS->robot message, I'm uncertain about what to do with the last several elements in the FRCCommonControlData.
EDIT: to answer my own question, here are the values for the v20 image:
|
| All times are GMT -5. The time now is 23:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi