-
Notifications
You must be signed in to change notification settings - Fork 1
/
link.cpp
55 lines (48 loc) · 1.06 KB
/
link.cpp
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
#include "link.h"
#include <QDebug>
Link::Link() :
genCoorIndex(-1),
d(0),
a(0),
q(0),
alfa(0),
transMatPtr(&m_transMat),
m_transMat(Eigen::Matrix4d::Zero())
{
m_transMat(0,0) = 1;
m_transMat(1,1) = 1;
m_transMat(2,2) = 1;
m_transMat(3,3) = 1;
}
Link::Link(double inParam[4]) :
genCoorIndex(-1),
transMatPtr(&m_transMat),
m_transMat(Eigen::Matrix4d::Zero())
{
memcpy(param,inParam,sizeof(inParam));
//translation matrix
m_transMat(0,0) = qCos(q);
m_transMat(0,1) = - qCos(alfa) * qSin(q);
m_transMat(0,2) = qSin(alfa) * qSin(q);
m_transMat(0,3) = a * qCos(q);
m_transMat(1,0) = qSin(q);
m_transMat(1,1) = qCos(alfa) * qCos(q);
m_transMat(1,2) = - qSin(alfa) * qCos(q);
m_transMat(1,3) = a * qSin(q);
m_transMat(2,1) = qSin(alfa);
m_transMat(2,2) = qCos(alfa);
m_transMat(2,3) = d;
m_transMat(3,3) = 1;
}
Link::~Link()
{
//qDebug() << "huy";
}
void Link::setGenCoor(quint8 index)
{
genCoorIndex = index;
}
void Link::deleteGenCoor()
{
genCoorIndex = -1;
}