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)

raystubbs 25-04-2014 10:53

Android Driver Station
 
Has anyone written a FRC Driverstation app for Android yet?
I've just written one, all that lacks is testing. Wondering if anyone else has done the same.

m1506m 25-04-2014 22:17

Hey keep us updated on this. I read about the I driver station app, and would love to see the android version. I'll help beta test if you'd like.

pyroslev 26-04-2014 09:09

Re: Android Driver Station
 
Like to Beta test it as well. Since seeing the RobotOpen and Sasquatch system in use, curious to try any new gen DS software.
That and I've got 4 Android devices across the spectrum.

SRaymond 26-04-2014 11:34

Re: Android Driver Station
 
If a beta tester is needed i have two Android 4 devices, tablet and phone

raystubbs 26-04-2014 11:53

Re: Android Driver Station
 
I should be able to test it on Monday, April 28, if all works as expected I will send the apk file.

Fletch1373 27-04-2014 12:37

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1378433)
Has anyone written a FRC Driverstation app for Android yet?
I've just written one, all that lacks is testing. Wondering if anyone else has done the same.

Is this open-source? I'd love to get involved in it. I have 2 android 4.x devices(tablet and phone), so I can help test and/or develop.

raystubbs 29-04-2014 11:00

Re: Android Driver Station
 
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

404'd 01-05-2014 13:55

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1380388)
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

Please keep us updated on this, I'm also interested and can help test.

GBilletdeaux930 01-05-2014 15:15

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1380388)
I found a bug I need to fix, after that I could send you the source code if you'd like. One of the main problems I've had is the video streaming. Android is supposed to support rtsp mp4 video streaming but I haven't got it to work.

The bug I am currently working on is android's permissions and network restrictions, my code works running in a java VM on PC (both Windows and Linux), however androids permissions and limits are killing me. I hope to have this fixed in a few days.

If you open source this we can help you out with some of these issues. There are a lot of experienced devs on CD that would be willing to help. I don't know how much experience you have so I apologize if I underestimate you, but if you need help getting the code somewhere the community can contribute, PM me and I'll help you out.

dmaciel10123 05-05-2014 09:58

1 Attachment(s)
Attachment 16977 screenshot of my device info. Willing to help in any way possible.

raystubbs 08-05-2014 13:05

Re: Android Driver Station
 
I got it to work, now I'll make some UIs for your different screen sizes then release the apk (hopefully tomorrow).

m1506m 08-05-2014 15:31

Cool, your awesome.

m1506m 08-05-2014 20:56

Our team is having our end of season banquet this weekend. Would be cool to show it off there.

SRaymond 08-05-2014 23:10

Re: Android Driver Station
 
I have a Droid Razr HD phone and Nexus 7 gen 1 Tablet if that helps for the sizing

lgphoneeric 09-05-2014 17:41

I have many android devices if you want more testing help

raystubbs 10-05-2014 20:05

Re: Android Driver Station
 
So the app is here http://slideme.org/application/andro...riverstation01 but I'm not sure you'll be3 able to download it yet, so I'm setting up a github repository to be quicker, I'll post a link when finished. Please remember that:

1. This is my first android app, so don't laugh.

2. This is just a prototype, so the UIs will not be very nice and there will probably be a lot of bugs because of the junky design of the code.

Also, the buttons were not working so I changed some code and haven't been able to test it because I don't have access to a robot, so if you test it, please let me know if they work or not.

raystubbs 10-05-2014 20:39

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1384332)
So the app is here http://slideme.org/application/andro...riverstation01 but I'm not sure you'll be3 able to download it yet, so I'm setting up a github repository to be quicker, I'll post a link when finished. Please remember that:

1. This is my first android app, so don't laugh.

2. This is just a prototype, so the UIs will not be very nice and there will probably be a lot of bugs because of the junky design of the code.

Also, the buttons were not working so I changed some code and haven't been able to test it because I don't have access to a robot, so if you test it, please let me know if they work or not.

So here is the repository link https://github.com/raystubbs/Android-Driverstation, please let me know what works and what does not.

lucas.alvarez96 10-05-2014 21:46

Re: Android Driver Station
 
The app opens in my phone with no problems! (Moto G) I'll try it out on the robot whenever I get the chance. Are you planning on uploading the source to the repo?

