quadrotor_hardware_gazebo.h
Go to the documentation of this file.
1 //=================================================================================================
2 // Copyright (c) 2012-2016, Institute of Flight Systems and Automatic Control,
3 // Technische Universität Darmstadt.
4 // All rights reserved.
5 
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of hector_quadrotor nor the names of its contributors
14 // may be used to endorse or promote products derived from this software
15 // without 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 HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_HARDWARE_GAZEBO_H
30 #define HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_HARDWARE_GAZEBO_H
31 
32 #include <ros/node_handle.h>
34 
38 
39 #include <nav_msgs/Odometry.h>
40 #include <sensor_msgs/Imu.h>
41 #include <hector_uav_msgs/MotorStatus.h>
42 #include <hector_uav_msgs/EnableMotors.h>
43 
45 {
46 
47 using namespace hector_quadrotor_interface;
48 
50 {
51 public:
53  virtual ~QuadrotorHardwareSim();
54 
55  virtual bool initSim(
56  const std::string &robot_namespace,
57  ros::NodeHandle model_nh,
58  gazebo::physics::ModelPtr parent_model,
59  const urdf::Model *const urdf_model,
60  std::vector<transmission_interface::TransmissionInfo> transmissions);
61 
62  virtual void readSim(ros::Time time, ros::Duration period);
63 
64  virtual void writeSim(ros::Time time, ros::Duration period);
65 
66  bool enableMotorsCallback(hector_uav_msgs::EnableMotors::Request &req, hector_uav_msgs::EnableMotors::Response &res);
67 
68 private:
69  bool enableMotors(bool enable);
70 
71  std_msgs::Header header_;
72  geometry_msgs::Pose pose_;
73  geometry_msgs::Twist twist_;
74  geometry_msgs::Accel acceleration_;
75  sensor_msgs::Imu imu_;
76  hector_uav_msgs::MotorStatus motor_status_;
77 
79 
82 
84  std::string base_link_frame_, world_frame_;
85 
86  gazebo::physics::ModelPtr model_;
87  gazebo::physics::LinkPtr link_;
88  gazebo::physics::PhysicsEnginePtr physics_;
89 
90 #if (GAZEBO_MAJOR_VERSION >= 8)
91  ignition::math::Pose3d gz_pose_;
92  ignition::math::Vector3d gz_velocity_, gz_acceleration_, gz_angular_velocity_, gz_angular_acceleration_;
93 #else
94  gazebo::math::Pose gz_pose_;
95  gazebo::math::Vector3 gz_velocity_, gz_acceleration_, gz_angular_velocity_, gz_angular_acceleration_;
96 #endif
97 
100 
104 };
105 
106 } // namespace hector_quadrotor_controller_gazebo
107 
108 #endif // HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_HARDWARE_GAZEBO_H
hector_quadrotor_interface::WrenchLimiter wrench_limiter_
boost::shared_ptr< hector_quadrotor_interface::ImuSubscriberHelper > imu_sub_helper_
boost::shared_ptr< hector_quadrotor_interface::OdomSubscriberHelper > odom_sub_helper_


hector_quadrotor_controller_gazebo
Author(s): Johannes Meyer
autogenerated on Mon Jun 10 2019 13:36:51