[examples] Armbot: rename kCos to kG (#3975)

This commit is contained in:
Oblarg
2022-01-31 03:16:26 -05:00
committed by GitHub
parent a8f0f6bb90
commit d68d6674e8
9 changed files with 16 additions and 16 deletions

View File

@@ -15,7 +15,7 @@ ArmSubsystem::ArmSubsystem()
kP, 0, 0, {kMaxVelocity, kMaxAcceleration})),
m_motor(kMotorPort),
m_encoder(kEncoderPorts[0], kEncoderPorts[1]),
m_feedforward(kS, kCos, kV, kA) {
m_feedforward(kS, kG, kV, kA) {
m_encoder.SetDistancePerPulse(kEncoderDistancePerPulse.value());
// Start arm in neutral position
SetGoal(State{kArmOffset, 0_rad_per_s});

View File

@@ -46,7 +46,7 @@ constexpr double kP = 1;
// These are fake gains; in actuality these must be determined individually for
// each robot
constexpr auto kS = 1_V;
constexpr auto kCos = 1_V;
constexpr auto kG = 1_V;
constexpr auto kV = 0.5_V * 1_s / 1_rad;
constexpr auto kA = 0.1_V * 1_s * 1_s / 1_rad;

View File

@@ -13,7 +13,7 @@ ArmSubsystem::ArmSubsystem()
: frc2::TrapezoidProfileSubsystem<units::radians>(
{kMaxVelocity, kMaxAcceleration}, kArmOffset),
m_motor(kMotorPort),
m_feedforward(kS, kCos, kV, kA) {
m_feedforward(kS, kG, kV, kA) {
m_motor.SetPID(kP, 0, 0);
}

View File

@@ -46,7 +46,7 @@ constexpr double kP = 1;
// These are fake gains; in actuality these must be determined individually for
// each robot
constexpr auto kS = 1_V;
constexpr auto kCos = 1_V;
constexpr auto kG = 1_V;
constexpr auto kV = 0.5_V * 1_s / 1_rad;
constexpr auto kA = 0.1_V * 1_s * 1_s / 1_rad;