| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// |
| 2 |
|
|
// Copyright (c) 2017-2021 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/math/utils.hpp" |
| 19 |
|
|
#include "tsid/trajectories/trajectory-se3.hpp" |
| 20 |
|
|
|
| 21 |
|
|
using namespace tsid::math; |
| 22 |
|
|
|
| 23 |
|
|
namespace tsid { |
| 24 |
|
|
namespace trajectories { |
| 25 |
|
|
|
| 26 |
|
✗ |
TrajectorySE3Constant::TrajectorySE3Constant(const std::string& name) |
| 27 |
|
✗ |
: TrajectoryBase(name) { |
| 28 |
|
✗ |
m_sample.resize(12, 6); |
| 29 |
|
|
} |
| 30 |
|
|
|
| 31 |
|
✗ |
TrajectorySE3Constant::TrajectorySE3Constant(const std::string& name, |
| 32 |
|
✗ |
const SE3& M) |
| 33 |
|
✗ |
: TrajectoryBase(name) { |
| 34 |
|
✗ |
m_sample.resize(12, 6); |
| 35 |
|
|
TSID_DISABLE_WARNING_PUSH |
| 36 |
|
|
TSID_DISABLE_WARNING_DEPRECATED |
| 37 |
|
✗ |
tsid::math::SE3ToVector(M, m_sample.pos); |
| 38 |
|
|
TSID_DISABLE_WARNING_POP |
| 39 |
|
|
} |
| 40 |
|
|
|
| 41 |
|
✗ |
unsigned int TrajectorySE3Constant::size() const { return 6; } |
| 42 |
|
|
|
| 43 |
|
✗ |
void TrajectorySE3Constant::setReference(const pinocchio::SE3& ref) { |
| 44 |
|
✗ |
m_sample.resize(12, 6); |
| 45 |
|
|
TSID_DISABLE_WARNING_PUSH |
| 46 |
|
|
TSID_DISABLE_WARNING_DEPRECATED |
| 47 |
|
✗ |
tsid::math::SE3ToVector(ref, m_sample.pos); |
| 48 |
|
|
TSID_DISABLE_WARNING_POP |
| 49 |
|
|
} |
| 50 |
|
|
|
| 51 |
|
✗ |
const TrajectorySample& TrajectorySE3Constant::operator()(double) { |
| 52 |
|
✗ |
return m_sample; |
| 53 |
|
|
} |
| 54 |
|
|
|
| 55 |
|
✗ |
const TrajectorySample& TrajectorySE3Constant::computeNext() { |
| 56 |
|
✗ |
return m_sample; |
| 57 |
|
|
} |
| 58 |
|
|
|
| 59 |
|
✗ |
void TrajectorySE3Constant::getLastSample(TrajectorySample& sample) const { |
| 60 |
|
✗ |
sample = m_sample; |
| 61 |
|
|
} |
| 62 |
|
|
|
| 63 |
|
✗ |
bool TrajectorySE3Constant::has_trajectory_ended() const { return true; } |
| 64 |
|
|
|
| 65 |
|
|
} // namespace trajectories |
| 66 |
|
|
} // namespace tsid |
| 67 |
|
|
|