-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLeggedAgent.h
executable file
·60 lines (45 loc) · 1.12 KB
/
LeggedAgent.h
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
// *************************
// A class for legged agents
//
// RDB 2/16/96
// *************************
#pragma once
#include "CTRNN.h"
// Global constants
const double Pi = 3.1415926;
// The Leg class declaration
class TLeg {
public:
// The constructor
TLeg() {};
// The destructor
~TLeg() {};
// Accessors
double Angle, Omega, ForwardForce, BackwardForce;
double FootX, FootY, JointX, JointY;
double FootState;
};
// The LeggedAgent class declaration
class LeggedAgent {
public:
// The constructor
LeggedAgent(double ix = 0.0, double iy = 0.0)
{
Reset(ix,iy);
};
// The destructor
~LeggedAgent() {};
// Accessors
double PositionX(void) {return cx;};
void SetPositionX(double newx) {cx = newx;};
// Control
void Reset(double ix, double iy, int randomize = 0);
void Reset(double ix, double iy, int randomize, RandomState &rs);
void Step(double StepSize);
void Step2(double StepSize);
void Step1(double StepSize);
void PerfectStep(double StepSize);
double cx, cy, vx;
TLeg Leg;
CTRNN NervousSystem;
};