![]() |
Re: Using a DS to control a FRC robot
Quote:
I know it's receiving them, because I receive messages at exactly the rate I chose to send them. (This works down to 1 millisecond) I think I'm missing the system watchdog. I remember that the system watchdog works off TCP communication. That means if I want the robot to be enabled, I have to send another message in addition to these UDP datagrams. Do you have any information on that TCP message? |
Re: Using a DS to control a FRC robot
Quote:
|
Re: Using a DS to control a FRC robot
Hmmm.
Perhaps we could check with the owner of this thread. |
Re: Using a DS to control a FRC robot
1 Attachment(s)
Quote:
Here's the nonzero data that I get:
I'm assuming you've gotten this to work yourself. So, what I'm going to do is upload a message that I might send, and ask you to check if it is valid by recreating the message using the settings I provide: Alliance Position: Red1 Control state: Teleop disabled Team ID: 8557 all joystick axis and buttons are zero. |
Re: Using a DS to control a FRC robot
Having gotten it working myself, I'd recommend trying to use your code that fills up a packet to recreate a packet that you get back from the bot. If you can recreate the packet from the inputs that the packet is begin given entirely from "scratch", it should work. I found that I wasn't checksumming right, and that was causing problems.
There is no TCP traffic. |
Re: Using a DS to control a FRC robot
Quote:
The robot sends back a different packet than it receives, using information other than that in the packet that is received. Are you saying using this returned packet to fix my checksumming? I suppose I could also open up the "Start DS Communication" VI and see if my packets are being received properly. |
Re: Using a DS to control a FRC robot
I'm saying that you should try to regenerate a packet that you snoop from the DS. This would be an "offline" test. Snoop packet A, deduce what inputs were used to generate A (through either code or by hand), feed those to your code, and then check to see if A = what you generated. This will let you know if you can generate a valid packet from known inputs. And valid is easy to check, since you know what the packet should be if you do all your math right.
|
Re: Using a DS to control a FRC robot
Quote:
|
Re: Using a DS to control a FRC robot
So, I got everything in the packet correct, except for the last four bytes.
I think somethings wrong with my Alder-32 algorithm. (The checksum doesn't give me any hints to my error). ![]() I've tested it with very short samples, but I don't have anything large enough to roll over the divisor. Or, perhaps I'm wrong, and the DS actually uses CRC32. |
Re: Using a DS to control a FRC robot
Run your checksum including the last 4 bytes with the last 4 bytes set to 0.
|
Re: Using a DS to control a FRC robot
I've double-checked, and I am doing that.
Alder32 IS the correct checksum, isn't it? |
Re: Using a DS to control a FRC robot
I've uploaded my Python version to the RobotPy repo. http://git.tortall.net/cgit.cgi/RobotPy.git/tree/sim
The netcomm directory contains all the heavy lifting Python source:
The dspy directory implements a very basic driver station with tkinter GUI. Running robotcomm.py directly creates a very basic robot emulator (for testing). I've done basic (enable/disable, etc) interoperability testing between these and the official DS and cRIO. However, a number of things are still untested/unimplemented, such as enhanced IO, resynchronization (switching between official DS and dspy), etc. |
Re: Using a DS to control a FRC robot
Okay, guys.
I've checked my Adler32 algorithm and it functions correctly. I've successfully made the robot think my computer is running the Driver Station by sending it a series of DS I've saved. (This confirms that I'm saving the data correctly) I don't think I'm manipulating the data incorrectly, since it is such a simple manipulation. This leaves me with the conclusion that the DS does not use Adler32. (Adler32 is the checksum used by zlib) Then what does it use? It's been referred to as a Cyclic Redundancy Check. CRC32 would make sense. Is it the IEEE standard, or is it something else? |
Re: Using a DS to control a FRC robot
If I'm reading my code right, it's a CRC with the polynomial = 0xEDB88320L. I'm not nearly as certain about that as I am about other parts.
|
Re: Using a DS to control a FRC robot
Quote:
I believe http://www.libpng.org/pub/png/spec/1...CAppendix.html is a non-table-based version of the same algorithm, but I've not tested that implementation. |
| 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