dmaciel10123 10-05-2014 21:56

App opens fine, but I'm not seeing anywhere for me to be able to configure any settings. How do we connect it to our robot?

lucas.alvarez96 10-05-2014 21:59

Re: Android Driver Station
 
I'd suppose you'd just connect to the robot's network and enable...

dmaciel10123 10-05-2014 22:46

Quote:

Originally Posted by lucas.alvarez96 (Post 1384355)
I'd suppose you'd just connect to the robot's network and enable...

The robot is set to a specific ip, 10.xx.xx.2, where xxxx is the team number. On a local network, devices cannot communicate unless the share a root ip, so the control device needs to be set to 10.xx.xx.y, where y is any number 1-the Max number the bridge allows. This allows the controller and robot to communicate. The driver station provided by FIRST does this for you when you enter your team number. So either the app would have to have a preset team number that it sets the phone to and you simply adjust the ip the robot is on, or you change the ip of the controller to fit.

lucas.alvarez96 10-05-2014 22:49

Re: Android Driver Station
 
:ahh:
Long time since I last opened the DS...my bad

raystubbs 10-05-2014 23:21

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1384361)
The robot is set to a specific ip, 10.xx.xx.2, where xxxx is the team number. On a local network, devices cannot communicate unless the share a root ip, so the control device needs to be set to 10.xx.xx.y, where y is any number 1-the Max number the bridge allows. This allows the controller and robot to communicate. The driver station provided by FIRST does this for you when you enter your team number. So either the app would have to have a preset team number that it sets the phone to and you simply adjust the ip the robot is on, or you change the ip of the controller to fit.

I made my app so that all you have to do is configure the IP of the driverstation and the app will derive the CRIO's IP from that, so first go to the device's wifi settings and long-click the robot access point. Next enable static IP and set it to 10.xx.yy.6, set the netmask to 255.255.255.0 and thats it.

dmaciel10123 10-05-2014 23:26

Quote:

Originally Posted by raystubbs (Post 1384369)
I made my app so that all you have to do is configure the IP of the driverstation and the app will derive the CRIO's IP from that, so first go to the device's wifi settings and long-click the robot access point. Next enable static IP and set it to 10.xx.yy.6, set the netmask to 255.255.255.0 and thats it.

Ah, alright. Awesome. Thanks! I'll probably try it on Monday. That's when I'll next get my hands on a robot. I'm assuming the Joystick would be on USB 1 and the axes would be 1 and 2?

raystubbs 10-05-2014 23:44

Re: Android Driver Station
 
Quote:

I'm assuming the Joystick would be on USB 1 and the axes would be 1 and 2
That's right, also if there is an error don't forget that android exits an app with the back button, pushing home would just pause the app, so if you need to restart the app exit it with the back button.

raystubbs 10-05-2014 23:47

Re: Android Driver Station
 
Quote:

Originally Posted by lucas.alvarez96 (Post 1384350)
The app opens in my phone with no problems! (Moto G) I'll try it out on the robot whenever I get the chance. Are you planning on uploading the source to the repo?

Sorry for the lack of code, in debugging the app I let the code get REALLY unorganized, to give me some time to organize and document it, then I will release it. I don't know how long this will take, since it depends on the time I have to work on it and how busy I am.

dmaciel10123 11-05-2014 10:00

Quote:

Originally Posted by raystubbs (Post 1384376)
That's right, also if there is an error don't forget that android exits an app with the back button, pushing home would just pause the app, so if you need to restart the app exit it with the back button.

Alright. I'm gonna try it on a simple drivetrain before anything serious. I'll post the results as soon as I have them.

raystubbs 12-05-2014 12:50

Re: Android Driver Station
 
I just tested it, the buttons still don't work sorry. I'll work on this.

Andrew Rudolph 12-05-2014 18:52

Re: Android Driver Station
 
This is shaping up nicely, it'd be awesome if it eventually gets support for a bluetooth or usb controllers so it could be used for driver practice with real sticks.

lgphoneeric 12-05-2014 19:37

I just tried it on our competition robot and it worked right away. The only thing I would like to see added would be a second joystick because with a mecanum drive like we have, I can't rotate without it. Very nice app though!

dmaciel10123 12-05-2014 21:11

Tried it on our bot from last year, worked great except for difficulty turning. I think a second joystick on the screen would be great so we could use drive modes that require two.

