CORC Project
CANOpen Robot Controller Software Documentation
ExoRobot.h
Go to the documentation of this file.
1 
18 #ifndef EXOROBOT_H_INCLUDED
19 #define EXOROBOT_H_INCLUDED
20 
21 #include <time.h>
22 
23 #include <map>
24 
25 #include "CopleyDrive.h"
26 #include "DummyActJoint.h"
28 #include "Keyboard.h"
29 #include "Robot.h"
30 #include "RobotParams.h"
31 
36 class ExoRobot : public Robot {
37  private:
38  // \todo Load in paramaters and dictionary entries from JSON file.
39 
41  double currTrajProgress = 0;
42  timespec prevTime;
47  motorProfile posControlMotorProfile{4000000, 240000, 240000};
48 
49  public:
56  ~ExoRobot();
58  vector<CopleyDrive *> copleyDrives;
59 
60  // /**
61  // * \brief Timer Variables for moving through trajectories
62  // *
63  // */
64  struct timeval tv, tv_diff, moving_tv, tv_changed, stationary_tv, start_traj, last_tv;
65 
72  bool initPositionControl();
73 
79  bool moveThroughTraj();
80 
88  void startNewTraj();
89 
94  bool isTrajFinished();
95 
101  bool initialiseJoints();
102 
108  bool initialiseNetwork();
114  bool initialiseInputs();
118  void freeMemory();
124  void updateRobot();
140  std::map<int, double> jointMinMap = {{LEFT_HIP, 70},
141  {RIGHT_HIP, 70},
142  {LEFT_KNEE, 0},
143  {RIGHT_KNEE, 0},
144  {LEFT_ANKLE, 75},
145  {RIGHT_ANKLE, 75}};
151  std::map<int, double> jointMaxMap = {{LEFT_HIP, 210},
152  {RIGHT_HIP, 210},
153  {LEFT_KNEE, 120},
154  {RIGHT_KNEE, 120},
155  {LEFT_ANKLE, 105},
156  {RIGHT_ANKLE, 105}};
157 };
158 #endif /*EXOROBOT_H*/
void freeMemory()
Free robot objects vector pointer memory.
Definition: ExoRobot.cpp:104
bool initPositionControl()
Initialises all joints to position control mode.
Definition: ExoRobot.cpp:16
Example implementation of the Robot class, representing an X2 Exoskeleton, using DummyActuatedJoint a...
Definition: ExoRobot.h:36
vector< CopleyDrive * > copleyDrives
Definition: ExoRobot.h:58
Specific paramaters and naming definitions for exoskeleton robot class implementetion.
A trajectory generator to be used for testing purposes.
Abstract Class representing a robot. Includes vectors of Joint and InputDevice.
Definition: Robot.h:34
The Robot class is a abstract class which is a software representation of a Robot with a flexible rep...
bool initialiseNetwork()
Implementation of Pure Virtual function from Robot Base class. Initialize each Drive Objects underlyi...
Definition: ExoRobot.cpp:88
timespec prevTime
Definition: ExoRobot.h:42
double currTrajProgress
Definition: ExoRobot.h:41
Example InputDevice which takes input in from a keyboard. Useful for testing without any other input ...
Definition: Keyboard.h:44
A dummy class to test whether the actuated joint inheritence stuff works.
bool initialiseJoints()
Implementation of Pure Virtual function from Robot Base class. Create designed Joint and Driver objec...
Definition: ExoRobot.cpp:80
bool moveThroughTraj()
For each joint, move through(send appropriate commands to joints) the Currently generated trajectory ...
Definition: ExoRobot.cpp:45
An implementation of the Drive Object, specifically for the Copley Drive.
motorProfile posControlMotorProfile
motor drive position control profile paramaters, user defined.
Definition: ExoRobot.h:47
~ExoRobot()
Definition: ExoRobot.cpp:8
ExoRobot(TrajectoryGenerator *tj)
Default ExoRobot constructor. Initialize memory for the Exoskelton Joint + sensors. Load in exoskeleton paramaters to TrajectoryGenerator..
Definition: ExoRobot.cpp:5
struct to hold desired velocity, acceleration and deceleration values for a drives motor controller p...
Definition: Drive.h:94
Abstract class which is used to generate trajectorys for a Robot to follow.
bool isTrajFinished()
void startNewTraj()
Begin a new trajectory with the currently loaded trajectory paramaters. Using the ExoRobot current co...
Definition: ExoRobot.cpp:37
std::map< int, double > jointMaxMap
Joint Limit Map between Joint value and max Degrees possible.
Definition: ExoRobot.h:151
Keyboard keyboard
Definition: ExoRobot.h:57
struct timeval tv tv_diff moving_tv tv_changed stationary_tv start_traj last_tv
Timer Variables for moving through trajectories.
Definition: ExoRobot.h:64
void updateRobot()
update current state of the robot, including input and output devices. Overloaded Method from the Rob...
Definition: ExoRobot.cpp:115
bool initialiseInputs()
Implementation of Pure Virtual function from Robot Base class. Initialize each Input Object...
Definition: ExoRobot.cpp:100
std::map< int, double > jointMinMap
Joint Limit Map between Joint value and min Degrees possible.
Definition: ExoRobot.h:140