world_model.cpp
Go to the documentation of this file.
2 
4 {
7 {
8 }
9 
11 {
13 
14  // get terrain model
15  vigir_pluginlib::PluginManager::getPlugin(terrain_model_);
16  if (terrain_model_)
17  {
18  ROS_INFO("[WorldModel] Found terrain model:");
19  ROS_INFO(" %s (%s)", terrain_model_->getName().c_str(), terrain_model_->getTypeClass().c_str());
20  }
21 }
22 
23 bool WorldModel::loadParams(const vigir_generic_params::ParameterSet& params)
24 {
26 
27  if (terrain_model_)
28  result &= terrain_model_->loadParams(params);
29 
30  return result;
31 }
32 
34 {
36 
37  if (terrain_model_)
38  terrain_model_->reset();
39 }
40 
41 bool WorldModel::isAccessible(const State& s) const
42 {
43  for (CollisionCheckPlugin::Ptr plugin : getPlugins())
44  {
45  if (plugin && plugin->isCollisionCheckAvailable() && !plugin->isAccessible(s))
46  return false;
47  }
48  return true;
49 }
50 
51 bool WorldModel::isAccessible(const State& next, const State& current) const
52 {
53  for (CollisionCheckPlugin::Ptr plugin : getPlugins())
54  {
55  if (plugin && plugin->isCollisionCheckAvailable() && !plugin->isAccessible(next, current))
56  return false;
57  }
58  return true;
59 }
60 
61 void WorldModel::useTerrainModel(bool enabled)
62 {
63  use_terrain_model_ = enabled;
64 }
65 
67 {
68  return terrain_model_ && terrain_model_->isTerrainModelAvailable();
69 }
70 
72 {
73  return terrain_model_;
74 }
75 
76 bool WorldModel::getHeight(double x, double y, double& height) const
77 {
79  return true;
80 
81  return terrain_model_->getHeight(x, y, height);
82 }
83 
85 {
87  return true;
88 
89  return terrain_model_->update3DData(s);
90 }
91 }
TerrainModelPlugin::ConstPtr getTerrainModel() const
Definition: world_model.cpp:71
bool getHeight(double x, double y, double &height) const
update z, roll and pitch of state based on terrain model
Definition: world_model.cpp:76
bool loadParams(const vigir_generic_params::ParameterSet &params) override
Definition: world_model.cpp:23
TerrainModelPlugin::Ptr terrain_model_
Definition: world_model.h:71
#define ROS_INFO(...)
ROSLIB_DECL void getPlugins(const std::string &package, const std::string &attribute, V_string &plugins, bool force_recrawl=false)
bool update3DData(State &s) const
Definition: world_model.cpp:84
bool isAccessible(const State &s) const
Definition: world_model.cpp:41


vigir_footstep_planning_plugins
Author(s): Alexander Stumpf
autogenerated on Mon Jun 10 2019 15:47:39