Chiller 12-05-2014 22:26

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1384764)
Tried it on our bot from last year, worked great except for difficulty turning. I think a second joystick on the screen would be great so we could use drive modes that require two.

I am actually working on bluetooth control but I was just going to have two phones connect so you could have two people controlling the robot!

raystubbs 13-05-2014 10:13

Re: Android Driver Station
 
I'm rewriting the app with a more readable structure, when I'm finished I'll open source it and anyone can help add those extra features. Also you may have noticed how empty the ui is on large devices, once I get video working I want to put it in the background of the driving view.

raystubbs 15-05-2014 16:38

Re: Android Driver Station
 
I added another joystick and got the buttons to work, but I'm not sure if it uploaded correctly so let me know if it is the same as before. Here is the link so you don't have to go back: https://github.com/raystubbs/Android-Driverstation


Also I haven't tested the second joystick since we don't have tank drive on or robot, so let me know if that works.

m1506m 15-05-2014 16:53

Getting a, there is a problem parsing the package, error when trying to install.

cad321 15-05-2014 17:00

Re: Android Driver Station
 
Quote:

Originally Posted by m1506m (Post 1385588)
Getting a, there is a problem parsing the package, error when trying to install.

I too am getting the error.

m1506m 15-05-2014 17:10

Btw, thanks again for your work on this, and for sharing with the CD community.

markmcgary 15-05-2014 17:19

Re: Android Driver Station
 
Quote:

Originally Posted by cad321 (Post 1385589)
I too am getting the error.

Is an older version already installed? If so, uninstall the old and then install the new.

Uniwersel 15-05-2014 17:36

Re: Android Driver Station
 
Quote:

Originally Posted by markmcgary (Post 1385593)
Is an older version already installed? If so, uninstall the old and then install the new.

I tried doing this, still getting the same exact error.

raystubbs 15-05-2014 18:11

Re: Android Driver Station
 
Quote:

Originally Posted by m1506m (Post 1385588)
Getting a, there is a problem parsing the package, error when trying to install.

Sorry about this, I forgot to change the version number before compiling the app so I tried doing it manually. This is probably what caused the error. I'll recompile it and re-upload it as soon as I can (I don't always have internet access at home so that might be tomorow at school or it might be tonight), I'll post whenever this happens to let you know.

raystubbs 16-05-2014 00:08

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1385604)
Sorry about this, I forgot to change the version number before compiling the app so I tried doing it manually. This is probably what caused the error. I'll recompile it and re-upload it as soon as I can (I don't always have internet access at home so that might be tomorrow at school or it might be tonight), I'll post whenever this happens to let you know.

I re-uploaded the app, but I'm still learning how to use git, so I may have made a mistake in the upload, let me know if I have please. Here is the link: https://github.com/raystubbs/Android...on/tree/master

MDAWG25 16-05-2014 00:11

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1385674)
I re-uploaded the app, but I'm still learning how to use git, so I may have made a mistake in the upload, let me know if I have please. Here is the link: https://github.com/raystubbs/Android...on/tree/master

I can confirm it installs, and runs, on Android 4.4.2 Kitkat. Phone model: HTC One XL

Great job on the app, by the way.

MDAWG25 16-05-2014 00:21

Re: Android Driver Station
 
As I can only offer suggestions, I have no experience with Android apps, offer a settings page to setup joystick configuration. So instead of two separate joysticks, one joystick with 2 axes. (like an xbox controller)

raystubbs 16-05-2014 09:58

Re: Android Driver Station
 
Quote:

Originally Posted by MDAWG25 (Post 1385678)
As I can only offer suggestions, I have no experience with Android apps, offer a settings page to setup joystick configuration. So instead of two separate joysticks, one joystick with 2 axes. (like an xbox controller)

Thanks, thats a good suggestion, I should have thought of it since that is how all of the other joysticks work.

guniv 16-05-2014 10:10

Re: Android Driver Station
 
Going to try and test this out later. You should look into adding support for controllers. Would mean we still have full control but don't have to haul a laptop around.

raystubbs 16-05-2014 13:20

Re: Android Driver Station
 
Quote:

Originally Posted by guniv (Post 1385718)
Going to try and test this out later. You should look into adding support for controllers. Would mean we still have full control but don't have to haul a laptop around.

