SimulatedHuman.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 2022
18
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19
* GNU General Public License
20
*/
21
22
#pragma once
23
24
#include <
armarx/navigation/algorithms/Costmap.h
>
25
#include <
armarx/navigation/core/Trajectory.h
>
26
#include <
armarx/navigation/core/basic_types.h
>
27
#include <
armarx/navigation/human/types.h
>
28
29
namespace
armarx::navigation::human::simulation
30
{
31
32
struct
SimulatedHumanParams
33
{
34
float
goalDistanceThreshold
= 100;
// [mm]
35
36
float
minLinearVelocity
= 100;
// [mm/s]
37
float
maxLinearVelocity
= 200;
// [mm/s]
38
};
39
40
class
SimulatedHuman
41
{
42
public
:
43
using
Params
=
SimulatedHumanParams
;
44
45
SimulatedHuman
(
const
algorithms::Costmap
& distanceField,
const
Params
& params =
Params
());
46
47
Human
update
();
48
49
50
human::Human
&
51
human
()
52
{
53
return
human_;
54
}
55
56
core::GlobalTrajectory
&
57
trajectory
()
58
{
59
return
globalTrajectory_;
60
}
61
62
const
core::GlobalTrajectory
&
63
trajectory
()
const
64
{
65
return
globalTrajectory_;
66
}
67
68
bool
goalReached
()
const
;
69
70
/**
71
* @brief resets the human to the given pose and replans the global optimal trajectory
72
*
73
* @param pose
74
*/
75
void
reinitialize
(
const
core::Pose2D
& pose);
76
77
protected
:
78
void
initialize
();
79
80
void
step
();
81
82
enum class
State
83
{
84
Idle
,
85
Walking
,
86
GoalReached
87
};
88
89
90
private
:
91
const
algorithms::Costmap
distanceField_;
92
93
State
state_ =
State::Idle
;
94
95
human::Human
human_;
96
97
core::GlobalTrajectory
globalTrajectory_;
98
99
const
Params
params_;
100
};
101
102
}
// namespace armarx::navigation::human::simulation
armarx::navigation::core::GlobalTrajectory
Definition:
Trajectory.h:68
armarx::navigation::human::Human
Definition:
types.h:33
armarx::navigation::human::simulation::SimulatedHuman::step
void step()
Definition:
SimulatedHuman.cpp:159
basic_types.h
armarx::navigation::human::simulation::SimulatedHuman::human
human::Human & human()
Definition:
SimulatedHuman.h:51
armarx::navigation::human::simulation::SimulatedHuman::Params
SimulatedHumanParams Params
Definition:
SimulatedHuman.h:43
types.h
armarx::navigation::human::simulation::SimulatedHumanParams::goalDistanceThreshold
float goalDistanceThreshold
Definition:
SimulatedHuman.h:34
armarx::navigation::human::simulation::SimulatedHuman
Definition:
SimulatedHuman.h:40
armarx::navigation::human::simulation::SimulatedHuman::goalReached
bool goalReached() const
Definition:
SimulatedHuman.cpp:78
armarx::navigation::human::simulation::SimulatedHuman::State
State
Definition:
SimulatedHuman.h:82
armarx::navigation::core::Pose2D
Eigen::Isometry2f Pose2D
Definition:
basic_types.h:34
Costmap.h
armarx::navigation::human::simulation::SimulatedHuman::reinitialize
void reinitialize(const core::Pose2D &pose)
resets the human to the given pose and replans the global optimal trajectory
Definition:
SimulatedHuman.cpp:87
armarx::navigation::human::simulation::SimulatedHumanParams::minLinearVelocity
float minLinearVelocity
Definition:
SimulatedHuman.h:36
armarx::navigation::human::simulation::SimulatedHuman::trajectory
core::GlobalTrajectory & trajectory()
Definition:
SimulatedHuman.h:57
armarx::navigation::human::simulation::SimulatedHuman::initialize
void initialize()
Definition:
SimulatedHuman.cpp:102
armarx::navigation::human::simulation
This file is part of ArmarX.
Definition:
SimulatedHuman.cpp:38
armarx::navigation::human::simulation::SimulatedHuman::SimulatedHuman
SimulatedHuman(const algorithms::Costmap &distanceField, const Params ¶ms=Params())
Definition:
SimulatedHuman.cpp:188
armarx::navigation::human::simulation::SimulatedHumanParams
Definition:
SimulatedHuman.h:32
armarx::navigation::human::simulation::SimulatedHuman::State::GoalReached
@ GoalReached
armarx::State
Definition:
State.h:54
armarx::navigation::human::simulation::SimulatedHuman::update
Human update()
Definition:
SimulatedHuman.cpp:43
armarx::navigation::human::simulation::SimulatedHumanParams::maxLinearVelocity
float maxLinearVelocity
Definition:
SimulatedHuman.h:37
armarx::navigation::human::simulation::SimulatedHuman::State::Idle
@ Idle
armarx::navigation::human::simulation::SimulatedHuman::State::Walking
@ Walking
Trajectory.h
armarx::navigation::human::simulation::SimulatedHuman::trajectory
const core::GlobalTrajectory & trajectory() const
Definition:
SimulatedHuman.h:63
armarx::navigation::algorithms::Costmap
Definition:
Costmap.h:13
armarx
navigation
simulation
SimulatedHuman.h
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17