Gradlerio deployed code won't work


#1

I created a simple code for the robot to run the drive motors and right clicked on “build.gradle” so the drop down menu appears. From there, I click on deploy robot code and the build is successful, however before the lines that says “build successful”, these lines pop up.

Task :deployNativeZipRoborio[3s]
41 file(s) are up-to-date and were not deployed
-C-> chmod -R 777 “/usr/local/frc/third-party/lib” || true; chown -R lvuser:ni “/usr/local/frc/third-party/lib” @ /usr/local/frc/third-party/lib
-C-> ldconfig @ /usr/local/frc/third-party/lib
-[-1]->

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 8s
12 actionable tasks: 10 executed, 2 up-to-date

Once this happens, no errors are thrown and it doesn’t specify which features are deprecated. I can even look at the Riolog and see that
“********** Robot program starting **********” about 10 times a second. There is nothing I can do to enable the code, even though the “reconnect” button is and everything seems to be working. Can anyone help me figure out which features are deprecated or why my code won’t enable?


#2

Most likely your code is crashing in initialization and getting restarted automatically and then crashing again. If you post the code I’m sure someone can help you figure it out.

The deprecation warning doesn’t matter because you aren’t using Gradle 6.0


#3

Yes - code would help. I’m also curious at all of the log content between two ********** Robot program starting ********** lines. Even if it doesn’t look like an error, there may be something helpful there.


#4

Here is the code I was trying to deploy

/----------------------------------------------------------------------------/
/* Copyright © 2017-2018 FIRST. All Rights Reserved. /
/
Open Source Software - may be modified and shared by FRC teams. The code /
/
must be accompanied by the FIRST BSD license file in the root directory of /
/
the project. /
/
----------------------------------------------------------------------------*/

package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Talon;

/**

  • The VM is configured to automatically run this class, and to call the
  • functions corresponding to each mode, as described in the TimedRobot
  • documentation. If you change the name of this class or the package after
  • creating this project, you must also update the build.gradle file in the
  • project.
    */
    public class Robot extends TimedRobot {
    private static final String kDefaultAuto = “Default”;
    private static final String kCustomAuto = “My Auto”;
    private String m_autoSelected;
    private final SendableChooser m_chooser = new SendableChooser<>();

/**

  • This function is run when the robot is first started up and should be
  • used for any initialization code.
    */

private Talon leftMotorOne = new Talon(9);
private Talon leftMotorTwo = new Talon(8);
private Talon rightMotorOne = new Talon(7);
private Talon rightMotorTwo = new Talon(6);

Joystick stick = new Joystick(0);//Xbox 1 controller instantiated

@Override
public void robotInit() {
m_chooser.setDefaultOption(“Default Auto”, kDefaultAuto);
m_chooser.addOption(“My Auto”, kCustomAuto);
SmartDashboard.putData(“Auto choices”, m_chooser);
}

/**

  • This function is called every robot packet, no matter the mode. Use
  • this for items like diagnostics that you want ran during disabled,
  • autonomous, teleoperated and test.
  • This runs after the mode specific periodic functions, but before

  • LiveWindow and SmartDashboard integrated updating.
    */
    @Override
    public void robotPeriodic() {
    }

/**

  • This autonomous (along with the chooser code above) shows how to select
  • between different autonomous modes using the dashboard. The sendable
  • chooser code works with the Java SmartDashboard. If you prefer the
  • LabVIEW Dashboard, remove all of the chooser code and uncomment the
  • getString line to get the auto name from the text box below the Gyro
  • You can add additional auto modes by adding additional comparisons to

  • the switch structure below with additional strings. If using the
  • SendableChooser make sure to add them to the chooser code above as well.
    */
    @Override
    public void autonomousInit() {
    m_autoSelected = m_chooser.getSelected();
    // m_autoSelected = SmartDashboard.getString(“Auto Selector”, kDefaultAuto);
    System.out.println("Auto selected: " + m_autoSelected);
    }

/**

  • This function is called periodically during autonomous.
    */
    @Override
    public void autonomousPeriodic() {
    switch (m_autoSelected) {
    case kCustomAuto:
    // Put custom auto code here
    break;
    case kDefaultAuto:
    default:
    // Put default auto code here
    break;
    }
    }

/**

  • This function is called periodically during operator control.
    */
    @Override
    public void teleopPeriodic() {
leftMotorOne.set(-stick.getRawAxis(1));
leftMotorTwo.set(-stick.getRawAxis(1));

rightMotorOne.set(stick.getRawAxis(5));
rightMotorTwo.set(stick.getRawAxis(5));

}

/**

  • This function is called periodically during test mode.
    */
    @Override
    public void testPeriodic() {
    }
    }

