AStarWithOrientation.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 Niklas Arlt ( niklas dot arlt at kit dot edu )
17 * @date 2025
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
33
35{
36
37 /**
38 * @brief Parameters for AStarWithOrientation
39 *
40 */
42 {
43 bool includeStartPose{true};
44
45 Algorithms algorithm() const override;
46 aron::data::DictPtr toAron() const override;
47
49 };
50
51 // Implementation class with only the necessary interface
53 {
54 public:
56
58 const Params& params,
60 const std::optional<navigation::algorithms::orientation_aware::Costmap3D>& costmap,
62
63 void updateCostmap(const std::optional<navigation::algorithms::orientation_aware::Costmap3D>& costmap);
64
65 std::optional<GlobalPlannerResult> plan(const core::Pose& start, const core::Pose& goal);
66
67 void visualizeDebugInfo(viz::Client& vizClient,
68 const std::string& vizLayerNamePrefix = "global_planner_debug");
69
70 protected:
73 std::optional<navigation::algorithms::orientation_aware::Costmap3D> costmap;
75
76 private:
77 // state from last execution
78 std::vector<core::GlobalTrajectoryPoint> lastPointsInCollision;
79 core::GlobalTrajectory lastRawTrajectory;
80 core::GlobalTrajectory lastPreprocessedTrajectory;
81 core::GlobalTrajectory lastSmoothedTrajectory;
82 /// original (in-collision) start pose of the last plan, in the costmap/planning frame
83 std::optional<core::Pose> lastRecoveryOriginalStart;
84 /// collision-free recovery target of the last plan, in the costmap/planning frame
85 std::optional<Eigen::Vector2f> lastRecoveryPosition;
86 };
87
88 /**
89 * @class AStarWithOrientation
90 * @ingroup Library-GlobalPlanner
91 *
92 * Implements an A* planner but is compatible with non-circular robots.
93 * Compared to circular robots, the orientation of non-circular robots is important to not collide with obstacles.
94 *
95 * This class is the integration class for the GlobalPanner base class.
96 */
97 class AStarWithOrientation : virtual public GlobalPlanner
98 {
99 public:
101
102 AStarWithOrientation(const Params& params,
104 const core::Scene& ctx);
105
106 std::optional<GlobalPlannerResult> plan(const core::Pose& goal) override;
107 std::optional<GlobalPlannerResult> plan(const core::Pose& start,
108 const core::Pose& goal) override;
109
111 void
113 const std::string& vizLayerNamePrefix = "global_planner_debug") override;
114
115 protected:
117 };
118
119} // namespace armarx::navigation::global_planning
std::optional< GlobalPlannerResult > plan(const core::Pose &start, const core::Pose &goal)
void updateCostmap(const std::optional< navigation::algorithms::orientation_aware::Costmap3D > &costmap)
std::optional< navigation::algorithms::orientation_aware::Costmap3D > costmap
AStarWithOrientationImpl(const Params &params, const core::GeneralConfig &generalConfig, const std::optional< navigation::algorithms::orientation_aware::Costmap3D > &costmap, VirtualRobot::RobotPtr robot)
void visualizeDebugInfo(viz::Client &vizClient, const std::string &vizLayerNamePrefix="global_planner_debug")
void visualizeDebugInfo(viz::Client &vizClient, const std::string &vizLayerNamePrefix="global_planner_debug") override
std::optional< GlobalPlannerResult > plan(const core::Pose &goal) override
AStarWithOrientation(const Params &params, const core::GeneralConfig &generalConfig, const core::Scene &ctx)
GlobalPlanner(const core::GeneralConfig &generalConfig, const core::Scene &scene)
virtual void visualizeDebugInfo(viz::Client &vizClient, const std::string &vizLayerNamePrefix="global_planner_debug")
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
Eigen::Isometry3f Pose
Definition basic_types.h:31
This file is part of ArmarX.
Definition fwd.h:30
static AStarWithOrientationParams FromAron(const aron::data::DictPtr &dict)