Skip to content

Instantly share code, notes, and snippets.

@Lichor8
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lichor8/54a0af9286ebf54ec561 to your computer and use it in GitHub Desktop.
Save Lichor8/54a0af9286ebf54ec561 to your computer and use it in GitHub Desktop.
strategy.h
//===================================
// include guard (safety measure)
#ifndef STRATEGY_H // if not defined
#define STRATEGY_H // define
//===================================
// forward declared dependencies
class Detection;
class Movement;
//===================================
// included dependencies
#include <iostream>
#include <emc/io.h> // embedded motion control package
#include <emc/rate.h>
#include <ctime>
#include <string>
#include <unistd.h>
#include <stdlib.h>
#include <cmath> // math operation such as sqrt(),cos()
#include <math.h> // more math
#include "picomath.h"
//===================================
// the actual class
class Strategy {
private:
int status; // indicating the status of the strategy subsystem:
// 0: not activated;
// 1: strategy is activated, a corner is being taken
Situation detection_situation; // situation info as sent by detection
int movtype; // movement type to be used by movement
bool DoorFound; // Indicates if a door has already been found in the maze;
int fn;
int start;
int sit;
int command;
int choice;
int choicel;
int choicer;
int choices;
double inf;
double dinstancetosit;
Point A;
Point goal;
Point angle_odom;
std::vector<Point> corners;
std::vector<int> history;
public:
// coordinators/composers
// runs basic strategy, with basic memory
void strategy(emc::IO &io, emc::LaserData scan, emc::OdometryData odom, Detection &det, Movement &mov);//, Movement &mov);
// monitors
int monitor();
// configurators
void configurator();
// class entities
// constructors
Strategy(); // default values
// getters (able to get values of the private variables of this class)
std::vector<Point> getTrajectory();
Point getPoint();
int getMovementType();
int getHomingType();
// setters (able to set values to the private variables of this class)
};
#endif // CONVERT_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment