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 
28 
30 {
31 
33  {
34  float goalDistanceThreshold = 100; // [mm]
35 
36  float minLinearVelocity = 100; // [mm/s]
37  float maxLinearVelocity = 200; // [mm/s]
38  };
39 
41  {
42  public:
44 
45  SimulatedHuman(const algorithms::Costmap& distanceField, const Params& params = Params());
46 
47  Human update();
48 
49 
52  {
53  return human_;
54  }
55 
58  {
59  return globalTrajectory_;
60  }
61 
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,
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 &params=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