-
Notifications
You must be signed in to change notification settings - Fork 0
/
Robot.h
56 lines (42 loc) · 1.06 KB
/
Robot.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
//
// Created by deva on 20/06/15.
//
#ifndef PIXAR_ROBOT_H
#define PIXAR_ROBOT_H
#include <vector>
#include <math.h>
#include <stdint.h>
namespace Roboto {
#define Rad2Deg 180/M_PI
#define Deg2Rad M_PI/180
#define NumAngles 360
typedef std::vector< double > Vector;
typedef Vector Position;
// Joint angles in degrees
typedef std::vector< int > Angles;
typedef Vector Links; // Links
typedef std::vector< std::pair< int, int > > JntLims; // Pair's of Joint Lims
class Robot
{
public:
Robot( int m_nlinks, int m_ndof );
Robot();
virtual ~Robot();
protected:
int m_nlinks;
int m_ndof;
Angles m_theta;
Position m_pos;
Links m_links;
JntLims m_jnt_lims;
protected:
virtual void init() = 0;
virtual void SetAngles( const Angles &t ) = 0;
virtual Angles GetAngles() = 0;
virtual void SetPosition( const Position &p ) = 0;
virtual Position GetPosition() = 0;
};
Vector Cos( NumAngles );
Vector Sin( NumAngles );
}
#endif //PIXAR_ROBOT_H