I did a little research on adding support for a physical joystick, it seems pretty easy but you need an OTG cable. I just ordered one, so hopefully by the end of summer vacation (August) the app will support a physical joystick.

Andrew Rudolph 16-05-2014 13:41

Re: Android Driver Station
 
Another temporary solution for controllers is using the sixaxis app,
https://play.google.com/store/apps/d...iscontroll er

This allows you to define areas that correlate to button presses on a six-axis PS3 controller, of course you have to root the device and you have to use a six-axis so if you can get OTG cable support it would be epic.

raystubbs 16-05-2014 13:57

Re: Android Driver Station
 
Quote:

Originally Posted by Andrew Rudolph (Post 1385762)
Another temporary solution for controllers is using the sixaxis app,
https://play.google.com/store/apps/d...iscontroll er

This allows you to define areas that correlate to button presses on a six-axis PS3 controller, of course you have to root the device and you have to use a six-axis so if you can get OTG cable support it would be epic.

Thanks for the info, it could prove useful, however I am developing on a Kindle Fire 2nd gen. (which doesn't have Bluetooth) and haven't gotten around to figuring out how to root it. Also I would like the app to be available to those who do not want to root their device.

Joel Glidden 16-05-2014 14:01

Re: Android Driver Station
 
What about a Bluetooth interface for a PS3 controller or Wiimote? I know these things have been done on the Android platform already. I wonder if there's any open source code to pull from.

raystubbs 16-05-2014 14:05

Re: Android Driver Station
 
Quote:

Originally Posted by Joel Glidden (Post 1385769)
What about a Bluetooth interface for a PS3 controller or Wiimote? I know these things have been done on the Android platform already. I wonder if there's any open source code to pull from.

It would be awsome to eventually add support for these devices, but really I'm not that good a programmer yet, this is actually my first android app, and I've never worked with bluetooth before. Hopfully when I open source the app some of you at CD can help me out with some of this.

guniv 16-05-2014 22:02

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1385756)
I did a little research on adding support for a physical joystick, it seems pretty easy but you need an OTG cable. I just ordered one, so hopefully by the end of summer vacation (August) the app will support a physical joystick.

OTG cables are absolutely awesome, I can transfer photos from my DSLR to my tablet and post to our team's FB page in a minute.

I was thinking more Nvidia Shield, though, which was given away to many teams for free at Champs as I understand it. Big market for you there. I own one personally and it'd be awesome to control the robot from it. For now I can use the Shield's gamepad mapper to use it which should work just as well.

There's a lot of potential here. Looking forward to seeing where this goes.

raystubbs 16-05-2014 22:31

Re: Android Driver Station
 
Quote:

Originally Posted by guniv (Post 1385890)
OTG cables are absolutely awesome, I can transfer photos from my DSLR to my tablet and post to our team's FB page in a minute.

I was thinking more Nvidia Shield, though, which was given away to many teams for free at Champs as I understand it. Big market for you there. I own one personally and it'd be awesome to control the robot from it. For now I can use the Shield's gamepad mapper to use it which should work just as well.

There's a lot of potential here. Looking forward to seeing where this goes.

I cannot guaranty it since I know nothing about the Shield, but I just looked it up and if I'm guessing correctly and if the Shield runs android, than the same code to add support for an external joystick will also work perfectly for the Shield joystick.

guniv 17-05-2014 18:29

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1385896)
I cannot guaranty it since I know nothing about the Shield, but I just looked it up and if I'm guessing correctly and if the Shield runs android, than the same code to add support for an external joystick will also work perfectly for the Shield joystick.

Awesome.

Today we took two of our robots down to a large fair for kids and let them check out the robots. Our smaller robot that was just a chassis was controlled by your app the entire day from my Shield. I wasn't there as I had another robotics thing going on a short distance away, but I heard of no problems with it. Makes it easy for us to do this since we don't have to haul a laptop around, and even has better battery.

raystubbs 18-05-2014 18:20

Re: Android Driver Station
 
I added a bit of code for external joystick or Shield joystick support, completely untested as I have no joystick nor any means to connect a joystick to my device. If the code works it will only support the joysticks and not the buttons. I kind of doubt that this will work, but please let me know if it does.
Same link: https://github.com/raystubbs/Android-Driverstation.