#5

There is no log content between any given ********** Robot program starting ********** lines. It is just that for as long as the program runs


#6

Hmmmm, very interesting. Just to confirm, I assume you’re looking in rioLog (in VSCode) to see the message?


#7

Yes, exactly


#8

Just to be sure I have this right, the Riolog is the new “driver station” for this year correct? The old one used to have an enable and disable button along with a section to view joystick input, but now we look in the Riolog to pause or enable right?


#9

No, NI driver station is still standard.

RioLog is just a utility to view console output from user software on the roboRIO. It’s always integrated with the IDE. It has existed for multiple years in eclipse, but just wasn’t displayed by default. VS Code brings it up by default. The pause/enable buttons in RIOlog only change whether text is displayed or not, it does not impact the state of the robot (you can confirm this by watching the robot signal light).


#10

Oh ok that makes a lot of sense


#11

Did anyone see any problems with the code? I had another programmer look through it and he couldn’t find any errors.


#12

Looking through it quickly, I can’t see any issues that would explain the symptom you are describing. Autonomous and Test are unused, and teleop uses joystick axes in a tank-drive like configuration to command four Talon SR’s, which are plugged into PWM ports 9,8,7,and 6 on the roboRIO.

Were there any changes to Main.java? Could you possibly post that as well?

Has the roboRIO been imaged with the 2019 files from NI? I would presume this would prevent code from uploading, but i’ve not tried it yet.

FYI:
image

In general you’ll want to use “preformatted text” to paste code in. Character encodings ( especially " characters) can get mangled when verbatim pasting code into Discourse.


#13

The code is getting crashed and you have to rectify the code before implementing that. The code will only crash if the initial coding which will support it is perfect. I hope you will fix that and will not get the ERROR CODE 0XC0000428 as I have faced that.


#14

Yes I can post the Main.java shortly. Also, yes we updated both the roborio and router to have the 2019 software


#15

How would I rectify the code? I don’t see where I should correct anything and what I’ve tried hasn’t worked so far


#16

/----------------------------------------------------------------------------/
/* Copyright © 2018 FIRST. All Rights Reserved. /
/
Open Source Software - may be modified and shared by FRC teams. The code /
/
must be accompanied by the FIRST BSD license file in the root directory of /
/
the project. /
/
----------------------------------------------------------------------------*/

package frc.robot;

import edu.wpi.first.wpilibj.RobotBase;

/**

  • Do NOT add any static variables to this class, or any initialization at all.
  • Unless you know what you are doing, do not modify this file except to
  • change the parameter class to the startRobot call.
    */
    public final class Main {
    private Main() {
    }

/**

  • Main initialization function. Do not perform any initialization here.
  • If you change your main robot class, change the parameter type.

*/
public static void main(String… args) {
RobotBase.startRobot(Robot::new);
}
}


#17

This is the Main.java class that pulls up when I open our code


#18

Still not seeing anything obviously incorrect. The formatting discourse is applying is preventing me from being 100% sure nothing changed, but what you have posted seems reasonable.

Have you tried creating a new project, and deploying it with zero code changes? It would be good to know if that works.


#19

oh yes sorry I pasted it in using the Preformatted text button you showed me but it didn’t seem to change


#20

I don’t know if this information is of any use, but every time I deploy the code and the Riolog comes up, it asks me to input my team number. No matter how many times i type it in and click Set Team Number, it never saves it when I close the app. I think that’s a little weird considering FIRST usually saves this information across platforms so they work together.