PoseGTROSPlugin.hh
Go to the documentation of this file.
1 // Copyright (c) 2016 The UUV Simulator Authors.
2 // All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 // This source code is derived from gazebo_ros_pkgs
17 // (https://github.com/ros-simulation/gazebo_ros_pkgs)
18 // * Copyright 2012 Open Source Robotics Foundation,
19 // licensed under the Apache-2.0 license,
20 // cf. 3rd-party-licenses.txt file in the root directory of this source tree.
21 //
22 // The original code was modified to:
23 // - be more consistent with other sensor plugins within uuv_simulator,
24 // - adhere to Gazebo's coding standards.
25 
26 #ifndef __UUV_POSE_GT_SENSOR_ROS_PLUGIN_HH__
27 #define __UUV_POSE_GT_SENSOR_ROS_PLUGIN_HH__
28 
29 #include <gazebo/gazebo.hh>
30 #include <ros/ros.h>
31 #include <nav_msgs/Odometry.h>
32 #include <gazebo/physics/physics.hh>
33 #include <geometry_msgs/TransformStamped.h>
35 #include <boost/shared_ptr.hpp>
37 
38 namespace gazebo
39 {
41  {
43  public: PoseGTROSPlugin();
44 
46  public: ~PoseGTROSPlugin();
47 
49  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
50 
52  protected: virtual bool OnUpdate(const common::UpdateInfo& _info);
53 
54  protected: void PublishNEDOdomMessage(common::Time _time,
55  ignition::math::Pose3d _pose, ignition::math::Vector3d _linVel,
56  ignition::math::Vector3d _angVel);
57 
58  protected: void PublishOdomMessage(common::Time _time,
59  ignition::math::Pose3d _pose, ignition::math::Vector3d _linVel,
60  ignition::math::Vector3d _angVel);
61 
62  protected: void UpdateNEDTransform();
63 
65 
67  protected: ignition::math::Pose3d offset;
68 
69  protected: std::string nedFrameID;
70 
71  protected: ignition::math::Pose3d nedTransform;
72 
73  protected: bool nedTransformIsInit;
74 
75  protected: bool publishNEDOdom;
76 
78 
80 
81  protected: ignition::math::Vector3d lastLinVel;
82  protected: ignition::math::Vector3d lastAngVel;
83  protected: ignition::math::Vector3d linAcc;
84  protected: ignition::math::Vector3d angAcc;
85  protected: ignition::math::Vector3d lastRefLinVel;
86  protected: ignition::math::Vector3d lastRefAngVel;
87  protected: ignition::math::Vector3d refLinAcc;
88  protected: ignition::math::Vector3d refAngAcc;
89  };
90 }
91 
92 #endif // __UUV_POSE_GT_SENSOR_ROS_PLUGIN_HH__
ignition::math::Vector3d lastRefAngVel
ignition::math::Vector3d lastRefLinVel
ignition::math::Pose3d nedTransform
ignition::math::Pose3d offset
Pose offset.
~PoseGTROSPlugin()
Class destructor.
virtual bool OnUpdate(const common::UpdateInfo &_info)
Update sensor measurement.
tf2_ros::Buffer tfBuffer
ignition::math::Vector3d linAcc
ignition::math::Vector3d angAcc
void PublishOdomMessage(common::Time _time, ignition::math::Pose3d _pose, ignition::math::Vector3d _linVel, ignition::math::Vector3d _angVel)
ignition::math::Vector3d lastAngVel
ignition::math::Vector3d lastLinVel
ignition::math::Vector3d refLinAcc
boost::shared_ptr< tf2_ros::TransformListener > tfListener
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load the plugin.
PoseGTROSPlugin()
Class constructor.
void PublishNEDOdomMessage(common::Time _time, ignition::math::Pose3d _pose, ignition::math::Vector3d _linVel, ignition::math::Vector3d _angVel)
ignition::math::Vector3d refAngAcc


uuv_sensor_ros_plugins
Author(s): Musa Morena Marcusso Manhaes , Sebastian Scherer , Luiz Ricardo Douat
autogenerated on Mon Jul 1 2019 19:39:20