raystubbs 20-05-2014 13:15

Re: Android Driver Station
 
Anyone who has tried this app please PM me with your device model, OS version, and any comments, complaints, or recomendations. I would like to know which devices the app works on and how well it works. Thanks.:confused:

raystubbs 21-05-2014 08:33

Re: Android Driver Station
 
Sorry, in the previous version of the app the buttons did not work on a normal sized phone screen. Please don't use this version, it is pretty unpredictable. I fixed the error and uploaded the app to the same repo.

raystubbs 22-05-2014 17:14

Re: Android Driver Station
 
I just worked out the last major bug in the open source version, I opened up a new repository. It has all of my code and the binary file. Let pe know if the binary doesn't work, I just copied and pasted the UI's from the prototype version so they may have bugs.

Note: Though the UI on larger screens has a video switch, it does not do anything yet. If anyone wants to help on this project, getting the video to work would be great.

Spok 22-05-2014 22:28

Re: Android Driver Station
 
I tried both of the versions, and I'm having trouble installing the .apk onto my devices. I also have not had any previous versions of this app. I have a Samsung Galaxy S4 running Android 4.4.2 and I get an error in parsing the package. Do you have any suggestions?

raystubbs 23-05-2014 09:51

Re: Android Driver Station
 
Quote:

Originally Posted by Spok (Post 1387030)
I tried both of the versions, and I'm having trouble installing the .apk onto my devices. I also have not had any previous versions of this app. I have a Samsung Galaxy S4 running Android 4.4.2 and I get an error in parsing the package. Do you have any suggestions?

You get a parsing error on both versions? Others have installed it on their galaxys. Do you have "Allow applications from unknown sources" enabled? This needs to be enabled if it is not.

dmaciel10123 23-05-2014 10:32

With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.

raystubbs 23-05-2014 11:03

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387071)
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.

Thanks for letting me know, this should be easy to fix.

raystubbs 23-05-2014 11:33

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387071)
With the newest version (from both repos) the app crashes when I try to launch it.

Here's the log from the Binary from the Source repo:
05-23 10:35:48.082 E/AndroidRuntime(4855): java.lang.RuntimeException: Unable to resume activity {com.example.driverstation/com.example.driverstation.MainActivity}: java.lang.NumberFormatException: Invalid int: "30-80"

Also, I downloaded the source and am going to look at getting the video feed working for you.


I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have? If it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

raystubbs 23-05-2014 11:40

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1387080)
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I tried the app on and emulator and it works fine. I'm actually baffled by this error being in both apps since in the second one I don't have any integers or any code that used integers. But in the first version I can see where this error could come from, but since I don't get the error I can't investigate.

Maybe it is a version error, try uninstalling the app, and re-downloading it maybe? If you do this I would suggest redownloading the second app (Android-FRC-Driverstation).

dmaciel10123 23-05-2014 11:40

Quote:

Originally Posted by raystubbs (Post 1387080)
I don't get this error, could you try re-installing the app. Sorry, I don't know what else to do since I can't work on a problem I don't have. On second thought, what type of device do you have, if it is a problem with the UI that it could be specific to the screen-size. I will launch the app on an emulator of a smaller screen and see what I can find out.

I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

raystubbs 23-05-2014 12:24

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387082)
I'll reinstall again and check for any errors. I have a Samsung Galaxy S3.

Edit: I think it may be because of the network I'm connected to. The IP I was assigned had 3 characters in the 3rd portion of the IP. I changed my network settings and it was able to start normal.

O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

dmaciel10123 23-05-2014 14:25

Quote:

Originally Posted by raystubbs (Post 1387085)
O, yea, that would do it, it's strange to have characters in an ipv4 IP (I didn't anticipate it), I have only ever heard of them in ipv6 and mac addresses.

Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

raystubbs 23-05-2014 14:38

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387103)
Sorry not characters, integers. The IP was xx.xx.xxx.xx instead of xx.xx.xx.xx. The three integers being in the 3rd quarter of the IP messed it up.

Also, I was messing around and added some simple code that may be able to display video but I can't test it yet because I don't have a robot or IP camera. I'll test it probably tomorrow at BattleCry.

Could you upload the code to the repo please? I have access to a robot right now and could test the code.

dmaciel10123 23-05-2014 15:11

Quote:

