TrajectoryFollowingController.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @author Christian R. G. Dreher ( c dot dreher at kit dot edu )
18 * @date 2021
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <memory>
26
29
35
37{
38 // using arondto::TrajectoryFollowingControllerParams;
39
63
65 {
66 public:
68
70 ~TrajectoryFollowingController() override = default;
71
73 const core::Pose& global_T_robot) override;
74
75
76 void updateParams(const Params& params);
77
78 void resetProgress();
79
80 protected:
82
84
85 private:
86 Params params;
87
88
93
94 struct TrajectoryId
95 {
96 std::size_t numPoints = 0;
97 Eigen::Vector3f firstTranslation = Eigen::Vector3f::Zero();
98 Eigen::Vector3f lastTranslation = Eigen::Vector3f::Zero();
99
100 bool operator==(const TrajectoryId& other) const
101 {
102 return numPoints == other.numPoints &&
103 firstTranslation == other.firstTranslation &&
104 lastTranslation == other.lastTranslation;
105 }
106 bool operator!=(const TrajectoryId& other) const
107 {
108 return !(*this == other);
109 }
110 };
111
112 std::optional<TrajectoryId> lastTrajectoryId_;
113 std::size_t lastProjectionIndex_ = 0;
114 };
115
116 using TrajectoryFollowingControllerPtr = std::shared_ptr<TrajectoryFollowingController>;
117
118} // namespace armarx::navigation::traj_ctrl::global
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
Eigen::Isometry3f Pose
Definition basic_types.h:31
std::shared_ptr< TrajectoryFollowingController > TrajectoryFollowingControllerPtr
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
This file is part of ArmarX.
static TrajectoryFollowingControllerParams FromAron(const aron::data::DictPtr &dict)