ardrone_driver.h
Go to the documentation of this file.
1 
25 #ifndef ARDRONE_AUTONOMY_ARDRONE_DRIVER_H
26 #define ARDRONE_AUTONOMY_ARDRONE_DRIVER_H
27 
28 class ARDroneDriver;
29 
30 // ROS
31 #include <ros/ros.h>
35 #include <sensor_msgs/Image.h>
36 #include <sensor_msgs/Imu.h>
37 #include <geometry_msgs/Vector3Stamped.h>
38 #include <std_srvs/Empty.h>
39 #include <nav_msgs/Odometry.h>
40 #include <ardrone_autonomy/Navdata.h>
42 
43 // C/C++
44 #include <stdint.h>
45 #include <vector>
46 #include <string>
47 
48 // ardronelib
49 #include <utils/ardrone_gen_ids.h>
50 #include <ardrone_tool/ardrone_version.h>
51 #include <ardrone_tool/ardrone_tool.h>
52 
53 // Load auto-generated include files for full navdata
54 #define NAVDATA_STRUCTS_INCLUDES
56 #undef NAVDATA_STRUCTS_INCLUDES
57 
58 #define _DEG2RAD 0.01745331111
59 #define _RAD2DEG 57.2957184819
60 
61 #define DRIVER_USERNAME "ardrone_driver"
62 #define DRIVER_APPNAME "ardrone_driver"
63 #define CAMERA_QUEUE_SIZE (30)
64 #define NAVDATA_QUEUE_SIZE (200)
65 
67 {
68 public:
69  ARDroneDriver();
71  void run();
72  static bool ReadCovParams(const std::string& param_name, boost::array<double, 9> &cov_array);
73  static double CalcAverage(const std::vector<double> &vec);
74  void PublishVideo();
75  void PublishNavdata(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time);
76  void PublishOdometry(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time);
77 
78 #define NAVDATA_STRUCTS_HEADER_PUBLIC
80 #undef NAVDATA_STRUCTS_HEADER_PUBLIC
81 
82 private:
83  void PublishTF();
84  void ConfigureDrone();
85 
96 
99 
104 
106 
113 
114  int32_t last_frame_id;
118 
119  int16_t flying_state;
120 
121  bool is_inited;
122  std::string drone_frame_id;
123 
124  // Load auto-generated declarations for full navdata
125 #define NAVDATA_STRUCTS_HEADER_PRIVATE
127 #undef NAVDATA_STRUCTS_HEADER_PRIVATE
128 
129  /*
130  * TF Frames
131  * Base: Should be COM
132  */
135 
136  // Huge part of IMU message is constant, let's fill'em once.
137  sensor_msgs::Imu imu_msg;
138  geometry_msgs::Vector3Stamped mag_msg;
139  ardrone_autonomy::Navdata legacynavdata_msg;
140 
141  // odometry (x,y)
143  double odometry[2];
144 };
145 
146 #endif // ARDRONE_AUTONOMY_ARDRONE_DRIVER_H
static double CalcAverage(const std::vector< double > &vec)
ros::Publisher mag_pub
ros::Subscriber takeoff_sub
ros::Subscriber land_sub
std::string drone_frame_id
camera_info_manager::CameraInfoManager * cinfo_hori
camera_info_manager::CameraInfoManager * cinfo_vert
ros::Publisher navdata_pub
tf::StampedTransform tf_base_front
ros::Subscriber reset_sub
int32_t last_navdata_id
int32_t copy_current_navdata_id
tf::TransformBroadcaster tf_broad
image_transport::CameraPublisher vert_pub
void PublishOdometry(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time)
image_transport::CameraPublisher hori_pub
video_decoder_config_t vec
image_transport::CameraPublisher image_pub
int32_t copy_current_frame_id
ardrone_autonomy::Navdata legacynavdata_msg
ros::Time last_receive_time
ros::Publisher odo_pub
std::string drone_frame_base
tf::StampedTransform tf_base_bottom
tf::StampedTransform tf_odom
ros::ServiceServer flat_trim_srv
ros::Publisher imu_pub
ros::ServiceServer set_cam_channel_srv
image_transport::ImageTransport image_transport
ros::ServiceServer toggle_cam_srv
ros::ServiceServer set_flight_anim_srv
static bool ReadCovParams(const std::string &param_name, boost::array< double, 9 > &cov_array)
std::string tf_prefix
int32_t last_frame_id
int16_t flying_state
ros::ServiceServer set_record_srv
std::string drone_frame_imu
ros::ServiceServer set_led_animation_srv
std::string drone_frame_front_cam
double odometry[2]
ros::NodeHandle private_nh
ros::NodeHandle node_handle
geometry_msgs::Vector3Stamped mag_msg
ros::Subscriber cmd_vel_sub
void PublishNavdata(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time)
sensor_msgs::Imu imu_msg
std::string drone_frame_bottom_cam


ardrone_autonomy
Author(s): Mani Monajjemi, Mani Monajjemi
autogenerated on Mon Jun 10 2019 12:39:49