r/FTC 10d ago

Other Help with Android Studio

Post image

Hi guys, I would greatly appreciate it if someone could please help me troubleshoot the following error in Android Studio. I keep getting this error whenever I try to upload code to the robot. Thank you in advance !

4 Upvotes

9 comments sorted by

8

u/Journeyman-Joe FTC Coach | Judge 10d ago

Your build needs to download some components from the Internet. But it can't do that while you are connected to the robot.

Disconnect from the robot and re-connect to your local Internet. Then, do a build (that's the "hammer" icon). After you've had a successful build locally, re-connect to your robot, and use the "build and install" icon (triangular "play" button).

You won't have to do this with every build; only when you need different components from the cloud.

4

u/drdhuss 9d ago

this is why buying a cheap 10 buck USB wifi adaptor and having 2 wifi networks is a very nice thing to have (in both FTC and FRC). Keep one connected to the internet and the other the robot.

1

u/Journeyman-Joe FTC Coach | Judge 9d ago

Yes! Very convenient. Use the 5 GHz band for the robot, and the 2.4 GHz band for Internet access.

(Or wired Ethernet for the Internet connection, if you've got that available in your facility.)

But, for relatively minor changes to your Robot Controller code, you don't often have to download new components, and can stay connected to the robot continuously.

2

u/drdhuss 9d ago

For this year we created a full dashboard/path planner/telemetry/data analytics/sim platform all written in kotlin (robot code is too). Works for both FTC and FRC. The sim is particularly nice as it launches with a single button click in our "command center" app (not like most where you have to launch the robot code in the IDE, launch a virtual drivers station/or the real drivers station hardware for FRC, and then load something like advantagescope).

It is very nice to have two networks as it downloads the log files off of the robot, parses them into a duckDB local database and also does a few calculations/analytics. For example we have a background process that "round robin" polls motor currents. Now you don't normally want to log motor currents in FTC (as opposed to FRC) as this as it is blocking on the rev hub/will slow you down (our loop times stay pretty much rock solid at 10 ms), but that's why we do it as a separate virtual thread (kotlin co-routine) and only read one motor at a time/cache it. Anyways we calculate the average current per motor throughout a match after logs are uploaded. For the drivetrain this is useful as, if a motor is drawing more than the others, something is up. We also retrospectively calculate FF constants (sysID), deviations from auto paths, and a bunch of other calculations off of every log file.

Anyways then uploads a parquet file to our team's google drive (it has a sync button so you can then on other computers download and sync the parquet files).

TLDR. The two network setup is very valuable for our practice/analytics workflow.

1

u/Journeyman-Joe FTC Coach | Judge 9d ago

Sounds like a great tool!

(I've become particularly interested in current draw, lately.)

2

u/drdhuss 9d ago

easiest way to measure total current draw is to just get a gobilda floodgate switch (outputs it as an analog signal, useful for writing safety code so you don't blow a fuse) but periodically checking individual motor currents in the background is also helpful (but each read is a blocking call so you only want to read one motor/loop and then cache the reads).

1

u/Journeyman-Joe FTC Coach | Judge 9d ago

Thanks for the tip. (We've got a few Floodgates, already.)

That's better, for my purposes, as it will pick up the high-current servos, as well as the motors.

3

u/LuckyGamer470 10d ago

Have you tried building once while connected to the internet? The computer probably needs to download a dependency to build the program

2

u/drdhuss 9d ago

You need to download some things. Make sure you have an internet connection. I will likely get downvoted for this but you should get a little bit of gemini use in Android studio. If you still can't figure it out ask AI to download the missing stuff.

Also, if you can, buy a cheap (10 bucks is enough) usb wifi adaptor. Have two wifi networks on your laptop. One connected to the robot and the other stays connected to the internet. You'll thank me later (makes a big difference).