Shouldn’t motor controllers (Victor SPX) have some lines of code to control them? Where does that go? Current robot code (which is really just a “template” from our 2019 code).

Our 2019 code:

If they look like a mess on github, sorry about that. First timer.

1 Like

What does this mean?

On the driver station, it says ‘watchdog not fed’ does that mean the code hasnt deployed? If yes, it confirms that we havent.

Says something about gradlew.

  1. Yes, you will need code to control your motor controllers. It looks like you’re using command based java last year. In this case, the subsystems should own all of the robot resources, including motor controllers and sensors, and have all of the code which directly drives them. Then, the commands should call methods in the subsystems which tell the pieces what to do. By putting all of the lower level code in the subsystems, you greatly reduce the chances of a robot getting twitchy because it’s being told to do two things at once.
  2. Flashing yellow on the PDP means that you have a sticky fault, I believe I read in the past 24 hours. You can clear this by “flashing” the device on the tuner. Added: here:
    PDP is blinking yellow when the robot is enabled
  3. Watchdog not fed means that a motor controller is not getting commands on a timely basis. (I think it’s 50ms, and the timing loop is nominally 20ms.) Not having any code to drive the motor controllers is a great way to get this.
  4. Most likely you do not have gradlew installed, or your PATH environment variable does not include the path to it.

It looks like you might not have installed everything you need.

Does the root folder of your project have gradlew.bat and build.gradle files? Also you do need code for the motor controllers.

The code that is on GitHub doesn’t match that file tree

the github stuff is probably not the best bet right now since i just randomly uploaded the files (not in order).

Where does this code go? i don’t see it in the 2019 code… Unless it’s Phoenix.json?

In you 2019 code, you put it in but you used the generic pwm class. you could do the same thing this year unless you are using can motor controllers.

Yes, we are using Victor SPX with Can bus

According to that file tree, you don’t have your source code! It shows an empty src folder, which should have .Java source file counterparts for each .class file in build.

how… should i do that?

Sorry my bad your original image didn’t show the src>main>java folder

Instead of ‘PWM’ use ‘WPI_TalonSRX motor = new WPI_TalonSRX(port#)’ and use ‘motor.set(percent)’ to set where percent is a double from -1 to 1.

1 Like

And that would go in your drivetrain subsystem

1 Like

Where are you seeing PWM in the 2020 code?

It’s in the 2019 code In drivebase, but put the Victor spx code in the same place in the 2020 code