Announcement

Collapse
No announcement yet.

Transfering a File from DriverStation to RobotController

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transfering a File from DriverStation to RobotController

    My team has programmed a separate Alliance Selector app that allows them to choose their starting position while standing in the queue. Unfortunately, they've run into the following problem:

    1. If the App is installed on the Driver Station, it saves the file to the downloads folder, but they aren't sure how to access it from the RC if they can.
    2. If they run the App on the Robot controller, it would be fine but they find it cumbersome to do so when the phone is mounted on the robot.

    They would like to know if it is illegal to use a 3rd party Wi-fi Direct App to send the file from one phone to another, or if anyone else has an idea on how to access the file they are saving from the RC if they save it on the DS.

    Thanks!

  • #2
    I'm curious to know what options this app has beyond the 4 different starting positions. Having a separate app seems like overkill if that's all it does. It's very easy to do this selection within an OpMode once it's been initialized.

    Comment


    • #3
      Originally posted by mlwilliams View Post
      I'm curious to know what options this app has beyond the 4 different starting positions. Having a separate app seems like overkill if that's all it does. It's very easy to do this selection within an OpMode once it's been initialized.
      At the moment, it simply selects the starting position for their bot, but they are planning on adding in selections for what their alliance partner can/cannot do. Not sure how effective that will be this year however. They wanted to program an App for this, so they didn't research how to do it within an OpMode and they got to learn more about Android Studio so I let them run with it.

      Comment


      • #4
        Generally the best way I found to handle user input during Init was to read the Gamepad and use the telemetry to prompt questions to the driver.

        Also, there is a way to pragmatically transfer files from the Driver Station to the Robot Controller without any additional connections between the two phones (in a limited sort of way, and I didn't say it would be trivial to implement on the DS side), but consider using the first way as less things will eventually break, because it is simpler.

        Comment


        • #5
          Originally posted by dmssargent View Post
          Generally the best way I found to handle user input during Init was to read the Gamepad and use the telemetry to prompt questions to the driver.

          Also, there is a way to pragmatically transfer files from the Driver Station to the Robot Controller without any additional connections between the two phones (in a limited sort of way, and I didn't say it would be trivial to implement on the DS side), but consider using the first way as less things will eventually break, because it is simpler.
          As long as that is a legal option, I will discuss it with them when we meet again. We have found a way to send the file via Wi-Fi direct, but it still requires some input at the RC side, and we don't want to have to touch the RC at all during this process. If switching to prompting in the Init phase is legal, then I will suggest they switch over for ease of use.

          Comment


          • #6
            Originally posted by KcPringle View Post
            As long as that is a legal option,
            It's certainly legal. Once you're done with initializing you let the refs know you're done. At that point it's only illegal if you touch the gamepad or phone (except for the play button) once they say start. The code for this is far simpler than transferring and processing configuration files.

            Here's a simple example that uses the red and blue buttons on the gamepad to choose your alliance.

            Code:
               @Override
                public void init_loop() {
                    super.init_loop();
                    telemetry.addLine("Team: " + (isRed ? "Red" : "Blue"));
                    if(gamepad1.b) // red button
                        isRed = true;
                    if(gamepad1.x) // blue button
                        isRed = false;
                }

            Comment

            Working...
            X