![]() |
We got Sockets working
http://www.youtube.com/watch?v=N0xvqxRKCKg
What we have is the computer with the driver station has the PS3 controller connected to it. We then get input from the left stick of the joystick to the CRIO with the regular Joystick Class. Now to send that to the 2nd computer, we use java sockets with the CRIO running the socket server code and the computer running the client socket code. So far, we are just experimenting with sockets with last years robot. |
Re: We got Sockets working
Neat!
Your custom dashboard looks a lot like the Smart Dashboard - for what reasons did you decide to make your own, instead of using the Smart Dashboard? |
Re: We got Sockets working
Is that possible to do with SmartDashboard? I'd really love to get those bars for joysticks and the Gyro thing as well!
|
Re: We got Sockets working
Wow. I've been trying to lean how to do that in LabView. Since I switched over to java I still wonder how to do that. Could you explain in detail how you got the comms to work?
|
Re: We got Sockets working
Absolutely that's possible with the SmartDashboard.
The SmartDashboard package is edu.wpi.first.wpilibj.smartdashboard. Data sent has a name and a value. The name is used to tie a set of values to a certain widget - if you send "Heading" as 90, then set up a widget to listen to that key, then subsequent sendings of "Heading" will go straight to that widget. You can send booleans, ints, doubles, and Strings, as well as any class that implements SmartDashboardData. You can even make your own SmartDashboardData-implementing class, though doing so is a bit complicated. You can make your own widget to display data received any way you like. |
Re: We got Sockets working
Quote:
How do you make the widgets, though? |
Re: We got Sockets working
http://firstforge.wpi.edu/sf/wiki/do...iki/Extensions
Great set of tutorials on how to write a widget. The SmartDashboard itself can be downloaded from the same project, under File Releases. |
Re: We got Sockets working
Quote:
|
Re: We got Sockets working
Mind sharing how to use sockets im trying to send my vision tracking data to our robot with no luck :(
|
Re: We got Sockets working
Quote:
|
Re: We got Sockets working
Quote:
|
Re: We got Sockets working
Quote:
|
Re: We got Sockets working
Quote:
|
Re: We got Sockets working
Here's one quick example:
Code:
// connect to “echo” server: |
Re: We got Sockets working
|
Re: We got Sockets working
This is more for derek but when i send data to my robot using this code http://pastebin.com/x2KZepNR that i made i get a thread error and null pointer any ideas?
here is error Code:
[cRIO] Default disabled() method running, consider providing your own |
Re: We got Sockets working
That stack trace suggests that the variable "you" is null at line 40. But it looks like that would only happen if acceptAndOpen() throw an exception, and no exception was printed in the output you showed.
An aside about NullPointerExceptions - for how common these are, they can really only be created by:
For now I suggest adding code that explicitly checks for "you" being null or not. I hope this helps track down the bug. |
Re: We got Sockets working
Ok i did figure it out and i can recive data but i see a bunch of exceptions being thrown even know i can send and recive data. any idea why?
|
| All times are GMT -5. The time now is 13:02. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi