SPFA.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 <VirtualRobot/MathTools.h>
26
27
#include <
armarx/navigation/algorithms/spfa/ShortestPathFasterAlgorithm.h
>
28
#include <
armarx/navigation/core/types.h
>
29
#include <
armarx/navigation/global_planning/core.h
>
30
#include <
armarx/navigation/global_planning/optimization/OrientationOptimizer.h
>
31
32
#include "
GlobalPlanner.h
"
33
34
namespace
armarx::navigation::global_planning
35
{
36
37
/**
38
* @brief Parameters for AStar
39
*
40
*/
41
struct
SPFAParams
:
public
GlobalPlannerParams
42
{
43
float
linearVelocity
{500};
44
float
angularVelocity
{2.F * M_PIf32 / 30.F};
45
46
// core::TwistLimits limits{
47
// .linear = 500.F, // [mm/s]
48
// .angular = 2.F * M_PIf32 / 30.F // [rad/s]
49
// };
50
51
float
resampleDistance
{-1};
52
53
algorithms::spfa::ShortestPathFasterAlgorithm::Parameters
algo
;
54
55
optimization::OrientationOptimizerParams
optimizerParams
;
56
57
Algorithms
algorithm
()
const override
;
58
aron::data::DictPtr
toAron
()
const override
;
59
60
static
SPFAParams
FromAron
(
const
aron::data::DictPtr
& dict);
61
};
62
63
/**
64
* @class AStar
65
* @ingroup Library-GlobalPlanner
66
*
67
* Implements the A* algorithm
68
*/
69
class
SPFA
:
public
GlobalPlanner
70
{
71
public
:
72
using
Params
=
SPFAParams
;
73
74
SPFA
(
const
Params
& params,
const
core::Scene
& ctx);
75
~SPFA
()
override
=
default
;
76
77
std::optional<GlobalPlannerResult>
plan
(
const
core::Pose
& goal)
override
;
78
std::optional<GlobalPlannerResult>
plan
(
const
core::Pose
& start,
79
const
core::Pose
& goal)
override
;
80
81
protected
:
82
std::vector<Eigen::Vector2f>
postProcessPath
(
const
std::vector<Eigen::Vector2f>& path);
83
84
private
:
85
Params
params_;
86
};
87
88
}
// namespace armarx::navigation::global_planning
armarx::navigation::global_planning::SPFA
Definition:
SPFA.h:69
armarx::navigation::algorithms::spfa::ShortestPathFasterAlgorithm::Parameters
Definition:
ShortestPathFasterAlgorithm.h:36
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition:
basic_types.h:31
OrientationOptimizer.h
armarx::navigation::global_planning::GlobalPlannerParams
Parameters for GlobalPlanner.
Definition:
GlobalPlanner.h:48
armarx::navigation::global_planning::SPFA::postProcessPath
std::vector< Eigen::Vector2f > postProcessPath(const std::vector< Eigen::Vector2f > &path)
Definition:
SPFA.cpp:276
armarx::navigation::global_planning::SPFA::SPFA
SPFA(const Params ¶ms, const core::Scene &ctx)
Definition:
SPFA.cpp:76
armarx::navigation::global_planning::SPFAParams::optimizerParams
optimization::OrientationOptimizerParams optimizerParams
Definition:
SPFA.h:55
armarx::navigation::global_planning::optimization::OrientationOptimizerParams
Definition:
OrientationOptimizer.h:37
ShortestPathFasterAlgorithm.h
armarx::navigation::global_planning::SPFA::~SPFA
~SPFA() override=default
armarx::navigation::global_planning::SPFAParams::algorithm
Algorithms algorithm() const override
Definition:
SPFA.cpp:43
armarx::navigation::global_planning::SPFAParams::angularVelocity
float angularVelocity
Definition:
SPFA.h:44
GlobalPlanner.h
armarx::navigation::global_planning::SPFAParams::algo
algorithms::spfa::ShortestPathFasterAlgorithm::Parameters algo
Definition:
SPFA.h:53
armarx::navigation::core::Scene
Definition:
types.h:71
armarx::navigation::global_planning::GlobalPlanner
Definition:
GlobalPlanner.h:64
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition:
Dict.h:41
armarx::navigation::global_planning::SPFAParams::toAron
aron::data::DictPtr toAron() const override
Definition:
SPFA.cpp:49
armarx::navigation::global_planning::SPFAParams::linearVelocity
float linearVelocity
Definition:
SPFA.h:43
armarx::navigation::global_planning::SPFAParams::FromAron
static SPFAParams FromAron(const aron::data::DictPtr &dict)
Definition:
SPFA.cpp:59
core.h
armarx::navigation::global_planning::SPFA::plan
std::optional< GlobalPlannerResult > plan(const core::Pose &goal) override
Definition:
SPFA.cpp:82
armarx::navigation::global_planning::Algorithms
Algorithms
Definition:
core.h:38
armarx::navigation::global_planning::SPFAParams::resampleDistance
float resampleDistance
Definition:
SPFA.h:51
types.h
armarx::navigation::global_planning::SPFAParams
Parameters for AStar.
Definition:
SPFA.h:41
armarx::navigation::global_planning
This file is part of ArmarX.
Definition:
fwd.h:29
armarx
navigation
global_planning
SPFA.h
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17