Originally Posted by raystubbs (Post 1387106)
Could you upload the code to the repo please? I have access to a robot right now and could test the code.

Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

raystubbs 23-05-2014 15:44

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387108)
Sure. Give me a few minutes so I can get my hands on a computer. I've been using my phone all day.

Edit: wow okay whoops. I dun goofed. Just tried opening it with the code I added and it crashed immediately. I'll keep working on it.

Are you using VideoView? What I've tried is:

Code:

video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16)  //"rtsp://10.xx.yy.11/axis-media/media.3gp"
        +"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp"; 

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();

Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

dmaciel10123 23-05-2014 16:11

Quote:

Originally Posted by raystubbs (Post 1387114)
Are you using VideoView? What I've tried is:

Code:

video = (VideoView)findViewById(R.id.video);

// Set uriString to "rtsp://10.xx.yy.11/axis-media/media.3gp"
String uriString = "rtsp://" + "10." + Integer.toString((addr & 0xff0000)>>16)  //"rtsp://10.xx.yy.11/axis-media/media.3gp"
        +"."+ Integer.toString((addr & 0xff00)>>8) + ".11/" + "axis-media/media.3gp"; 

video.setVideoURI(Uri.parse(uriString));
video.requestFocus();
video.start();

Nothing happens for a while, but then a dialog comes up and says that it can't play the video.

I'm actually trying to load the image that the Axis Camera saves at image.jpg and set it as the background at about 30 fps

raystubbs 23-05-2014 16:18

Re: Android Driver Station
 
What is the full uri (path) of the image file? I thought of using the image before. I knew the axis had one I just didn't know where it was.

dmaciel10123 23-05-2014 16:33

Re: Android Driver Station
 
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/And...-Driverstation
I didn't upload a new binary, just the code.

raystubbs 23-05-2014 16:54

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387126)
I'm pretty sure it's just http://10.xx.xx.11/image.jpg
I may be wrong, but I do have a code that theoretically will work. I just can't test it yet. I uploaded the code to a forked repo at https://github.com/crazyman10123/And...-Driverstation
I didn't upload a new binary, just the code.

Thanks, I'll try this when I get a chance, I no longer have access to our robot.

I do have a question though, does it work to put your code in the start() method of a thread? I have only ever put code in the run() method.

dmaciel10123 23-05-2014 17:04

I probably should change it to the run() method because the way it is right now, start() would never end. I wasn't even paying attention to that haha thanks.

Edit: I fixed the start/run methods, and uploaded the changes to the repo. I'll also be trying it tomorrow at BattleCry when I have access to our bot.

Dr.Gusta 23-05-2014 19:16

Re: Android Driver Station
 
I have a Galaxy S4 and I don't have the option to set my subnet mask and it is asking me for a lot more information. Like Default Gateway, DNS, etc when I try to set up a static IP as instructed.

Ben Wolsieffer 23-05-2014 19:35

Re: Android Driver Station
 
I got it installed on my tablet (an HP Touchpad running CyanogenMod), and the layout looks fine. I haven't been able to test it on our bot yet since we were busy packing for BattleCry :).

Dr.Gusta 23-05-2014 20:05

Re: Android Driver Station
 
Quote:

Originally Posted by Dr.Gusta (Post 1387149)
I have a Galaxy S4 and I don't have the option to set my subnet mask and it is asking me for a lot more information. Like Default Gateway, DNS, etc when I try to set up a static IP as instructed.

Okay so I got this figured out and got connected to the robot but the controls are unresponsive. When I enable the robot in the app the compressor comes on so I know something is happening but I can not control the robot at all. The status light also never tells me the robot is enabled.

raystubbs 23-05-2014 20:55

Re: Android Driver Station
 
Quote:

Originally Posted by Dr.Gusta (Post 1387161)
Okay so I got this figured out and got connected to the robot but the controls are unresponsive. When I enable the robot in the app the compressor comes on so I know something is happening but I can not control the robot at all. The status light also never tells me the robot is enabled.

When did you download the app? It has been changed quite a bit since the first upload. If anyone else has a problem like this please let us know.

Edit: Also, if the robot was not enabled than the compressor would not work would it?

Dr.Gusta 23-05-2014 21:04

Re: Android Driver Station
 
I am running the most up to date version and the compressor does not come on until I hit enable but nothing else works.

