Adds CANTalon to LiveWindow

CANTalon was not being added to the LiveWindow list.

Change-Id: I732bb65a899f11bb9b1ef0a7320f0f0cc78233f7
This commit is contained in:
Thad House
2016-01-02 22:29:33 -08:00
committed by Peter Johnson
parent 5976baec02
commit 99b2b65148
2 changed files with 8 additions and 0 deletions

View File

@@ -8,6 +8,8 @@
#include "WPIErrors.h"
#include <unistd.h> // usleep
#include <sstream>
#include "LiveWindow/LiveWindow.h"
/**
* Number of adc engineering units per 0 to 3.3V sweep.
* This is necessary for scaling Analog Position in rotations/RPM.
@@ -35,6 +37,7 @@ CANTalon::CANTalon(int deviceNumber)
ApplyControlMode(m_controlMode);
m_impl->SetProfileSlotSelect(m_profile);
m_isInverted = false;
LiveWindow::GetInstance()->AddActuator("CANTalon", m_deviceNumber, this);
}
/**
* Constructor for the CANTalon device.
@@ -48,6 +51,7 @@ CANTalon::CANTalon(int deviceNumber, int controlPeriodMs)
m_safetyHelper(new MotorSafetyHelper(this)) {
ApplyControlMode(m_controlMode);
m_impl->SetProfileSlotSelect(m_profile);
LiveWindow::GetInstance()->AddActuator("CANTalon", m_deviceNumber, this);
}
CANTalon::~CANTalon() {

View File

@@ -5,6 +5,7 @@ import edu.wpi.first.wpilibj.communication.UsageReporting;
import edu.wpi.first.wpilibj.communication.FRCNetworkCommunicationsLibrary.tResourceType;
import edu.wpi.first.wpilibj.tables.ITable;
import edu.wpi.first.wpilibj.tables.ITableListener;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
public class CANTalon implements MotorSafety, PIDOutput, PIDSource, CANSpeedController {
private MotorSafetyHelper m_safetyHelper;
@@ -316,6 +317,7 @@ public class CANTalon implements MotorSafety, PIDOutput, PIDSource, CANSpeedCont
m_feedbackDevice = FeedbackDevice.QuadEncoder;
setProfile(m_profile);
applyControlMode(TalonControlMode.PercentVbus);
LiveWindow.addActuator("CANTalon", m_deviceNumber, this);
}
/**
* Constructor for the CANTalon device.
@@ -336,6 +338,7 @@ public class CANTalon implements MotorSafety, PIDOutput, PIDSource, CANSpeedCont
m_feedbackDevice = FeedbackDevice.QuadEncoder;
setProfile(m_profile);
applyControlMode(TalonControlMode.PercentVbus);
LiveWindow.addActuator("CANTalon", m_deviceNumber, this);
}
/**
* Constructor for the CANTalon device.
@@ -359,6 +362,7 @@ public class CANTalon implements MotorSafety, PIDOutput, PIDSource, CANSpeedCont
m_feedbackDevice = FeedbackDevice.QuadEncoder;
setProfile(m_profile);
applyControlMode(TalonControlMode.PercentVbus);
LiveWindow.addActuator("CANTalon", m_deviceNumber, this);
}
@Override