1 |
|
|
// |
2 |
|
|
// Copyright (c) 2017 CNRS |
3 |
|
|
// |
4 |
|
|
// This file is part of tsid |
5 |
|
|
// tsid is free software: you can redistribute it |
6 |
|
|
// and/or modify it under the terms of the GNU Lesser General Public |
7 |
|
|
// License as published by the Free Software Foundation, either version |
8 |
|
|
// 3 of the License, or (at your option) any later version. |
9 |
|
|
// tsid is distributed in the hope that it will be |
10 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
11 |
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
|
|
// General Lesser Public License for more details. You should have |
13 |
|
|
// received a copy of the GNU Lesser General Public License along with |
14 |
|
|
// tsid If not, see |
15 |
|
|
// <http://www.gnu.org/licenses/>. |
16 |
|
|
// |
17 |
|
|
|
18 |
|
|
#include <tsid/trajectories/trajectory-euclidian.hpp> |
19 |
|
|
|
20 |
|
|
namespace tsid { |
21 |
|
|
namespace trajectories { |
22 |
|
|
|
23 |
|
|
TrajectoryEuclidianConstant::TrajectoryEuclidianConstant( |
24 |
|
|
const std::string& name) |
25 |
|
|
: TrajectoryBase(name) {} |
26 |
|
|
|
27 |
|
|
TrajectoryEuclidianConstant::TrajectoryEuclidianConstant( |
28 |
|
|
const std::string& name, ConstRefVector ref) |
29 |
|
|
: TrajectoryBase(name) { |
30 |
|
|
setReference(ref); |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
void TrajectoryEuclidianConstant::setReference(ConstRefVector ref) { |
34 |
|
|
m_sample.resize((unsigned int)ref.size()); |
35 |
|
|
m_sample.setValue(ref); |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
unsigned int TrajectoryEuclidianConstant::size() const { |
39 |
|
|
return (unsigned int)m_sample.getValue().size(); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
const TrajectorySample& TrajectoryEuclidianConstant::operator()(double) { |
43 |
|
|
return m_sample; |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
const TrajectorySample& TrajectoryEuclidianConstant::computeNext() { |
47 |
|
|
return m_sample; |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
void TrajectoryEuclidianConstant::getLastSample( |
51 |
|
|
TrajectorySample& sample) const { |
52 |
|
|
sample = m_sample; |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
bool TrajectoryEuclidianConstant::has_trajectory_ended() const { return true; } |
56 |
|
|
|
57 |
|
|
} // namespace trajectories |
58 |
|
|
} // namespace tsid |