OrientationOptimizer.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 * @date 2021
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <optional>
25
27
29{
30
32 {
33 Any = 10,
36 };
37
39 {
40 int iterations{5};
41 float movementDirWeightStart{0.0F}; // inclusive
42 float movementDirWeightEnd{0.5F}; // inclusive
43
44 float smoothnessWeight{0.4F};
46
47 float priorStartWeight{1.F};
48 float priorEndWeight{1.F};
49
51
53
54 /**
55 * @brief Most the heading may turn per millimetre travelled [rad/mm].
56 *
57 * The rotation a profile needs is fixed by its start and goal; how much *path* it is
58 * spread over is this optimizer's choice, and that choice decides whether the result can
59 * be executed at all -- the yaw rate asked of the base is `yaw'(s) * v`.
60 *
61 * Nothing in the cost function is expressed per unit distance. The movement-direction
62 * prior pulls every interior heading onto the path tangent and only the smoothness term
63 * resists, so the profile holds the tangent as long as it can and then swings the whole
64 * rotation across a narrow band -- the same band whether the path is one metre or six.
65 * On ARMAR-7 that put a 116 deg rotation into 300 mm of a 3212 mm path and asked for
66 * 3.9 rad/s against a 0.8 rad/s limit.
67 *
68 * The default is what a base holding 0.8 rad/s can turn while still making the 150 mm/s
69 * the profile is floored at. Deliberately not an aron parameter: it is a property of the
70 * drive, and every shipped config would have to grow a member to add it.
71 */
72 double maxTurnRate{0.8 / 150.0}; // [rad/mm]
73 };
74
76 {
77 public:
79
80 OrientationOptimizer(const core::GlobalTrajectory& trajectory, const Params& params);
81
83 {
84 std::optional<core::GlobalTrajectory> trajectory;
85
86 /* //COMMENT IN FOR TEST CASE PLOTTING
87 std::vector<double> initial;
88 std::vector<double> prior; */
89
90 operator bool() const noexcept
91 {
92 return trajectory.has_value();
93 }
94 };
95
96 OptimizationResult optimize();
97
98 protected:
99 private:
101
102 const Params params;
103 };
104} // namespace armarx::navigation::global_planning::optimization
105
106// FIXME remove
108{
110}
OrientationOptimizer(const core::GlobalTrajectory &trajectory, const Params &params)
This file is part of ArmarX.
Definition fwd.h:30
double maxTurnRate
Most the heading may turn per millimetre travelled [rad/mm].