25 #ifndef BEBOP_AUTONOMY_BEBOP_DRIVER_NODELET_H 26 #define BEBOP_AUTONOMY_BEBOP_DRIVER_NODELET_H 34 #include <geometry_msgs/Twist.h> 35 #include <std_msgs/Empty.h> 36 #include <std_msgs/UInt8.h> 37 #include <std_msgs/Float32.h> 38 #include <std_msgs/Bool.h> 39 #include <std_msgs/String.h> 42 #include <dynamic_reconfigure/server.h> 44 #include <boost/thread.hpp> 45 #include <boost/shared_ptr.hpp> 49 #define CLAMP(x, l, h) (((x) > (h)) ? (h) : (((x) < (l)) ? (l) : (x))) 63 ros::console::levels::Debug};
65 static const double eps = 1.0e-6;
66 static const double deg2rad = 3.14159265 / 180.0;
82 inline bool CompareTwists(
const geometry_msgs::Twist& lhs,
const geometry_msgs::Twist& rhs)
84 return (fabs(lhs.linear.x - rhs.linear.x) < eps) &&
85 (fabs(lhs.linear.y - rhs.linear.y) <
eps) &&
86 (fabs(lhs.linear.z - rhs.linear.z) <
eps) &&
87 (fabs(lhs.angular.x - rhs.angular.x) <
eps) &&
88 (fabs(lhs.angular.y - rhs.angular.y) <
eps) &&
89 (fabs(lhs.angular.z - rhs.angular.z) <
eps);
92 int BebopPrintToROSLogCB(eARSAL_PRINT_LEVEL level,
const char *tag,
const char *format, va_list va);
96 class BebopArdrone3Config;
148 void CameraPublisherThread();
153 void CmdVelCallback(
const geometry_msgs::TwistConstPtr& twist_ptr);
154 void CameraMoveCallback(
const geometry_msgs::TwistConstPtr& twist_ptr);
155 void TakeoffCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
156 void LandCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
157 void EmergencyCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
158 void FlatTrimCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
159 void NavigateHomeCallback(
const std_msgs::BoolConstPtr& start_stop_ptr);
160 void StartAutonomousFlightCallback(
const std_msgs::StringConstPtr& file_path_ptr);
161 void PauseAutonomousFlightCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
162 void StopAutonomousFlightCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
163 void FlipAnimationCallback(
const std_msgs::UInt8ConstPtr& animid_ptr);
164 void TakeSnapshotCallback(
const std_msgs::EmptyConstPtr& empty_ptr);
165 void SetExposureCallback(
const std_msgs::Float32ConstPtr& exposure_ptr);
166 void ToggleRecordingCallback(
const std_msgs::BoolConstPtr& toggle_ptr);
168 void ParamCallback(bebop_driver::BebopArdrone3Config &config, uint32_t level);
174 virtual void onInit();
178 #endif // BEBOP_AUTONOMY_BEBOP_DRIVER_NODELET_H std::string param_camera_frame_id_
ros::Publisher camera_joint_pub_
ros::Subscriber stop_autoflight_sub_
double param_cmd_vel_timeout_
boost::shared_ptr< boost::thread > aux_thread_ptr_
boost::shared_ptr< image_transport::ImageTransport > image_transport_ptr_
geometry_msgs::Twist camera_twist_
image_transport::CameraPublisher image_transport_pub_
boost::shared_ptr< boost::thread > camera_pub_thread_ptr_
boost::shared_ptr< dynamic_reconfigure::Server< bebop_driver::BebopArdrone3Config > > dynr_serv_ptr_
static char bebop_err_str[BEBOP_ERR_STR_SZ]
ros::Subscriber animation_sub_
bool CompareTwists(const geometry_msgs::Twist &lhs, const geometry_msgs::Twist &rhs)
ros::Subscriber exposure_sub_
sensor_msgs::CameraInfoPtr camera_info_msg_ptr_
ros::Publisher gps_fix_pub_
bool param_publish_odom_tf_
ros::Subscriber land_sub_
ros::Subscriber start_autoflight_sub_
int BebopPrintToROSLogCB(eARSAL_PRINT_LEVEL level, const char *tag, const char *format, va_list va)
void ResetTwist(geometry_msgs::Twist &t)
geometry_msgs::Twist prev_camera_twist_
ros::Subscriber navigatehome_sub_
std::string param_odom_frame_id_
boost::shared_ptr< bebop_driver::Bebop > bebop_ptr_
boost::mutex twist_mutex_
ros::Subscriber flattrim_sub_
ros::Subscriber snapshot_sub_
boost::shared_ptr< camera_info_manager::CameraInfoManager > cinfo_manager_ptr_
static const double deg2rad
ros::Subscriber pause_autoflight_sub_
static const ros::console::levels::Level arsal_level_to_ros[ARSAL_PRINT_MAX]
ros::Subscriber takeoff_sub_
ros::Subscriber toggle_recording_sub_
geometry_msgs::Twist prev_bebop_twist_
ros::Time prev_twist_stamp_
ros::Subscriber reset_sub_
ros::Subscriber camera_move_sub_
ros::Subscriber cmd_vel_sub_