-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kick.h
67 lines (46 loc) · 1.57 KB
/
Kick.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
61
62
63
64
65
66
67
// Kick.h: interface for the Kick class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_KICK_H__5BF0F724_7DD1_41A0_9E0C_8875BF0278B9__INCLUDED_)
#define AFX_KICK_H__5BF0F724_7DD1_41A0_9E0C_8875BF0278B9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "GeometryR.h"
#define PATHPOINT 2000
class Kick {
public:
Kick();
void Init(RobotInford robot, VecPosition posTarget, VecPosition posBall);
void SetPathValid(bool bPathValid = true) { m_bPathValid = bPathValid; };
bool GetPathValid() { return m_bPathValid; };
void SetTarget(VecPosition posTarget) { m_posTarget = posTarget; };
VecPosition GetTarget() { return m_posTarget; };
void SetCurvature(double dCurvature) { m_dCurvature = dCurvature; };
void SetCycle(int nCycle = 40) { m_nCycle = nCycle; };
int GetCycle() { return m_nCycle; };
void SetKickParameters(double k1, double k2, double k3) {
m_dKn[0] = k1;
m_dKn[1] = k2;
m_dKn[2] = k3;
};
void GeneratePath(int nCycle = 40);
void GetNextCommand(dbLRWheelVelocity *pSpeed);
private:
bool m_bPathValid;
VecPosition m_posTarget;
VecPosition m_posBall;
RobotInford m_robot;
double m_dCurvature;
int m_nCycle;
int m_nKickTime;
int m_nDirection;
double m_dKn[4];
VecPosition m_posPath[PATHPOINT];
double m_anglePath[PATHPOINT];
double m_u[PATHPOINT];
double m_dVr[PATHPOINT];
double m_dWr[PATHPOINT];
double e[2][3];
};
#endif // !defined(AFX_KICK_H__5BF0F724_7DD1_41A0_9E0C_8875BF0278B9__INCLUDED_)