raystubbs 23-05-2014 21:09

Re: Android Driver Station
 
Quote:

Originally Posted by Dr.Gusta (Post 1387170)
I am running the most up to date version and the compressor does not come on until I hit enable but nothing else works.

I'll look into it, it is strange that it wouldn't work, I was just using it. Are you using a phone or tablet? Large (5-7"), normal (3-4"), or small (<3")?

Dr.Gusta 23-05-2014 21:46

Re: Android Driver Station
 
Quote:

Originally Posted by raystubbs (Post 1387173)
I'll look into it, it is strange that it wouldn't work, I was just using it. Are you using a phone or tablet? Large (5-7"), normal (3-4"), or small (<3")?

I am using a Galaxy S4

raystubbs 23-05-2014 23:12

Re: Android Driver Station
 
Quote:

Originally Posted by Dr.Gusta (Post 1387175)
I am using a Galaxy S4

OK, I'll see what I can find out, but I let out for summer vacation today and am going home to Mexico, so I will not have access to a robot.

dmaciel10123 24-05-2014 05:57

Quote:

Originally Posted by raystubbs (Post 1387180)
OK, I'll see what I can find out, but I let out for summer vacation today and am going home to Mexico, so I will not have access to a robot.

I'll have access to a robot for the weekend if you need me to take a look at anything

raystubbs 24-05-2014 14:29

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387196)
I'll have access to a robot for the weekend if you need me to take a look at anything

I would appreciate if you could see what you can find out about Dr.Gusta's problem, you have a galaxy right? If the app works on your phone than there is no reason why it should not work on his. Thanks for all the help you have given.

I found out something about the video, it may not work, but if you would like to try it:

On the example of video code in one of my previous posts I made the URI as:
"rtsp://10.xx.yy.11/axis-media/media.3gp"

It should have been :
"rtsp://10.xx.yy.11:554/axis-media/media.3gp?videocodec=h264"

In the second URI I added the :554 after the IP address and at the end I added ?videocodec=h264 which is not necessary except for choosing the video settings, it is unneeded for the default settings.

raystubbs 24-05-2014 15:06

Re: Android Driver Station
 
I added code to support physical joysticks and buttons if anyone wants to try it out, I have no idea if it will work, have not tested it at all.

dmaciel10123 24-05-2014 23:01

Re: Android Driver Station
 
I'll see what I can do tomorrow, sorry. Didn't have much spare time today haha. Also, I found where the single image is saved, it's at http://10.xx.xx.11/axis-cgi/jpg/image.cgi so I modified my code to load from that with the default settings at about 30 FPS, so I'll see if that works tomorrow as well. I may need to work on a way to get the regular image rather than the CGI page, though, so I've been looking at various JPEG Decoder tutorials trying to find out what to do.

raystubbs 25-05-2014 00:28

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387265)
I'll see what I can do tomorrow, sorry. Didn't have much spare time today haha. Also, I found where the single image is saved, it's at http://10.xx.xx.11/axis-cgi/jpg/image.cgi so I modified my code to load from that with the default settings at about 30 FPS, so I'll see if that works tomorrow as well. I may need to work on a way to get the regular image rather than the CGI page, though, so I've been looking at various JPEG Decoder tutorials trying to find out what to do.

Thanks.
I was messing with the camera a while ago and found another image file at http://10.xx.xx.11/jpg/image.jpg for if the other doesn't work.

dmaciel10123 25-05-2014 07:17

Re: Android Driver Station
 
Oh, thanks haha. I wrote some code that should be able to get the image from the CGI page, but if it doesn't work (and for some reason I feel like it won't) I'll just switch it over to use the URL you found.

dmaciel10123 25-05-2014 19:30

Okay, so, I tried the app today after we got eliminated and everything worked: joysticks and buttons. I still haven't gotten the image to show but I am continuing to work on it and hope to have it working soon.

raystubbs 25-05-2014 22:54

Re: Android Driver Station
 
Quote:

Originally Posted by dmaciel10123 (Post 1387343)
Okay, so, I tried the app today after we got eliminated and everything worked: joysticks and buttons. I still haven't gotten the image to show but I am continuing to work on it and hope to have it working soon.

It's good that everything still works. Any idea why Dr.Gusta's didn't work? I have no idea.

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!


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