4 #define OWNER ((ExoTestMachine *)owner) 6 ExoTestMachine::ExoTestMachine() {
8 robot =
new ExoRobot(trajectoryGenerator);
11 isAPressed =
new IsAPressed(
this);
12 endTraj =
new EndTraj(
this);
13 startButtonsPressed =
new StartButtonsPressed(
this);
14 startExo =
new StartExo(
this);
15 startSit =
new StartSit(
this);
16 startStand =
new StartStand(
this);
17 initState =
new InitState(
this, robot, trajectoryGenerator);
20 standingUp =
new StandingUp(
this, robot, trajectoryGenerator);
21 sittingDwn =
new SittingDwn(
this, robot, trajectoryGenerator);
42 void ExoTestMachine::init() {
55 bool ExoTestMachine::EndTraj::check() {
56 return OWNER->trajectoryGenerator->isTrajectoryFinished();
58 bool ExoTestMachine::IsAPressed::check(
void) {
59 if (
OWNER->robot->keyboard.getA() ==
true) {
64 bool ExoTestMachine::StartButtonsPressed::check(
void) {
65 if (
OWNER->robot->keyboard.getW() ==
true) {
70 bool ExoTestMachine::StartExo::check(
void) {
71 if (
OWNER->robot->keyboard.getS() ==
true) {
72 std::cout <<
"LEAVING INIT and entering Sitting" << endl;
77 bool ExoTestMachine::StartStand::check(
void) {
78 if (
OWNER->robot->keyboard.getW() ==
true) {
84 bool ExoTestMachine::StartSit::check(
void) {
85 if (
OWNER->robot->keyboard.getW()) {
95 void ExoTestMachine::hwStateUpdate(
void) {
Example implementation of the Robot class, representing an X2 Exoskeleton, using DummyActuatedJoint a...
State for the ExoTestMachine (implementing ExoTestState) - representing when the exo is standing up (...
Example Implementation of TrajectoryGenerator. Includes only two trajectories (Sit-to-Stand and Stand...
State for the ExoTestMachine (implementing ExoTestState) - representing when the exoskeleton is sitti...
Initialisation State for the ExoTestMachine (implementing ExoTestState)
State for the ExoTestMachine (implementing ExoTestState) - representing when the exoskeleton is stand...
#define NewTransition(_from_, _event_, _to_)
Macro to create statemachine transitions. Add a tranition object to the from states arch list to a sp...
void initialize(State *i)
Sets the current state. Note: No check made.