![]() |
Re: FRC Java TCP client
I am actually now going to use a web server. Since I am using dclib, a web server is a no-brainer and only requires like 5 lines of code! I think I'll use the HttpClient in the cRIO from there! That should work just perfectly. It is the lag that I think of, though :(
The nice thing, however, is that I can now send POST messages and "inject" values into the serve table. If one table is not good enough, I can also spawn multiple servers with multiple ports too! |
Re: FRC Java TCP client
A web server could be interesting. We just got done experimenting with algorithmic JSON interpretation at work, and it is really promising for fast network comms.
|
Re: FRC Java TCP client
4 Attachment(s)
I think I am just about done! I have even written a web interface, so the drivers can access the stored variables! It is really fast too and uses 0.7% CPU of one core on my i3 1.4GHz.
I have attached some screenshots. Also, I use a RAM cache (which is written in STL), so page loads are almost instant! The code (as usual), is in my GitHub "Other" repositiory, here I also have my server up at the moment, here. |
Re: FRC Java TCP client
Quote:
|
Re: FRC Java TCP client
The web server implementation was extremely simple. If you noticed, I am using DLib. DLib adds some of the simplest socket APIs you could imagine!
PHP Code:
|
Re: FRC Java TCP client
I was thinking about making android apps for my team to do debugging and testing next year. But I don't know what the delay should be for the client to ask the robot server for information about sensors and motors.
|
Re: FRC Java TCP client
It ends up that my program is designed flexibly so you can run it on any device with a web browser. It requires HTML5 for some nifty features, though. However, I have designed it for webkit-based devices because cross-browser adds tons of unnecessary code when adding display things, like animations, visual ques, etc.
I just generated a CMakeLists.txt, so just copy-and-paste the code into your platform, run make clean, cmake ., and then make! You can then run the project. I also have removed a great portion of DLib functionality because it is unnecessary! I kept getting X11 errors because I didn't link it. However, I was using the preprocessor to not compile that code, so I don't know what is up with that! I am still developing this appication. However, if you want to download and compile it in Linux, here's my compile script: PHP Code:
Enjoy! I will roll out Java and C++ APIs when I have the ability to test them! |
| All times are GMT -5. The time now is 22:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi