Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
Gyro.h
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
#ifndef GYRO_H_
8
#define GYRO_H_
9
10
#include "SensorBase.h"
11
#include "PIDSource.h"
12
#include "LiveWindow/LiveWindowSendable.h"
13
14
class
AnalogChannel
;
15
class
AnalogModule
;
16
27
class
Gyro
:
public
SensorBase
,
public
PIDSource
,
public
LiveWindowSendable
28
{
29
public
:
30
static
const
uint32_t kOversampleBits = 10;
31
static
const
uint32_t kAverageBits = 0;
32
static
constexpr
float
kSamplesPerSecond = 50.0;
33
static
constexpr
float
kCalibrationSampleTime = 5.0;
34
static
constexpr
float
kDefaultVoltsPerDegreePerSecond = 0.007;
35
36
Gyro
(uint8_t moduleNumber, uint32_t channel);
37
explicit
Gyro
(uint32_t channel);
38
explicit
Gyro
(
AnalogChannel
*channel);
39
explicit
Gyro
(
AnalogChannel
&channel);
40
virtual
~Gyro
();
41
virtual
float
GetAngle
();
42
virtual
double
GetRate
();
43
void
SetSensitivity
(
float
voltsPerDegreePerSecond);
44
void
SetPIDSourceParameter(PIDSourceParameter pidSource);
45
virtual
void
Reset
();
46
47
// PIDSource interface
48
double
PIDGet
();
49
50
void
UpdateTable
();
51
void
StartLiveWindowMode
();
52
void
StopLiveWindowMode
();
53
std::string
GetSmartDashboardType
();
54
void
InitTable
(
ITable
*subTable);
55
ITable
*
GetTable
();
56
57
private
:
58
void
InitGyro();
59
60
AnalogChannel
*m_analog;
61
float
m_voltsPerDegreePerSecond;
62
float
m_offset;
63
bool
m_channelAllocated;
64
uint32_t m_center;
65
PIDSourceParameter m_pidSource;
66
67
ITable
*m_table;
68
};
69
#endif
Gyro::GetTable
ITable * GetTable()
Definition:
Gyro.cpp:245
AnalogChannel
Definition:
AnalogChannel.h:29
ITable
Definition:
ITable.h:26
Gyro::~Gyro
virtual ~Gyro()
Definition:
Gyro.cpp:140
Gyro
Definition:
Gyro.h:27
LiveWindowSendable
Definition:
LiveWindowSendable.h:17
Gyro::Reset
virtual void Reset()
Definition:
Gyro.cpp:132
PIDSource
Definition:
PIDSource.h:15
Gyro::GetAngle
virtual float GetAngle()
Definition:
Gyro.cpp:157
Gyro::InitTable
void InitTable(ITable *subTable)
Definition:
Gyro.cpp:240
Gyro::GetRate
virtual double GetRate()
Definition:
Gyro.cpp:179
Gyro::StartLiveWindowMode
void StartLiveWindowMode()
Definition:
Gyro.cpp:228
Gyro::StopLiveWindowMode
void StopLiveWindowMode()
Definition:
Gyro.cpp:232
Gyro::Gyro
Gyro(uint8_t moduleNumber, uint32_t channel)
Definition:
Gyro.cpp:79
Gyro::SetSensitivity
void SetSensitivity(float voltsPerDegreePerSecond)
Definition:
Gyro.cpp:193
SensorBase
Definition:
SensorBase.h:20
AnalogModule
Definition:
AnalogModule.h:20
Gyro::GetSmartDashboardType
std::string GetSmartDashboardType()
Definition:
Gyro.cpp:236
Gyro::PIDGet
double PIDGet()
Definition:
Gyro.cpp:210
Gyro::UpdateTable
void UpdateTable()
Definition:
Gyro.cpp:222
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.