Fix GearsBot log methods not being called periodically (#2280)

Add logging for C++ Wrist and Claw
This commit is contained in:
sciencewhiz
2020-01-17 20:18:15 -08:00
committed by Peter Johnson
parent 2eb5c54476
commit ac8177e10d
14 changed files with 88 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 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. */
@@ -76,12 +76,6 @@ public class RobotContainer {
SmartDashboard.putData(m_wrist);
SmartDashboard.putData(m_claw);
// Call log method on all subsystems
m_wrist.log();
m_elevator.log();
m_drivetrain.log();
m_claw.log();
// Configure the button bindings
configureButtonBindings();
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 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. */
@@ -60,4 +60,12 @@ public class Claw extends SubsystemBase {
public boolean isGrabbing() {
return m_contact.get();
}
/**
* Call log method every loop.
*/
@Override
public void periodic() {
log();
}
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 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. */
@@ -121,4 +121,12 @@ public class DriveTrain extends SubsystemBase {
// Really meters in simulation since it's a rangefinder...
return m_rangefinder.getAverageVoltage();
}
/**
* Call log method every loop.
*/
@Override
public void periodic() {
log();
}
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 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. */
@@ -75,4 +75,12 @@ public class Elevator extends PIDSubsystem {
public void useOutput(double output, double setpoint) {
m_motor.set(output);
}
/**
* Call log method every loop.
*/
@Override
public void periodic() {
log();
}
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 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. */
@@ -72,4 +72,12 @@ public class Wrist extends PIDSubsystem {
public void useOutput(double output, double setpoint) {
m_motor.set(output);
}
/**
* Call log method every loop.
*/
@Override
public void periodic() {
log();
}
}