terrain_model.h
Go to the documentation of this file.
1 //=================================================================================================
2 // Copyright (c) 2018, Alexander Stumpf, TU Darmstadt
3 // All rights reserved.
4 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of the Simulation, Systems Optimization and Robotics
13 // group, TU Darmstadt nor the names of its contributors may be used to
14 // endorse or promote products derived from this software without
15 // specific prior written permission.
16 
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //=================================================================================================
28 
29 #ifndef VIGIR_FOOTSTEP_PLANNING_TERRAIN_MODEL_H__
30 #define VIGIR_FOOTSTEP_PLANNING_TERRAIN_MODEL_H__
31 
32 #include <ros/ros.h>
33 
34 #include <boost/thread/mutex.hpp>
35 
36 #include <pcl/point_cloud.h>
37 
38 #include <vigir_footstep_planning_lib/modeling/state.h>
39 
40 #include <vigir_footstep_planning_plugins/plugins/terrain_model_plugin.h>
41 
42 #include <vigir_terrain_classifier/terrain_model.h>
43 
44 
45 
47 {
49  : public TerrainModelPlugin
50 {
51 public:
52  TerrainModel(const std::string& name = "terrain_model");
53 
54  bool initialize(const vigir_generic_params::ParameterSet& params = vigir_generic_params::ParameterSet()) override;
55 
56  bool loadParams(const vigir_generic_params::ParameterSet& params = vigir_generic_params::ParameterSet()) override;
57 
58  void reset();
59 
60  bool isAccessible(const State& s) const override;
61  bool isAccessible(const State& next, const State& current) const override;
62 
63  bool isTerrainModelAvailable() const override;
64 
65  void setTerrainModel(const vigir_terrain_classifier::TerrainModelMsg::ConstPtr& terrain_model);
66 
67  double getResolution() const override;
68 
69  bool getPointWithNormal(const pcl::PointNormal& p_search, pcl::PointNormal& p_result) const override;
70  bool getHeight(double x, double y, double& height) const override;
71  bool getFootContactSupport(const geometry_msgs::Pose& p, double& support, pcl::PointCloud<pcl::PointXYZI>::Ptr checked_positions = pcl::PointCloud<pcl::PointXYZI>::Ptr()) const override;
72  bool getFootContactSupport(const tf::Pose& p, double& support, pcl::PointCloud<pcl::PointXYZI>::Ptr checked_positions = pcl::PointCloud<pcl::PointXYZI>::Ptr()) const;
73 
74  bool update3DData(geometry_msgs::Pose& p) const override;
75  bool update3DData(State& s) const override;
76 
77  // typedefs
80 
81 protected:
82  bool getFootContactSupport(const tf::Pose& p, double &support, unsigned int sampling_steps_x, unsigned int sampling_steps_y, pcl::PointCloud<pcl::PointXYZI>::Ptr checked_positions = pcl::PointCloud<pcl::PointXYZI>::Ptr()) const;
83 
84  // subscribers
86 
87  // mutex
88  mutable boost::shared_mutex terrain_model_shared_mutex;
89 
90  vigir_terrain_classifier::TerrainModel::Ptr terrain_model;
91 
92  // ground contact support estimation parameters
93  unsigned int min_sampling_steps_x; // min number of sampling steps in y
94  unsigned int min_sampling_steps_y; // min number of sampling steps in y
95  unsigned int max_sampling_steps_x; // max number of sampling steps in y
96  unsigned int max_sampling_steps_y; // max number of sampling steps in y
97  double max_intrusion_z; // how deep the foot may intrude into other objects (z axis only)#
98  double max_ground_clearance; // maximal distance before a point is treated as "in the air"
99  double minimal_support; // minimal percentage of foot sole area which must touch ground
100 
101  // robot params
102  geometry_msgs::Vector3 foot_size;
103 };
104 }
105 
106 #endif
vigir_terrain_classifier::TerrainModel::Ptr terrain_model
Definition: terrain_model.h:90
bool getHeight(double x, double y, double &height) const override
XmlRpcServer s
boost::shared_ptr< TerrainModel > ConstPtr
Definition: terrain_model.h:79
bool getPointWithNormal(const pcl::PointNormal &p_search, pcl::PointNormal &p_result) const override
TerrainModel(const std::string &name="terrain_model")
bool initialize(const vigir_generic_params::ParameterSet &params=vigir_generic_params::ParameterSet()) override
void setTerrainModel(const vigir_terrain_classifier::TerrainModelMsg::ConstPtr &terrain_model)
bool getFootContactSupport(const geometry_msgs::Pose &p, double &support, pcl::PointCloud< pcl::PointXYZI >::Ptr checked_positions=pcl::PointCloud< pcl::PointXYZI >::Ptr()) const override
bool loadParams(const vigir_generic_params::ParameterSet &params=vigir_generic_params::ParameterSet()) override
boost::shared_ptr< TerrainModel > Ptr
Definition: terrain_model.h:78
bool update3DData(geometry_msgs::Pose &p) const override
boost::shared_mutex terrain_model_shared_mutex
Definition: terrain_model.h:88
double getResolution() const override
bool isTerrainModelAvailable() const override
bool isAccessible(const State &s) const override


vigir_footstep_planning_default_plugins
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:01