-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhoenixBase.cpp
98 lines (84 loc) · 1.94 KB
/
PhoenixBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "PhoenixBase.h"
PhoenixBase::PhoenixBase(){
//----------Initialize Member Objects----------------
m_Bot = new PhoenixRobot();
m_ControlBoard = new PhoenixControlBoard();
m_OpController = new OperatorController(m_ControlBoard);
m_Constants = PhoenixConstants::GetInstance();
//m_WinchState = Winch::UNLOCKING;
//-----------------------------------------------------
SetPeriod(HZ(ROBOT_HZ));
GetWatchdog().SetEnabled(false);
printf("Done constructing PhoenixBase!\n");
}
void PhoenixBase::RobotInit(){
}
void PhoenixBase::DisabledInit(){
//m_Constants->RestoreData();
}
void PhoenixBase::AutonomousInit()
{
// m_Bot->GyroFinalizeCalibration();
//
// m_AutoController->SetCommandList(AutoModes::GetInstance()->GetCommandList());
// m_Bot->SetController(m_AutoController);
// m_Bot->Reset();
//
// m_Bot->SetWinchState(Winch::READY_TO_FIRE);
//m_WinchState = Winch::READY_TO_FIRE;
}
void PhoenixBase::TeleopInit()
{
m_Bot->SetController(m_OpController);
m_Bot->Reset();
//m_Bot->SetWinchState(m_WinchState);
//m_WinchState = Winch::READY_TO_FIRE;
}
void PhoenixBase::DisabledContinuous()
{
taskDelay(WAIT_FOREVER);
}
void PhoenixBase::AutonomousContinuous()
{
taskDelay(WAIT_FOREVER);
}
void PhoenixBase::TeleopContinuous()
{
taskDelay(WAIT_FOREVER);
}
void PhoenixBase::DisabledPeriodic()
{
// m_Bot->GyroHandleCalibration();
//
// if(m_ControlBoard->GetAutoSelectButton())
// {
// if(m_ControlBoard->GetDriveButton(3))
// {
// m_Bot->Reset();
// m_Constants->RestoreData();
// //AutoModes::GetInstance()->NextMode();
// }
// else
// {
// m_Bot->GyroFinalizeCalibration();
// }
// }
//m_Bot->PrintToDS();
}
void PhoenixBase::AutonomousPeriodic()
{
// m_Bot->PrintToDS();
// m_Bot->handle();
}
void PhoenixBase::TeleopPeriodic()
{
// if(m_ControlBoard->GetAutoSelectButton())
// {
// m_Bot->Reset();
// m_Constants->RestoreData();
// }
//
// m_Bot->PrintToDS();
m_Bot->handle();
}
START_ROBOT_CLASS(PhoenixBase);