Now you can download a copy of these docs so you can use them offline! Download now
Jaguar.cpp
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 
8 #include "Jaguar.h"
9 #include "NetworkCommunication/UsageReporting.h"
10 #include "DigitalModule.h"
11 #include "LiveWindow/LiveWindow.h"
12 
16 void Jaguar::InitJaguar()
17 {
18  /*
19  * Input profile defined by Luminary Micro.
20  *
21  * Full reverse ranges from 0.671325ms to 0.6972211ms
22  * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
23  * Neutral ranges from 1.4482078ms to 1.5517922ms
24  * Proportional forward ranges from 1.5517922ms to 2.3027789ms
25  * Full forward ranges from 2.3027789ms to 2.328675ms
26  */
27  SetBounds(2.31, 1.55, 1.507, 1.454, .697);
28  SetPeriodMultiplier(kPeriodMultiplier_1X);
29  SetRaw(m_centerPwm);
30 
31  nUsageReporting::report(nUsageReporting::kResourceType_Jaguar, GetChannel(), GetModuleNumber() - 1);
32  LiveWindow::GetInstance()->AddActuator("Jaguar", GetModuleNumber(), GetChannel(), this);
33 }
34 
40 Jaguar::Jaguar(uint32_t channel) : SafePWM(channel)
41 {
42  InitJaguar();
43 }
44 
51 Jaguar::Jaguar(uint8_t moduleNumber, uint32_t channel) : SafePWM(moduleNumber, channel)
52 {
53  InitJaguar();
54 }
55 
56 Jaguar::~Jaguar()
57 {
58 }
59 
69 void Jaguar::Set(float speed, uint8_t syncGroup)
70 {
71  SetSpeed(speed);
72 }
73 
79 float Jaguar::Get()
80 {
81  return GetSpeed();
82 }
83 
88 {
89  SetRaw(kPwmDisabled);
90 }
91 
97 void Jaguar::PIDWrite(float output)
98 {
99  Set(output);
100 }
101 
void AddActuator(const char *subsystem, const char *name, LiveWindowSendable *component)
Definition: LiveWindow.cpp:96
virtual float GetSpeed()
Definition: PWM.cpp:286
virtual void SetSpeed(float speed)
Definition: SafePWM.cpp:112
virtual float Get()
Definition: Jaguar.cpp:79
Jaguar(uint32_t channel)
Definition: Jaguar.cpp:40
void SetPeriodMultiplier(PeriodMultiplier mult)
Definition: PWM.cpp:347
static LiveWindow * GetInstance()
Definition: LiveWindow.cpp:13
virtual void SetRaw(uint8_t value)
Definition: PWM.cpp:323
virtual void Disable()
Definition: Jaguar.cpp:87
virtual void Set(float value, uint8_t syncGroup=0)
Definition: Jaguar.cpp:69
void SetBounds(int32_t max, int32_t deadbandMax, int32_t center, int32_t deadbandMin, int32_t min)
Definition: PWM.cpp:123
virtual void PIDWrite(float output)
Definition: Jaguar.cpp:97

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6