I have a question regarding controlling a robot view a web interface. Naturally, in competition, I would be unable to access this “control page” through a web browser. So, my question is, is it possible to render a webpage in the driverstation and use the driverstation to relay form data to the robot?
… is it possible …
So as an engineer you are constrained mostly by the laws of physics and available cash (1).
I think what you asked for is
Browser/Javascript <---> Driver Station <---> Robot
and I’ll posit that you could put an ActiveX control on the DS and have it fill the blanks in.
OTOH, I have to ask why? There will be pretty decent lag between the browser and the DS, so any real time control is going to be hard. And during a match, the DS/Robot are on a closed network, so you won’t be able to get to it from the outside.
Thanks!
(1) I used to say "laws of physics, time and cash; but a roboteer pointed out that going back or stopping time would break the physics part, so I shortened it.
You can render a web page in the dashboard, especially if the dashboard is a web browser. You can set the command line in the .ini file located in Public Documents\FRC\FRC DS Data Storage.ini. I’m not certain how to open a web page from a command line, but I suspect you can find a way.
Next would be to find a way to set network variables from a web page. This seems pretty useful for choosing or influencing auto.
Greg McKaskle
Yeah, we used Chrome as our Dashboard this year. (Mostly just to grab some stuff from the camera and draw on top of it)
Web config baked in to the cRIO would be nice. I’ve seen some projects around here that used the HTTP server built in to Boost to do this in C++. There’s probably a Java HTTP server that will run on J2ME as well.
Side note:
We also used a browser to debug our robot during build. A server running on a development machine served a page and had WebSocket capabilities. It created a tunnel between the websocket and a UDP connection to the robot, making it easy to post things from the robot to the laptop and vice versa. The intermediate step was done mostly because we lacked a HTTP server for the robot and this was the second best and first easiest solution. All of these things make me think this route is absolutely possible
As others have mentioned, it’s possible, but I think SmartDashboard will provide better functionality vs setup effort when it comes to sending simple data.
You could set up an Apache server with PHP that had a serial connection to the robot. I would make it so that there was a python script (just because I like python and it’s I/O) constantly checking a file and outputting it’s contents to serial, while you have a PHP file that javascript could “call”, that would write what the javascript told it to, to the file that python was checking. You could probably do it all of over PHP (or all python), but I am not sure how. Smart dashboard is probably easier.