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
RobotBase.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 ROBOT_H_
8
#define ROBOT_H_
9
10
#include "Base.h"
11
#include "Task.h"
12
#include "Watchdog.h"
13
14
class
DriverStation
;
15
16
#define START_ROBOT_CLASS(_ClassName_) \
17
RobotBase *FRC_userClassFactory() \
18
{ \
19
return new _ClassName_(); \
20
} \
21
extern "C" { \
22
int32_t FRC_UserProgram_StartupLibraryInit() \
23
{ \
24
RobotBase::startRobotTask((FUNCPTR)FRC_userClassFactory); \
25
return 0; \
26
} \
27
}
28
37
class
RobotBase
{
38
friend
class
RobotDeleter
;
39
public
:
40
static
RobotBase
&getInstance();
41
static
void
setInstance(
RobotBase
* robot);
42
43
bool
IsEnabled
();
44
bool
IsDisabled
();
45
bool
IsAutonomous
();
46
bool
IsOperatorControl
();
47
bool
IsTest
();
48
bool
IsSystemActive
();
49
bool
IsNewDataAvailable
();
50
Watchdog
&
GetWatchdog
();
51
static
void
startRobotTask
(FUNCPTR factory);
52
static
void
robotTask
(FUNCPTR factory,
Task
*task);
53
54
protected
:
55
virtual
~RobotBase
();
56
virtual
void
StartCompetition() = 0;
57
RobotBase
();
58
static
void
WriteVersionString();
59
60
Task
*m_task;
61
Watchdog
m_watchdog;
62
DriverStation
*m_ds;
63
private
:
64
static
RobotBase
*m_instance;
65
DISALLOW_COPY_AND_ASSIGN(
RobotBase
);
66
};
67
68
#endif
69
RobotBase::IsOperatorControl
bool IsOperatorControl()
Definition:
RobotBase.cpp:115
RobotBase::IsAutonomous
bool IsAutonomous()
Definition:
RobotBase.cpp:106
RobotBase
Definition:
RobotBase.h:37
RobotBase::IsEnabled
bool IsEnabled()
Definition:
RobotBase.cpp:88
RobotBase::IsTest
bool IsTest()
Definition:
RobotBase.cpp:124
RobotDeleter
Definition:
RobotBase.cpp:220
DriverStation
Definition:
DriverStation.h:21
RobotBase::RobotBase
RobotBase()
Definition:
RobotBase.cpp:44
RobotBase::GetWatchdog
Watchdog & GetWatchdog()
Definition:
RobotBase.cpp:79
RobotBase::robotTask
static void robotTask(FUNCPTR factory, Task *task)
Definition:
RobotBase.cpp:141
RobotBase::IsDisabled
bool IsDisabled()
Definition:
RobotBase.cpp:97
Watchdog
Definition:
Watchdog.h:25
Task
Definition:
Task.h:17
RobotBase::startRobotTask
static void startRobotTask(FUNCPTR factory)
Definition:
RobotBase.cpp:164
RobotBase::IsSystemActive
bool IsSystemActive()
Definition:
RobotBase.cpp:69
RobotBase::~RobotBase
virtual ~RobotBase()
Definition:
RobotBase.cpp:56
RobotBase::IsNewDataAvailable
bool IsNewDataAvailable()
Definition:
RobotBase.cpp:133
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.