Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Android Driver Station (http://www.chiefdelphi.com/forums/showthread.php?t=129073)

Chiller 25-05-2014 23:07

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1387363)
It's good that everything still works. Any idea why Dr.Gusta's didn't work? I have no idea.

With my iPhone version I have had it where the robot code gets initialized but the run code does not and also the RSL does not signal that it is enabled.

It was because the timing on sending the packets was off, it has to be exactly 0.02 seconds.

raystubbs 26-05-2014 09:31

Re: Android Driver Station
 
Quote:

Originally Posted by Chiller (Post 1387371)
With my iPhone version I have had it where the robot code gets initialized but the run code does not and also the RSL does not signal that it is enabled.

It was because the timing on sending the packets was off, it has to be exactly 0.02 seconds.

Thanks for the information, I'll try to fix this.

raystubbs 26-05-2014 09:33

Re: Android Driver Station
 
I got the video to work, I used dmaciel10123's idea to get it to work, it may not be very fast, I have no idea how it will work since I have only tested it on an emulator. Feedback is appreciated.

Ben Wolsieffer 27-05-2014 21:20

Re: Android Driver Station
 
I submitted a pull request that should make it easier to allow people to work on your code. It adds a .gitignore file that ignores the Eclipse build directory and auto-generated files. This makes it so only changes to code and other important files actually show up in the commit so people do not need to merge in a bunch of minor changes each time you push to the repo.

I hope you consider this. Thanks, Ben.

jpkelly26 27-05-2014 22:08

Re: Android Driver Station
 
This is sweet! Thanks.

Installed successfully on Samsung Galaxy SIII running Android 4.3 and on a Motorola Xoom tablet running Android 4.1.2. Next step, get access to our robot!

guniv 28-05-2014 16:50

Re: Android Driver Station
 
Now that the iOS app is out, maybe work with them and see how they got features working? You guys are competing in different markets, so collaboration would help a lot. They've gotten video working on their end, apparently. Gonna have some team members pick up the app (our school is 1:1 tech on iPads) and see what they think.

guniv 09-06-2014 10:03

Re: Android Driver Station
 
This thread is quite dead. Ray's GitHub seems to be taken down as well.
In any case, I used this app with my Nvidia Shield and it's built in Gamepad Mapper this weekend at a carnival we were at this weekend, and drove around one of our stripped down chassis. I was also able to hand off the Shield to other people and let them drive, like the kid in this video.

dmaciel10123 09-06-2014 10:29

Re: Android Driver Station
 
Quote:

Originally Posted by guniv (Post 1389137)
This thread is quite dead. Ray's GitHub seems to be taken down as well.
In any case, I used this app with my Nvidia Shield and it's built in Gamepad Mapper this weekend at a carnival we were at this weekend, and drove around one of our stripped down chassis. I was also able to hand off the Shield to other people and let them drive, like the kid in this video.


The GitHub is still up, it's just at a different repo now.
https://github.com/raystubbs/Andrid-FRC-Driverstation

guniv 09-06-2014 10:36

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1389138)
The GitHub is still up, it's just at a different repo now.
https://github.com/raystubbs/Andrid-FRC-Driverstation

Oh! My bad. Thanks!

Chiller 09-06-2014 16:44

Re: Android Driver Station
 
Quote:

Originally Posted by guniv (Post 1387763)
Now that the iOS app is out, maybe work with them and see how they got features working? You guys are competing in different markets, so collaboration would help a lot. They've gotten video working on their end, apparently. Gonna have some team members pick up the app (our school is 1:1 tech on iPads) and see what they think.

Just released the native iPad version so make sure you update!

Chiller 09-06-2014 16:47

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1387406)
I got the video to work, I used dmaciel10123's idea to get it to work, it may not be very fast, I have no idea how it will work since I have only tested it on an emulator. Feedback is appreciated.

I just use a simple html document that loads the feed and if it times out then it displays a message, all with jQuery

Just load the html file into a string and replace {jquery} with the contents of a jquery library file and also replace {te} and {am} with teamNum / 100, teamNum % 100, and also replace width and height with the web views width and height and wallah!

Code:

<html>
        <head>
                <script type="text/javascript">{jquery}</script>
               
                <script type="text/javascript">
            var timeout;
           
                        $(function() {
                                $("#errordiv").click(reload);
                                $("#stream").click(reload);
                               
                                reload();
                        });
                       
                        function reload()
                        {
                                $("#error").text("Loading Camera...");
                               
                                $("#stream").attr("src", "http://10.{te}.{am}.11/mjpg/video.mjpg?resolution=640x480&fps=30");
               
                timeout = setTimeout(function() {
                    //Cam did not load
                                   
                    $("#error").html("Error Loading Camera<br/>Tap to Refresh");
                   
                    $("#stream").css({"display":"none"});
                    $("#errordiv").css({"display":"block"});
                }, 4000);
                               
                                $("#stream").load(function() {
                                        $("#stream").css({"display":"block"});
                                        $("#errordiv").css({"display":"none"});
                                 
                  clearTimeout(timeout);
                                }).error(function() {
                                        $("#error").html("Error Loading Camera<br/>Tap to Refresh");
                               
                                        $("#stream").css({"display":"none"});
                                        $("#errordiv").css({"display":"block"});
                       
                    clearTimeout(timeout);
                                });
                        }
                </script>
        </head>
        <body style="padding: 0; margin: 0;">
                <div id="errordiv" style="display: none; background: lightgray; height: 100%; text-align: center;">
                        <label id="error" style="position: relative; top: 40%;">Tap to refresh camera</label>
                </div>
               
                <img id="stream" width="{width}" height="{height}"/>
        </body>
</html>


m1506m 09-06-2014 19:59

Tried the app out tonight, I am able to connect and enable, but since we are set up for cheesy drive, and not tank, I can only go forward and backward. And after about a minute the connection turns off and I loose connection.

DavisC 21-06-2014 12:07

Re: Android Driver Station
 
After connecting to the Robot wifi and launching the app, does the app handle everything necessary with IP addresses (in other words, should it just work out of the box like that?)

guniv 21-06-2014 13:13

Re: Android Driver Station
 
Quote:

Originally Posted by DavisC (Post 1390639)
After connecting to the Robot wifi and launching the app, does the app handle everything necessary with IP addresses (in other words, should it just work out of the box like that?)

We've had to go in through Android's Wi-Fi settings and set the static IP ourselves.

raystubbs 23-06-2014 20:59

Re: Android Driver Station
 
Sorry for all the problems, some of them may have been caused by bandwidth taken by the video, which I haven't tested. I only have a kindle fire to test with and it worked perfect before I added the video code. I'm not in the U.S right now and don't have access to any robots. I will try to buy another device by the beginning of the school year, so I'll be able to debug for another device.

Reminder: This is an open source project, a pretty easy project, and my first android app. So anyone interested in trying their hand at android development this would be a good place to start.


All times are GMT -5. The time now is 07:18.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi