gazebo_octomap_plugin.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
3  * Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
4  * Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
5  * Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
6  * Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland
7  * Copyright 2016 Geoffrey Hunter <gbmhunter@gmail.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef ROTORS_GAZEBO_PLUGINS_GAZEBO_OCTOMAP_PLUGIN_H
23 #define ROTORS_GAZEBO_PLUGINS_GAZEBO_OCTOMAP_PLUGIN_H
24 
25 #include <iostream>
26 #include <math.h>
27 
29 #include <gazebo/common/common.hh>
30 #include <gazebo/gazebo.hh>
31 #include <gazebo/physics/physics.hh>
32 #include <octomap/octomap.h>
33 #include <ros/ros.h>
34 #include <rotors_comm/Octomap.h>
35 #include <sdf/sdf.hh>
36 #include <std_srvs/Empty.h>
37 
38 namespace gazebo {
39 
43 class OctomapFromGazeboWorld : public WorldPlugin {
44  public:
46  : WorldPlugin(), node_handle_(kDefaultNamespace), octomap_(NULL) {}
47  virtual ~OctomapFromGazeboWorld();
48 
49  protected:
50 
54  void Load(physics::WorldPtr _parent, sdf::ElementPtr _sdf);
55 
56  bool CheckIfInterest(const ignition::math::Vector3d & central_point,
57  gazebo::physics::RayShapePtr ray,
58  const double leaf_size);
59 
60  void FloodFill(const ignition::math::Vector3d & seed_point,
61  const ignition::math::Vector3d & bounding_box_origin,
62  const ignition::math::Vector3d & bounding_box_lengths,
63  const double leaf_size);
64 
81  void CreateOctomap(const rotors_comm::Octomap::Request& msg);
82 
83  private:
84  physics::WorldPtr world_;
89  bool ServiceCallback(rotors_comm::Octomap::Request& req,
90  rotors_comm::Octomap::Response& res);
91 };
92 
93 } // namespace gazebo
94 
95 #endif // ROTORS_GAZEBO_PLUGINS_GAZEBO_OCTOMAP_PLUGIN_H
msg
bool ServiceCallback(rotors_comm::Octomap::Request &req, rotors_comm::Octomap::Response &res)
void FloodFill(const ignition::math::Vector3d &seed_point, const ignition::math::Vector3d &bounding_box_origin, const ignition::math::Vector3d &bounding_box_lengths, const double leaf_size)
void Load(physics::WorldPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
static const std::string kDefaultNamespace
Definition: common.h:48
void CreateOctomap(const rotors_comm::Octomap::Request &msg)
Creates octomap by floodfilling freespace.
bool CheckIfInterest(const ignition::math::Vector3d &central_point, gazebo::physics::RayShapePtr ray, const double leaf_size)
Octomap plugin for Gazebo.


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04