nmea_gps_plugin.h
Go to the documentation of this file.
1 #ifndef NMEA_GPS_PLUGIN_NMEA_GPS_PLUGIN_H_INCLUDED
2 #define NMEA_GPS_PLUGIN_NMEA_GPS_PLUGIN_H_INCLUDED
3 
14 // Headers in Gazebo
15 #include <gazebo/common/Plugin.hh>
16 #include <gazebo/physics/Model.hh>
17 #include <gazebo/physics/Link.hh>
18 #include <gazebo/physics/World.hh>
19 #include <gazebo/physics/physics.hh>
20 #include <gazebo/util/system.hh>
21 
22 // Headers in ROS
23 #include <ros/ros.h>
24 #include <nmea_msgs/Sentence.h>
25 #include <geographic_msgs/GeoPose.h>
27 #include <geodesy/utm.h>
28 #include <geodesy/wgs84.h>
29 
30 // Headers in STL
31 #include <time.h>
32 #include <math.h>
33 #include <memory>
34 #include <iomanip>
35 
36 // Headers in this package
38 
39 // Headers in Boost
40 #include <boost/optional.hpp>
41 
42 namespace nmea_gps_plugin
43 {
48  namespace default_param
49  {
54  constexpr double reference_longitude = 0.0;
59  constexpr double reference_latitude = 0.0;
64  constexpr double reference_heading = 0.0;
69  constexpr double reference_altitude = 0.0;
74  constexpr double publish_rate = 1.0;
79  const std::string nmea_topic = "/nmea_sentence";
84  constexpr double position_gaussiaa_noise = 0.05;
89  constexpr double orientation_gaussian_noise = 0.05;
94  constexpr double velocity_gaussian_noise = 0.05;
95  }
96 }
97 
98 namespace gazebo
99 {
104  class NmeaGpsPlugin : public ModelPlugin
105  {
106  public:
107  NmeaGpsPlugin();
108  virtual ~NmeaGpsPlugin();
109  protected:
114  virtual void Load(physics::ModelPtr model, sdf::ElementPtr sdf);
119  virtual void Reset();
124  virtual void Update();
125  private:
126  physics::WorldPtr world_ptr_;
127  physics::LinkPtr link_ptr_;
128  physics::ModelPtr model_ptr_;
130  std::string namespace_;
131  std::string link_name_;
132  std::string frame_id_;
133  std::string nmea_topic_;
140  geographic_msgs::GeoPose initial_pose_;
141  geographic_msgs::GeoPose current_geo_pose_;
143  //UpdateTimer update_timer_;
144  event::ConnectionPtr update_connection_;
145  boost::optional<common::Time> last_publish_timestamp_;
146  std::string getCheckSum(std::string sentence);
151  std::string getUnixTime(ros::Time stamp);
156  std::string getUnixDay(ros::Time stamp);
161  nmea_msgs::Sentence getGPRMC(ros::Time stamp);
166  nmea_msgs::Sentence getGPGGA(ros::Time stamp);
171  nmea_msgs::Sentence getGPVTG(ros::Time stamp);
172  nmea_msgs::Sentence getGPHDT(ros::Time stamp);
177  std::string convertToDmm(double value);
178  std::string getHexString(uint8_t value);
179  geometry_msgs::Twist current_twist_;
180  std::unique_ptr<GpsSensorModel> sensor_model_ptr_;
184 #if (GAZEBO_MAJOR_VERSION >= 8)
185  boost::optional<ignition::math::Pose3d> initial_gazebo_pose_;
186 #else
187  boost::optional<gazebo::math::Pose> initial_gazebo_pose_;
188 #endif
189  };
190 }
191 
192 #endif //NMEA_GPS_PLUGIN_NMEA_GPS_PLUGIN_H_INCLUDED
constexpr double reference_altitude
initial altitude of the robot
Sensor model of the nmea GPS plugin.
geodesy::UTMPose initial_utm_pose_
geographic_msgs::GeoPose current_geo_pose_
physics::ModelPtr model_ptr_
constexpr double position_gaussiaa_noise
gaussian noise of the posision
constexpr double publish_rate
publish rate of the each sentence
constexpr double reference_longitude
initial longitude of the robot
const std::string nmea_topic
topic name of the nmea_sentence topic
geometry_msgs::Twist current_twist_
boost::optional< gazebo::math::Pose > initial_gazebo_pose_
constexpr double reference_heading
nitial heading of the robot
boost::optional< common::Time > last_publish_timestamp_
std::unique_ptr< GpsSensorModel > sensor_model_ptr_
ros::Publisher nmea_pub_
physics::WorldPtr world_ptr_
ros::NodeHandle node_handle_
event::ConnectionPtr update_connection_
geographic_msgs::GeoPose initial_pose_
constexpr double orientation_gaussian_noise
gaussian noise of the orientation
physics::LinkPtr link_ptr_
Class of the NMEA gps plugin.
constexpr double velocity_gaussian_noise
gaussian noise of the velocity
constexpr double reference_latitude
initial longitude of the robot


nmea_gps_plugin
Author(s):
autogenerated on Wed Jul 17 2019 03:51:23