mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix GearsBot log methods not being called periodically (#2280)
Add logging for C++ Wrist and Claw
This commit is contained in:
committed by
Peter Johnson
parent
2eb5c54476
commit
ac8177e10d
@@ -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. */
|
||||
@@ -41,8 +41,17 @@ class Claw : public frc2::SubsystemBase {
|
||||
*/
|
||||
bool IsGripping();
|
||||
|
||||
/**
|
||||
* The log method puts interesting information to the SmartDashboard.
|
||||
*/
|
||||
void Log();
|
||||
|
||||
/**
|
||||
* Log the data periodically. This method is automatically called
|
||||
* by the subsystem.
|
||||
*/
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{7};
|
||||
frc::DigitalInput m_contact{5};
|
||||
|
||||
@@ -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,6 +60,12 @@ class DriveTrain : public frc2::SubsystemBase {
|
||||
*/
|
||||
double GetDistanceToObstacle();
|
||||
|
||||
/**
|
||||
* Log the data periodically. This method is automatically called
|
||||
* by the subsystem.
|
||||
*/
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_frontLeft{1};
|
||||
frc::PWMVictorSPX m_rearLeft{2};
|
||||
|
||||
@@ -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. */
|
||||
@@ -39,6 +39,12 @@ class Elevator : public frc2::PIDSubsystem {
|
||||
*/
|
||||
void UseOutput(double output, double setpoint) override;
|
||||
|
||||
/**
|
||||
* Log the data periodically. This method is automatically called
|
||||
* by the subsystem.
|
||||
*/
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{5};
|
||||
double m_setpoint = 0;
|
||||
|
||||
@@ -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. */
|
||||
@@ -32,11 +32,16 @@ class Wrist : public frc2::PIDSubsystem {
|
||||
|
||||
/**
|
||||
* Use the motor as the PID output. This method is automatically called
|
||||
* by
|
||||
* the subsystem.
|
||||
* by the subsystem.
|
||||
*/
|
||||
void UseOutput(double output, double setpoint) override;
|
||||
|
||||
/**
|
||||
* Log the data periodically. This method is automatically called
|
||||
* by the subsystem.
|
||||
*/
|
||||
void Periodic() override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{6};
|
||||
double m_setpoint = 0;
|
||||
|
||||
Reference in New Issue
Block a user