-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtrajectory-jointspace.cpp
47 lines (36 loc) · 968 Bytes
/
trajectory-jointspace.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
#include "trajectory-jointspace.h"
using namespace HQP::trajectories;
TrajectoryJointConstant::TrajectoryJointConstant(const std::string & name)
:TrajectoryBase(name)
{}
TrajectoryJointConstant::TrajectoryJointConstant(const std::string & name, Cref_vectorXd ref)
:TrajectoryBase(name)
{
setReference(ref);
}
void TrajectoryJointConstant::setReference(Cref_vectorXd ref)
{
m_sample.pos = ref;
m_sample.vel.setZero(ref.size());
m_sample.acc.setZero(ref.size());
}
unsigned int TrajectoryJointConstant::size() const
{
return (unsigned int)m_sample.pos.size();
}
const TrajectorySample & TrajectoryJointConstant::operator()(double )
{
return m_sample;
}
const TrajectorySample & TrajectoryJointConstant::computeNext()
{
return m_sample;
}
void TrajectoryJointConstant::getLastSample(TrajectorySample & sample) const
{
sample = m_sample;
}
bool TrajectoryJointConstant::has_trajectory_ended() const
{
return true;
}