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 
31  enum class RotationDirection
32  {
33  Clockwise = 1,
35  };
36 
38  {
39  int iterations{5};
40  float movementDirWeightStart{0.0F}; // inclusive
41  float movementDirWeightEnd{0.5F}; // inclusive
42 
43  float smoothnessWeight{0.4F};
45 
46  float priorStartWeight{1.F};
47  float priorEndWeight{1.F};
48 
50 
51  std::optional<RotationDirection> predefinedRotationDirection = std::nullopt;
52  };
53 
55  {
56  public:
58 
59  OrientationOptimizer(const core::GlobalTrajectory& trajectory, const Params& params);
60 
62  {
63  std::optional<core::GlobalTrajectory> trajectory;
64 
65  /* //COMMENT IN FOR TEST CASE PLOTTING
66  std::vector<double> initial;
67  std::vector<double> prior; */
68 
69  operator bool() const noexcept
70  {
71  return trajectory.has_value();
72  }
73  };
74 
75  OptimizationResult optimize();
76 
77  protected:
78  private:
79  core::GlobalTrajectory trajectory;
80 
81  const Params params;
82  };
83 } // namespace armarx::navigation::global_planning::optimization
84 
85 // FIXME remove
87 {
89 }
armarx::navigation::core::GlobalTrajectory
Definition: Trajectory.h:68
armarx::navigation::global_planning::optimization
This file is part of ArmarX.
Definition: aron_conversions.h:12
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::priorStartWeight
float priorStartWeight
Definition: OrientationOptimizer.h:46
armarx::navigation::global_planning::optimization::OrientationOptimizer::optimize
OptimizationResult optimize()
Definition: OrientationOptimizer.cpp:41
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::movementDirWeightEnd
float movementDirWeightEnd
Definition: OrientationOptimizer.h:41
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::startGoalDistanceThreshold
float startGoalDistanceThreshold
Definition: OrientationOptimizer.h:49
armarx::navigation::global_planning::optimization::OrientationOptimizerParams
Definition: OrientationOptimizer.h:37
armarx::navigation::global_planning::optimization::OrientationOptimizer::OptimizationResult::trajectory
std::optional< core::GlobalTrajectory > trajectory
Definition: OrientationOptimizer.h:63
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::iterations
int iterations
Definition: OrientationOptimizer.h:39
armarx::navigation::global_planning::optimization::RotationDirection::CounterClockwise
@ CounterClockwise
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::smoothnessWeightStartGoal
float smoothnessWeightStartGoal
Definition: OrientationOptimizer.h:44
armarx::navigation::global_planning::optimization::OrientationOptimizer::OrientationOptimizer
OrientationOptimizer(const core::GlobalTrajectory &trajectory, const Params &params)
Definition: OrientationOptimizer.cpp:34
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::movementDirWeightStart
float movementDirWeightStart
Definition: OrientationOptimizer.h:40
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::predefinedRotationDirection
std::optional< RotationDirection > predefinedRotationDirection
Definition: OrientationOptimizer.h:51
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::priorEndWeight
float priorEndWeight
Definition: OrientationOptimizer.h:47
armarx::navigation::global_planning::optimization::RotationDirection::Clockwise
@ Clockwise
Trajectory.h
armarx::navigation::global_planning::optimization::RotationDirection
RotationDirection
Definition: OrientationOptimizer.h:31
armarx::navigation::global_planning::optimization::OrientationOptimizerParams::smoothnessWeight
float smoothnessWeight
Definition: OrientationOptimizer.h:43
armarx::navigation::global_planning::optimization::OrientationOptimizer::Params
OrientationOptimizerParams Params
Definition: OrientationOptimizer.h:57
armarx::navigation::global_planning
This file is part of ArmarX.
Definition: fwd.h:29
armarx::navigation::global_planning::optimization::OrientationOptimizer
Definition: OrientationOptimizer.h:54
armarx::navigation::global_planning::optimization::OrientationOptimizer::OptimizationResult
Definition: OrientationOptimizer.h:61