ardrone3_state_callbacks.h
Go to the documentation of this file.
00001 
00030 #ifndef BEBOP_AUTONOMY_AUTOGENERATED_ardrone3_STATE_CALLBACKS_H
00031 #define BEBOP_AUTONOMY_AUTOGENERATED_ardrone3_STATE_CALLBACKS_H
00032 
00033 extern "C"
00034 {
00035   #include "libARSAL/ARSAL.h"
00036   #include "libARController/ARController.h"
00037 }
00038 
00039 #include "bebop_driver/autogenerated/callbacks_common.h"
00040 #include "bebop_driver/BebopArdrone3Config.h"
00041 
00042 #include "bebop_msgs/Ardrone3MediaRecordStatePictureStateChanged.h"
00043 #include "bebop_msgs/Ardrone3MediaRecordStateVideoStateChanged.h"
00044 #include "bebop_msgs/Ardrone3MediaRecordStatePictureStateChangedV2.h"
00045 #include "bebop_msgs/Ardrone3MediaRecordStateVideoStateChangedV2.h"
00046 #include "bebop_msgs/Ardrone3MediaRecordStateVideoResolutionState.h"
00047 #include "bebop_msgs/Ardrone3PilotingStateFlatTrimChanged.h"
00048 #include "bebop_msgs/Ardrone3PilotingStateFlyingStateChanged.h"
00049 #include "bebop_msgs/Ardrone3PilotingStateAlertStateChanged.h"
00050 #include "bebop_msgs/Ardrone3PilotingStateNavigateHomeStateChanged.h"
00051 #include "bebop_msgs/Ardrone3PilotingStatePositionChanged.h"
00052 #include "bebop_msgs/Ardrone3PilotingStateSpeedChanged.h"
00053 #include "bebop_msgs/Ardrone3PilotingStateAttitudeChanged.h"
00054 #include "bebop_msgs/Ardrone3PilotingStateAutoTakeOffModeChanged.h"
00055 #include "bebop_msgs/Ardrone3PilotingStateAltitudeChanged.h"
00056 #include "bebop_msgs/Ardrone3PilotingStateGpsLocationChanged.h"
00057 #include "bebop_msgs/Ardrone3PilotingStateLandingStateChanged.h"
00058 #include "bebop_msgs/Ardrone3PilotingStateAirSpeedChanged.h"
00059 #include "bebop_msgs/Ardrone3PilotingStatemoveToChanged.h"
00060 #include "bebop_msgs/Ardrone3NetworkStateWifiScanListChanged.h"
00061 #include "bebop_msgs/Ardrone3NetworkStateAllWifiScanChanged.h"
00062 #include "bebop_msgs/Ardrone3NetworkStateWifiAuthChannelListChanged.h"
00063 #include "bebop_msgs/Ardrone3NetworkStateAllWifiAuthChannelChanged.h"
00064 #include "bebop_msgs/Ardrone3MediaStreamingStateVideoEnableChanged.h"
00065 #include "bebop_msgs/Ardrone3MediaStreamingStateVideoStreamModeChanged.h"
00066 #include "bebop_msgs/Ardrone3CameraStateOrientation.h"
00067 #include "bebop_msgs/Ardrone3CameraStatedefaultCameraOrientation.h"
00068 #include "bebop_msgs/Ardrone3CameraStateOrientationV2.h"
00069 #include "bebop_msgs/Ardrone3CameraStatedefaultCameraOrientationV2.h"
00070 #include "bebop_msgs/Ardrone3CameraStateVelocityRange.h"
00071 #include "bebop_msgs/Ardrone3AntiflickeringStateelectricFrequencyChanged.h"
00072 #include "bebop_msgs/Ardrone3AntiflickeringStatemodeChanged.h"
00073 #include "bebop_msgs/Ardrone3GPSStateNumberOfSatelliteChanged.h"
00074 #include "bebop_msgs/Ardrone3GPSStateHomeTypeAvailabilityChanged.h"
00075 #include "bebop_msgs/Ardrone3GPSStateHomeTypeChosenChanged.h"
00076 #include "bebop_msgs/Ardrone3PROStateFeatures.h"
00077 #include "bebop_msgs/Ardrone3AccessoryStateConnectedAccessories.h"
00078 
00079 namespace bebop_driver
00080 {
00081 namespace cb
00082 {
00083 
00084 
00085 // Picture state.
00086 class Ardrone3MediaRecordStatePictureStateChanged : public AbstractState
00087 {
00088 private:
00089   ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChanged::Ptr msg_ptr;
00090 
00091 public:
00092 
00093   Ardrone3MediaRecordStatePictureStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00094     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED)
00095   {
00096     if (priv_nh.getParam("states/enable_mediarecordstate_picturestatechanged", pub_enabled_) && pub_enabled_)
00097     {
00098       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00099       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaRecordStatePictureStateChanged>(topic, 10, true);
00100     } // pub_enabled_ is false
00101   }
00102 
00103   ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChanged::ConstPtr GetDataCstPtr() const
00104   {
00105     ::boost::lock_guard<boost::mutex> lock(mutex_);
00106     return msg_ptr;
00107   }
00108 
00109   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00110   {
00111     if (arguments == NULL)
00112     {
00113       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaRecordStatePictureStateChanged::Update() arguments is NULL");
00114       return;
00115     }
00116 
00117     ::boost::lock_guard<boost::mutex> lock(mutex_);
00118     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChanged());
00119     msg_ptr->header.stamp = t;
00120     msg_ptr->header.frame_id = "base_link";
00121 
00122 
00123     arg = NULL;
00124     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_STATE, arg);
00125     if (arg)
00126     {
00127       msg_ptr->state = arg->value.U8;
00128     }
00129 
00130     arg = NULL;
00131     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_MASS_STORAGE_ID, arg);
00132     if (arg)
00133     {
00134       msg_ptr->mass_storage_id = arg->value.U8;
00135     }
00136 
00137     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00138   }
00139 
00140 };  // Ardrone3MediaRecordStatePictureStateChanged
00141 
00142 
00143 // Picture record state.
00144 class Ardrone3MediaRecordStateVideoStateChanged : public AbstractState
00145 {
00146 private:
00147   ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChanged::Ptr msg_ptr;
00148 
00149 public:
00150 
00151   Ardrone3MediaRecordStateVideoStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00152     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED)
00153   {
00154     if (priv_nh.getParam("states/enable_mediarecordstate_videostatechanged", pub_enabled_) && pub_enabled_)
00155     {
00156       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00157       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaRecordStateVideoStateChanged>(topic, 10, true);
00158     } // pub_enabled_ is false
00159   }
00160 
00161   ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChanged::ConstPtr GetDataCstPtr() const
00162   {
00163     ::boost::lock_guard<boost::mutex> lock(mutex_);
00164     return msg_ptr;
00165   }
00166 
00167   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00168   {
00169     if (arguments == NULL)
00170     {
00171       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaRecordStateVideoStateChanged::Update() arguments is NULL");
00172       return;
00173     }
00174 
00175     ::boost::lock_guard<boost::mutex> lock(mutex_);
00176     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChanged());
00177     msg_ptr->header.stamp = t;
00178     msg_ptr->header.frame_id = "base_link";
00179 
00180 
00181     arg = NULL;
00182     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE, arg);
00183     if (arg)
00184     {
00185       msg_ptr->state = arg->value.I32;
00186     }
00187 
00188     arg = NULL;
00189     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_MASS_STORAGE_ID, arg);
00190     if (arg)
00191     {
00192       msg_ptr->mass_storage_id = arg->value.U8;
00193     }
00194 
00195     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00196   }
00197 
00198 };  // Ardrone3MediaRecordStateVideoStateChanged
00199 
00200 
00201 // Picture state.
00202 class Ardrone3MediaRecordStatePictureStateChangedV2 : public AbstractState
00203 {
00204 private:
00205   ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChangedV2::Ptr msg_ptr;
00206 
00207 public:
00208 
00209   Ardrone3MediaRecordStatePictureStateChangedV2(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00210     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2)
00211   {
00212     if (priv_nh.getParam("states/enable_mediarecordstate_picturestatechangedv2", pub_enabled_) && pub_enabled_)
00213     {
00214       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00215       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaRecordStatePictureStateChangedV2>(topic, 10, true);
00216     } // pub_enabled_ is false
00217   }
00218 
00219   ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChangedV2::ConstPtr GetDataCstPtr() const
00220   {
00221     ::boost::lock_guard<boost::mutex> lock(mutex_);
00222     return msg_ptr;
00223   }
00224 
00225   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00226   {
00227     if (arguments == NULL)
00228     {
00229       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaRecordStatePictureStateChangedV2::Update() arguments is NULL");
00230       return;
00231     }
00232 
00233     ::boost::lock_guard<boost::mutex> lock(mutex_);
00234     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaRecordStatePictureStateChangedV2());
00235     msg_ptr->header.stamp = t;
00236     msg_ptr->header.frame_id = "base_link";
00237 
00238 
00239     arg = NULL;
00240     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE, arg);
00241     if (arg)
00242     {
00243       msg_ptr->state = arg->value.I32;
00244     }
00245 
00246     arg = NULL;
00247     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR, arg);
00248     if (arg)
00249     {
00250       msg_ptr->error = arg->value.I32;
00251     }
00252 
00253     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00254   }
00255 
00256 };  // Ardrone3MediaRecordStatePictureStateChangedV2
00257 
00258 
00259 // Video record state.
00260 class Ardrone3MediaRecordStateVideoStateChangedV2 : public AbstractState
00261 {
00262 private:
00263   ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChangedV2::Ptr msg_ptr;
00264 
00265 public:
00266 
00267   Ardrone3MediaRecordStateVideoStateChangedV2(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00268     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2)
00269   {
00270     if (priv_nh.getParam("states/enable_mediarecordstate_videostatechangedv2", pub_enabled_) && pub_enabled_)
00271     {
00272       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00273       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaRecordStateVideoStateChangedV2>(topic, 10, true);
00274     } // pub_enabled_ is false
00275   }
00276 
00277   ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChangedV2::ConstPtr GetDataCstPtr() const
00278   {
00279     ::boost::lock_guard<boost::mutex> lock(mutex_);
00280     return msg_ptr;
00281   }
00282 
00283   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00284   {
00285     if (arguments == NULL)
00286     {
00287       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaRecordStateVideoStateChangedV2::Update() arguments is NULL");
00288       return;
00289     }
00290 
00291     ::boost::lock_guard<boost::mutex> lock(mutex_);
00292     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaRecordStateVideoStateChangedV2());
00293     msg_ptr->header.stamp = t;
00294     msg_ptr->header.frame_id = "base_link";
00295 
00296 
00297     arg = NULL;
00298     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE, arg);
00299     if (arg)
00300     {
00301       msg_ptr->state = arg->value.I32;
00302     }
00303 
00304     arg = NULL;
00305     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR, arg);
00306     if (arg)
00307     {
00308       msg_ptr->error = arg->value.I32;
00309     }
00310 
00311     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00312   }
00313 
00314 };  // Ardrone3MediaRecordStateVideoStateChangedV2
00315 
00316 
00317 // Video resolution.\n Informs about streaming and recording video resolutions.\n Note that this is only an indication about what the resolution should be. To know the real resolution, you should get it from the frame.
00318 class Ardrone3MediaRecordStateVideoResolutionState : public AbstractState
00319 {
00320 private:
00321   ::bebop_msgs::Ardrone3MediaRecordStateVideoResolutionState::Ptr msg_ptr;
00322 
00323 public:
00324 
00325   Ardrone3MediaRecordStateVideoResolutionState(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00326     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEORESOLUTIONSTATE)
00327   {
00328     if (priv_nh.getParam("states/enable_mediarecordstate_videoresolutionstate", pub_enabled_) && pub_enabled_)
00329     {
00330       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00331       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaRecordStateVideoResolutionState>(topic, 10, true);
00332     } // pub_enabled_ is false
00333   }
00334 
00335   ::bebop_msgs::Ardrone3MediaRecordStateVideoResolutionState::ConstPtr GetDataCstPtr() const
00336   {
00337     ::boost::lock_guard<boost::mutex> lock(mutex_);
00338     return msg_ptr;
00339   }
00340 
00341   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00342   {
00343     if (arguments == NULL)
00344     {
00345       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaRecordStateVideoResolutionState::Update() arguments is NULL");
00346       return;
00347     }
00348 
00349     ::boost::lock_guard<boost::mutex> lock(mutex_);
00350     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaRecordStateVideoResolutionState());
00351     msg_ptr->header.stamp = t;
00352     msg_ptr->header.frame_id = "base_link";
00353 
00354 
00355     arg = NULL;
00356     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEORESOLUTIONSTATE_STREAMING, arg);
00357     if (arg)
00358     {
00359       msg_ptr->streaming = arg->value.I32;
00360     }
00361 
00362     arg = NULL;
00363     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEORESOLUTIONSTATE_RECORDING, arg);
00364     if (arg)
00365     {
00366       msg_ptr->recording = arg->value.I32;
00367     }
00368 
00369     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00370   }
00371 
00372 };  // Ardrone3MediaRecordStateVideoResolutionState
00373 
00374 
00375 // Drone acknowledges that flat trim was correctly processed.
00376 class Ardrone3PilotingStateFlatTrimChanged : public AbstractState
00377 {
00378 private:
00379   ::bebop_msgs::Ardrone3PilotingStateFlatTrimChanged::Ptr msg_ptr;
00380 
00381 public:
00382 
00383   Ardrone3PilotingStateFlatTrimChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00384     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLATTRIMCHANGED)
00385   {
00386     if (priv_nh.getParam("states/enable_pilotingstate_flattrimchanged", pub_enabled_) && pub_enabled_)
00387     {
00388       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00389       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateFlatTrimChanged>(topic, 10, true);
00390     } // pub_enabled_ is false
00391   }
00392 
00393   ::bebop_msgs::Ardrone3PilotingStateFlatTrimChanged::ConstPtr GetDataCstPtr() const
00394   {
00395     ::boost::lock_guard<boost::mutex> lock(mutex_);
00396     return msg_ptr;
00397   }
00398 
00399   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00400   {
00401     if (arguments == NULL)
00402     {
00403       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateFlatTrimChanged::Update() arguments is NULL");
00404       return;
00405     }
00406 
00407     ::boost::lock_guard<boost::mutex> lock(mutex_);
00408     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateFlatTrimChanged());
00409     msg_ptr->header.stamp = t;
00410     msg_ptr->header.frame_id = "base_link";
00411 
00412 
00413     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00414   }
00415 
00416 };  // Ardrone3PilotingStateFlatTrimChanged
00417 
00418 
00419 // Flying state.
00420 class Ardrone3PilotingStateFlyingStateChanged : public AbstractState
00421 {
00422 private:
00423   ::bebop_msgs::Ardrone3PilotingStateFlyingStateChanged::Ptr msg_ptr;
00424 
00425 public:
00426 
00427   Ardrone3PilotingStateFlyingStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00428     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED)
00429   {
00430     if (priv_nh.getParam("states/enable_pilotingstate_flyingstatechanged", pub_enabled_) && pub_enabled_)
00431     {
00432       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00433       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateFlyingStateChanged>(topic, 10, true);
00434     } // pub_enabled_ is false
00435   }
00436 
00437   ::bebop_msgs::Ardrone3PilotingStateFlyingStateChanged::ConstPtr GetDataCstPtr() const
00438   {
00439     ::boost::lock_guard<boost::mutex> lock(mutex_);
00440     return msg_ptr;
00441   }
00442 
00443   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00444   {
00445     if (arguments == NULL)
00446     {
00447       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateFlyingStateChanged::Update() arguments is NULL");
00448       return;
00449     }
00450 
00451     ::boost::lock_guard<boost::mutex> lock(mutex_);
00452     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateFlyingStateChanged());
00453     msg_ptr->header.stamp = t;
00454     msg_ptr->header.frame_id = "base_link";
00455 
00456 
00457     arg = NULL;
00458     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
00459     if (arg)
00460     {
00461       msg_ptr->state = arg->value.I32;
00462     }
00463 
00464     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00465   }
00466 
00467 };  // Ardrone3PilotingStateFlyingStateChanged
00468 
00469 
00470 // Alert state.
00471 class Ardrone3PilotingStateAlertStateChanged : public AbstractState
00472 {
00473 private:
00474   ::bebop_msgs::Ardrone3PilotingStateAlertStateChanged::Ptr msg_ptr;
00475 
00476 public:
00477 
00478   Ardrone3PilotingStateAlertStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00479     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED)
00480   {
00481     if (priv_nh.getParam("states/enable_pilotingstate_alertstatechanged", pub_enabled_) && pub_enabled_)
00482     {
00483       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00484       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateAlertStateChanged>(topic, 10, true);
00485     } // pub_enabled_ is false
00486   }
00487 
00488   ::bebop_msgs::Ardrone3PilotingStateAlertStateChanged::ConstPtr GetDataCstPtr() const
00489   {
00490     ::boost::lock_guard<boost::mutex> lock(mutex_);
00491     return msg_ptr;
00492   }
00493 
00494   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00495   {
00496     if (arguments == NULL)
00497     {
00498       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateAlertStateChanged::Update() arguments is NULL");
00499       return;
00500     }
00501 
00502     ::boost::lock_guard<boost::mutex> lock(mutex_);
00503     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateAlertStateChanged());
00504     msg_ptr->header.stamp = t;
00505     msg_ptr->header.frame_id = "base_link";
00506 
00507 
00508     arg = NULL;
00509     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE, arg);
00510     if (arg)
00511     {
00512       msg_ptr->state = arg->value.I32;
00513     }
00514 
00515     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00516   }
00517 
00518 };  // Ardrone3PilotingStateAlertStateChanged
00519 
00520 
00521 // Return home state.\n Availability is related to gps fix, magnetometer calibration.
00522 class Ardrone3PilotingStateNavigateHomeStateChanged : public AbstractState
00523 {
00524 private:
00525   ::bebop_msgs::Ardrone3PilotingStateNavigateHomeStateChanged::Ptr msg_ptr;
00526 
00527 public:
00528 
00529   Ardrone3PilotingStateNavigateHomeStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00530     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED)
00531   {
00532     if (priv_nh.getParam("states/enable_pilotingstate_navigatehomestatechanged", pub_enabled_) && pub_enabled_)
00533     {
00534       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00535       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateNavigateHomeStateChanged>(topic, 10, true);
00536     } // pub_enabled_ is false
00537   }
00538 
00539   ::bebop_msgs::Ardrone3PilotingStateNavigateHomeStateChanged::ConstPtr GetDataCstPtr() const
00540   {
00541     ::boost::lock_guard<boost::mutex> lock(mutex_);
00542     return msg_ptr;
00543   }
00544 
00545   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00546   {
00547     if (arguments == NULL)
00548     {
00549       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateNavigateHomeStateChanged::Update() arguments is NULL");
00550       return;
00551     }
00552 
00553     ::boost::lock_guard<boost::mutex> lock(mutex_);
00554     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateNavigateHomeStateChanged());
00555     msg_ptr->header.stamp = t;
00556     msg_ptr->header.frame_id = "base_link";
00557 
00558 
00559     arg = NULL;
00560     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE, arg);
00561     if (arg)
00562     {
00563       msg_ptr->state = arg->value.I32;
00564     }
00565 
00566     arg = NULL;
00567     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON, arg);
00568     if (arg)
00569     {
00570       msg_ptr->reason = arg->value.I32;
00571     }
00572 
00573     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00574   }
00575 
00576 };  // Ardrone3PilotingStateNavigateHomeStateChanged
00577 
00578 
00579 // Drones position changed.
00580 class Ardrone3PilotingStatePositionChanged : public AbstractState
00581 {
00582 private:
00583   ::bebop_msgs::Ardrone3PilotingStatePositionChanged::Ptr msg_ptr;
00584 
00585 public:
00586 
00587   Ardrone3PilotingStatePositionChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00588     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED)
00589   {
00590     if (priv_nh.getParam("states/enable_pilotingstate_positionchanged", pub_enabled_) && pub_enabled_)
00591     {
00592       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00593       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStatePositionChanged>(topic, 10, true);
00594     } // pub_enabled_ is false
00595   }
00596 
00597   ::bebop_msgs::Ardrone3PilotingStatePositionChanged::ConstPtr GetDataCstPtr() const
00598   {
00599     ::boost::lock_guard<boost::mutex> lock(mutex_);
00600     return msg_ptr;
00601   }
00602 
00603   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00604   {
00605     if (arguments == NULL)
00606     {
00607       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStatePositionChanged::Update() arguments is NULL");
00608       return;
00609     }
00610 
00611     ::boost::lock_guard<boost::mutex> lock(mutex_);
00612     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStatePositionChanged());
00613     msg_ptr->header.stamp = t;
00614     msg_ptr->header.frame_id = "base_link";
00615 
00616 
00617     arg = NULL;
00618     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LATITUDE, arg);
00619     if (arg)
00620     {
00621       msg_ptr->latitude = arg->value.Double;
00622     }
00623 
00624     arg = NULL;
00625     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LONGITUDE, arg);
00626     if (arg)
00627     {
00628       msg_ptr->longitude = arg->value.Double;
00629     }
00630 
00631     arg = NULL;
00632     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_ALTITUDE, arg);
00633     if (arg)
00634     {
00635       msg_ptr->altitude = arg->value.Double;
00636     }
00637 
00638     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00639   }
00640 
00641 };  // Ardrone3PilotingStatePositionChanged
00642 
00643 
00644 // Drones speed changed.\n Expressed in the NED referential (North-East-Down).
00645 class Ardrone3PilotingStateSpeedChanged : public AbstractState
00646 {
00647 private:
00648   ::bebop_msgs::Ardrone3PilotingStateSpeedChanged::Ptr msg_ptr;
00649 
00650 public:
00651 
00652   Ardrone3PilotingStateSpeedChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00653     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED)
00654   {
00655     if (priv_nh.getParam("states/enable_pilotingstate_speedchanged", pub_enabled_) && pub_enabled_)
00656     {
00657       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00658       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateSpeedChanged>(topic, 10, true);
00659     } // pub_enabled_ is false
00660   }
00661 
00662   ::bebop_msgs::Ardrone3PilotingStateSpeedChanged::ConstPtr GetDataCstPtr() const
00663   {
00664     ::boost::lock_guard<boost::mutex> lock(mutex_);
00665     return msg_ptr;
00666   }
00667 
00668   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00669   {
00670     if (arguments == NULL)
00671     {
00672       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateSpeedChanged::Update() arguments is NULL");
00673       return;
00674     }
00675 
00676     ::boost::lock_guard<boost::mutex> lock(mutex_);
00677     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateSpeedChanged());
00678     msg_ptr->header.stamp = t;
00679     msg_ptr->header.frame_id = "base_link";
00680 
00681 
00682     arg = NULL;
00683     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDX, arg);
00684     if (arg)
00685     {
00686       msg_ptr->speedX = arg->value.Float;
00687     }
00688 
00689     arg = NULL;
00690     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDY, arg);
00691     if (arg)
00692     {
00693       msg_ptr->speedY = arg->value.Float;
00694     }
00695 
00696     arg = NULL;
00697     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDZ, arg);
00698     if (arg)
00699     {
00700       msg_ptr->speedZ = arg->value.Float;
00701     }
00702 
00703     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00704   }
00705 
00706 };  // Ardrone3PilotingStateSpeedChanged
00707 
00708 
00709 // Drones attitude changed.
00710 class Ardrone3PilotingStateAttitudeChanged : public AbstractState
00711 {
00712 private:
00713   ::bebop_msgs::Ardrone3PilotingStateAttitudeChanged::Ptr msg_ptr;
00714 
00715 public:
00716 
00717   Ardrone3PilotingStateAttitudeChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00718     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED)
00719   {
00720     if (priv_nh.getParam("states/enable_pilotingstate_attitudechanged", pub_enabled_) && pub_enabled_)
00721     {
00722       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00723       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateAttitudeChanged>(topic, 10, true);
00724     } // pub_enabled_ is false
00725   }
00726 
00727   ::bebop_msgs::Ardrone3PilotingStateAttitudeChanged::ConstPtr GetDataCstPtr() const
00728   {
00729     ::boost::lock_guard<boost::mutex> lock(mutex_);
00730     return msg_ptr;
00731   }
00732 
00733   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00734   {
00735     if (arguments == NULL)
00736     {
00737       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateAttitudeChanged::Update() arguments is NULL");
00738       return;
00739     }
00740 
00741     ::boost::lock_guard<boost::mutex> lock(mutex_);
00742     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateAttitudeChanged());
00743     msg_ptr->header.stamp = t;
00744     msg_ptr->header.frame_id = "base_link";
00745 
00746 
00747     arg = NULL;
00748     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_ROLL, arg);
00749     if (arg)
00750     {
00751       msg_ptr->roll = arg->value.Float;
00752     }
00753 
00754     arg = NULL;
00755     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_PITCH, arg);
00756     if (arg)
00757     {
00758       msg_ptr->pitch = arg->value.Float;
00759     }
00760 
00761     arg = NULL;
00762     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_YAW, arg);
00763     if (arg)
00764     {
00765       msg_ptr->yaw = arg->value.Float;
00766     }
00767 
00768     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00769   }
00770 
00771 };  // Ardrone3PilotingStateAttitudeChanged
00772 
00773 
00774 // Auto takeoff mode
00775 class Ardrone3PilotingStateAutoTakeOffModeChanged : public AbstractState
00776 {
00777 private:
00778   ::bebop_msgs::Ardrone3PilotingStateAutoTakeOffModeChanged::Ptr msg_ptr;
00779 
00780 public:
00781 
00782   Ardrone3PilotingStateAutoTakeOffModeChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00783     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED)
00784   {
00785     if (priv_nh.getParam("states/enable_pilotingstate_autotakeoffmodechanged", pub_enabled_) && pub_enabled_)
00786     {
00787       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00788       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateAutoTakeOffModeChanged>(topic, 10, true);
00789     } // pub_enabled_ is false
00790   }
00791 
00792   ::bebop_msgs::Ardrone3PilotingStateAutoTakeOffModeChanged::ConstPtr GetDataCstPtr() const
00793   {
00794     ::boost::lock_guard<boost::mutex> lock(mutex_);
00795     return msg_ptr;
00796   }
00797 
00798   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00799   {
00800     if (arguments == NULL)
00801     {
00802       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateAutoTakeOffModeChanged::Update() arguments is NULL");
00803       return;
00804     }
00805 
00806     ::boost::lock_guard<boost::mutex> lock(mutex_);
00807     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateAutoTakeOffModeChanged());
00808     msg_ptr->header.stamp = t;
00809     msg_ptr->header.frame_id = "base_link";
00810 
00811 
00812     arg = NULL;
00813     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED_STATE, arg);
00814     if (arg)
00815     {
00816       msg_ptr->state = arg->value.U8;
00817     }
00818 
00819     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00820   }
00821 
00822 };  // Ardrone3PilotingStateAutoTakeOffModeChanged
00823 
00824 
00825 // Drones altitude changed.\n The altitude reported is the altitude above the take off point.\n To get the altitude above sea level, see [PositionChanged](#1-4-4).
00826 class Ardrone3PilotingStateAltitudeChanged : public AbstractState
00827 {
00828 private:
00829   ::bebop_msgs::Ardrone3PilotingStateAltitudeChanged::Ptr msg_ptr;
00830 
00831 public:
00832 
00833   Ardrone3PilotingStateAltitudeChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00834     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED)
00835   {
00836     if (priv_nh.getParam("states/enable_pilotingstate_altitudechanged", pub_enabled_) && pub_enabled_)
00837     {
00838       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00839       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateAltitudeChanged>(topic, 10, true);
00840     } // pub_enabled_ is false
00841   }
00842 
00843   ::bebop_msgs::Ardrone3PilotingStateAltitudeChanged::ConstPtr GetDataCstPtr() const
00844   {
00845     ::boost::lock_guard<boost::mutex> lock(mutex_);
00846     return msg_ptr;
00847   }
00848 
00849   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00850   {
00851     if (arguments == NULL)
00852     {
00853       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateAltitudeChanged::Update() arguments is NULL");
00854       return;
00855     }
00856 
00857     ::boost::lock_guard<boost::mutex> lock(mutex_);
00858     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateAltitudeChanged());
00859     msg_ptr->header.stamp = t;
00860     msg_ptr->header.frame_id = "base_link";
00861 
00862 
00863     arg = NULL;
00864     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED_ALTITUDE, arg);
00865     if (arg)
00866     {
00867       msg_ptr->altitude = arg->value.Double;
00868     }
00869 
00870     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00871   }
00872 
00873 };  // Ardrone3PilotingStateAltitudeChanged
00874 
00875 
00876 // Drones location changed.\n This event is meant to replace [PositionChanged](#1-4-4).
00877 class Ardrone3PilotingStateGpsLocationChanged : public AbstractState
00878 {
00879 private:
00880   ::bebop_msgs::Ardrone3PilotingStateGpsLocationChanged::Ptr msg_ptr;
00881 
00882 public:
00883 
00884   Ardrone3PilotingStateGpsLocationChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00885     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED)
00886   {
00887     if (priv_nh.getParam("states/enable_pilotingstate_gpslocationchanged", pub_enabled_) && pub_enabled_)
00888     {
00889       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00890       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateGpsLocationChanged>(topic, 10, true);
00891     } // pub_enabled_ is false
00892   }
00893 
00894   ::bebop_msgs::Ardrone3PilotingStateGpsLocationChanged::ConstPtr GetDataCstPtr() const
00895   {
00896     ::boost::lock_guard<boost::mutex> lock(mutex_);
00897     return msg_ptr;
00898   }
00899 
00900   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00901   {
00902     if (arguments == NULL)
00903     {
00904       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateGpsLocationChanged::Update() arguments is NULL");
00905       return;
00906     }
00907 
00908     ::boost::lock_guard<boost::mutex> lock(mutex_);
00909     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateGpsLocationChanged());
00910     msg_ptr->header.stamp = t;
00911     msg_ptr->header.frame_id = "base_link";
00912 
00913 
00914     arg = NULL;
00915     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_LATITUDE, arg);
00916     if (arg)
00917     {
00918       msg_ptr->latitude = arg->value.Double;
00919     }
00920 
00921     arg = NULL;
00922     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_LONGITUDE, arg);
00923     if (arg)
00924     {
00925       msg_ptr->longitude = arg->value.Double;
00926     }
00927 
00928     arg = NULL;
00929     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_ALTITUDE, arg);
00930     if (arg)
00931     {
00932       msg_ptr->altitude = arg->value.Double;
00933     }
00934 
00935     arg = NULL;
00936     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_LATITUDE_ACCURACY, arg);
00937     if (arg)
00938     {
00939       msg_ptr->latitude_accuracy = arg->value.I8;
00940     }
00941 
00942     arg = NULL;
00943     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_LONGITUDE_ACCURACY, arg);
00944     if (arg)
00945     {
00946       msg_ptr->longitude_accuracy = arg->value.I8;
00947     }
00948 
00949     arg = NULL;
00950     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_GPSLOCATIONCHANGED_ALTITUDE_ACCURACY, arg);
00951     if (arg)
00952     {
00953       msg_ptr->altitude_accuracy = arg->value.I8;
00954     }
00955 
00956     if (pub_enabled_) ros_pub_.publish(msg_ptr);
00957   }
00958 
00959 };  // Ardrone3PilotingStateGpsLocationChanged
00960 
00961 
00962 // Landing state.\n Only available for fixed wings (which have two landing modes).
00963 class Ardrone3PilotingStateLandingStateChanged : public AbstractState
00964 {
00965 private:
00966   ::bebop_msgs::Ardrone3PilotingStateLandingStateChanged::Ptr msg_ptr;
00967 
00968 public:
00969 
00970   Ardrone3PilotingStateLandingStateChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
00971     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_LANDINGSTATECHANGED)
00972   {
00973     if (priv_nh.getParam("states/enable_pilotingstate_landingstatechanged", pub_enabled_) && pub_enabled_)
00974     {
00975       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
00976       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateLandingStateChanged>(topic, 10, true);
00977     } // pub_enabled_ is false
00978   }
00979 
00980   ::bebop_msgs::Ardrone3PilotingStateLandingStateChanged::ConstPtr GetDataCstPtr() const
00981   {
00982     ::boost::lock_guard<boost::mutex> lock(mutex_);
00983     return msg_ptr;
00984   }
00985 
00986   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
00987   {
00988     if (arguments == NULL)
00989     {
00990       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateLandingStateChanged::Update() arguments is NULL");
00991       return;
00992     }
00993 
00994     ::boost::lock_guard<boost::mutex> lock(mutex_);
00995     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateLandingStateChanged());
00996     msg_ptr->header.stamp = t;
00997     msg_ptr->header.frame_id = "base_link";
00998 
00999 
01000     arg = NULL;
01001     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_LANDINGSTATECHANGED_STATE, arg);
01002     if (arg)
01003     {
01004       msg_ptr->state = arg->value.I32;
01005     }
01006 
01007     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01008   }
01009 
01010 };  // Ardrone3PilotingStateLandingStateChanged
01011 
01012 
01013 // Drones air speed changed\n Expressed in the drones referential.
01014 class Ardrone3PilotingStateAirSpeedChanged : public AbstractState
01015 {
01016 private:
01017   ::bebop_msgs::Ardrone3PilotingStateAirSpeedChanged::Ptr msg_ptr;
01018 
01019 public:
01020 
01021   Ardrone3PilotingStateAirSpeedChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01022     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AIRSPEEDCHANGED)
01023   {
01024     if (priv_nh.getParam("states/enable_pilotingstate_airspeedchanged", pub_enabled_) && pub_enabled_)
01025     {
01026       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01027       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStateAirSpeedChanged>(topic, 10, true);
01028     } // pub_enabled_ is false
01029   }
01030 
01031   ::bebop_msgs::Ardrone3PilotingStateAirSpeedChanged::ConstPtr GetDataCstPtr() const
01032   {
01033     ::boost::lock_guard<boost::mutex> lock(mutex_);
01034     return msg_ptr;
01035   }
01036 
01037   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01038   {
01039     if (arguments == NULL)
01040     {
01041       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStateAirSpeedChanged::Update() arguments is NULL");
01042       return;
01043     }
01044 
01045     ::boost::lock_guard<boost::mutex> lock(mutex_);
01046     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStateAirSpeedChanged());
01047     msg_ptr->header.stamp = t;
01048     msg_ptr->header.frame_id = "base_link";
01049 
01050 
01051     arg = NULL;
01052     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AIRSPEEDCHANGED_AIRSPEED, arg);
01053     if (arg)
01054     {
01055       msg_ptr->airSpeed = arg->value.Float;
01056     }
01057 
01058     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01059   }
01060 
01061 };  // Ardrone3PilotingStateAirSpeedChanged
01062 
01063 
01064 // The drone moves or moved to a given location.
01065 class Ardrone3PilotingStatemoveToChanged : public AbstractState
01066 {
01067 private:
01068   ::bebop_msgs::Ardrone3PilotingStatemoveToChanged::Ptr msg_ptr;
01069 
01070 public:
01071 
01072   Ardrone3PilotingStatemoveToChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01073     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED)
01074   {
01075     if (priv_nh.getParam("states/enable_pilotingstate_movetochanged", pub_enabled_) && pub_enabled_)
01076     {
01077       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01078       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PilotingStatemoveToChanged>(topic, 10, true);
01079     } // pub_enabled_ is false
01080   }
01081 
01082   ::bebop_msgs::Ardrone3PilotingStatemoveToChanged::ConstPtr GetDataCstPtr() const
01083   {
01084     ::boost::lock_guard<boost::mutex> lock(mutex_);
01085     return msg_ptr;
01086   }
01087 
01088   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01089   {
01090     if (arguments == NULL)
01091     {
01092       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PilotingStatemoveToChanged::Update() arguments is NULL");
01093       return;
01094     }
01095 
01096     ::boost::lock_guard<boost::mutex> lock(mutex_);
01097     msg_ptr.reset(new ::bebop_msgs::Ardrone3PilotingStatemoveToChanged());
01098     msg_ptr->header.stamp = t;
01099     msg_ptr->header.frame_id = "base_link";
01100 
01101 
01102     arg = NULL;
01103     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_LATITUDE, arg);
01104     if (arg)
01105     {
01106       msg_ptr->latitude = arg->value.Double;
01107     }
01108 
01109     arg = NULL;
01110     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_LONGITUDE, arg);
01111     if (arg)
01112     {
01113       msg_ptr->longitude = arg->value.Double;
01114     }
01115 
01116     arg = NULL;
01117     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_ALTITUDE, arg);
01118     if (arg)
01119     {
01120       msg_ptr->altitude = arg->value.Double;
01121     }
01122 
01123     arg = NULL;
01124     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_ORIENTATION_MODE, arg);
01125     if (arg)
01126     {
01127       msg_ptr->orientation_mode = arg->value.I32;
01128     }
01129 
01130     arg = NULL;
01131     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_HEADING, arg);
01132     if (arg)
01133     {
01134       msg_ptr->heading = arg->value.Float;
01135     }
01136 
01137     arg = NULL;
01138     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_STATUS, arg);
01139     if (arg)
01140     {
01141       msg_ptr->status = arg->value.I32;
01142     }
01143 
01144     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01145   }
01146 
01147 };  // Ardrone3PilotingStatemoveToChanged
01148 
01149 
01150 // Wifi scan results.\n Please note that the list is not complete until you receive the event [WifiScanEnded](#1-14-1).
01151 class Ardrone3NetworkStateWifiScanListChanged : public AbstractState
01152 {
01153 private:
01154   ::bebop_msgs::Ardrone3NetworkStateWifiScanListChanged::Ptr msg_ptr;
01155 
01156 public:
01157 
01158   Ardrone3NetworkStateWifiScanListChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01159     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED)
01160   {
01161     if (priv_nh.getParam("states/enable_networkstate_wifiscanlistchanged", pub_enabled_) && pub_enabled_)
01162     {
01163       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01164       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3NetworkStateWifiScanListChanged>(topic, 10, true);
01165     } // pub_enabled_ is false
01166   }
01167 
01168   ::bebop_msgs::Ardrone3NetworkStateWifiScanListChanged::ConstPtr GetDataCstPtr() const
01169   {
01170     ::boost::lock_guard<boost::mutex> lock(mutex_);
01171     return msg_ptr;
01172   }
01173 
01174   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01175   {
01176     if (arguments == NULL)
01177     {
01178       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3NetworkStateWifiScanListChanged::Update() arguments is NULL");
01179       return;
01180     }
01181 
01182     ::boost::lock_guard<boost::mutex> lock(mutex_);
01183     msg_ptr.reset(new ::bebop_msgs::Ardrone3NetworkStateWifiScanListChanged());
01184     msg_ptr->header.stamp = t;
01185     msg_ptr->header.frame_id = "base_link";
01186 
01187 
01188     arg = NULL;
01189     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_SSID, arg);
01190     if (arg)
01191     {
01192       msg_ptr->ssid = arg->value.String;
01193     }
01194 
01195     arg = NULL;
01196     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_RSSI, arg);
01197     if (arg)
01198     {
01199       msg_ptr->rssi = arg->value.I16;
01200     }
01201 
01202     arg = NULL;
01203     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND, arg);
01204     if (arg)
01205     {
01206       msg_ptr->band = arg->value.I32;
01207     }
01208 
01209     arg = NULL;
01210     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_CHANNEL, arg);
01211     if (arg)
01212     {
01213       msg_ptr->channel = arg->value.U8;
01214     }
01215 
01216     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01217   }
01218 
01219 };  // Ardrone3NetworkStateWifiScanListChanged
01220 
01221 
01222 // Wifi scan ended.\n When receiving this event, the list of [WifiScanResults](#1-14-0) is complete.
01223 class Ardrone3NetworkStateAllWifiScanChanged : public AbstractState
01224 {
01225 private:
01226   ::bebop_msgs::Ardrone3NetworkStateAllWifiScanChanged::Ptr msg_ptr;
01227 
01228 public:
01229 
01230   Ardrone3NetworkStateAllWifiScanChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01231     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFISCANCHANGED)
01232   {
01233     if (priv_nh.getParam("states/enable_networkstate_allwifiscanchanged", pub_enabled_) && pub_enabled_)
01234     {
01235       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01236       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3NetworkStateAllWifiScanChanged>(topic, 10, true);
01237     } // pub_enabled_ is false
01238   }
01239 
01240   ::bebop_msgs::Ardrone3NetworkStateAllWifiScanChanged::ConstPtr GetDataCstPtr() const
01241   {
01242     ::boost::lock_guard<boost::mutex> lock(mutex_);
01243     return msg_ptr;
01244   }
01245 
01246   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01247   {
01248     if (arguments == NULL)
01249     {
01250       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3NetworkStateAllWifiScanChanged::Update() arguments is NULL");
01251       return;
01252     }
01253 
01254     ::boost::lock_guard<boost::mutex> lock(mutex_);
01255     msg_ptr.reset(new ::bebop_msgs::Ardrone3NetworkStateAllWifiScanChanged());
01256     msg_ptr->header.stamp = t;
01257     msg_ptr->header.frame_id = "base_link";
01258 
01259 
01260     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01261   }
01262 
01263 };  // Ardrone3NetworkStateAllWifiScanChanged
01264 
01265 
01266 // Available wifi channels.\n Please note that the list is not complete until you receive the event [AvailableWifiChannelsCompleted](#1-14-3).
01267 class Ardrone3NetworkStateWifiAuthChannelListChanged : public AbstractState
01268 {
01269 private:
01270   ::bebop_msgs::Ardrone3NetworkStateWifiAuthChannelListChanged::Ptr msg_ptr;
01271 
01272 public:
01273 
01274   Ardrone3NetworkStateWifiAuthChannelListChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01275     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED)
01276   {
01277     if (priv_nh.getParam("states/enable_networkstate_wifiauthchannellistchanged", pub_enabled_) && pub_enabled_)
01278     {
01279       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01280       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3NetworkStateWifiAuthChannelListChanged>(topic, 10, true);
01281     } // pub_enabled_ is false
01282   }
01283 
01284   ::bebop_msgs::Ardrone3NetworkStateWifiAuthChannelListChanged::ConstPtr GetDataCstPtr() const
01285   {
01286     ::boost::lock_guard<boost::mutex> lock(mutex_);
01287     return msg_ptr;
01288   }
01289 
01290   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01291   {
01292     if (arguments == NULL)
01293     {
01294       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3NetworkStateWifiAuthChannelListChanged::Update() arguments is NULL");
01295       return;
01296     }
01297 
01298     ::boost::lock_guard<boost::mutex> lock(mutex_);
01299     msg_ptr.reset(new ::bebop_msgs::Ardrone3NetworkStateWifiAuthChannelListChanged());
01300     msg_ptr->header.stamp = t;
01301     msg_ptr->header.frame_id = "base_link";
01302 
01303 
01304     arg = NULL;
01305     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND, arg);
01306     if (arg)
01307     {
01308       msg_ptr->band = arg->value.I32;
01309     }
01310 
01311     arg = NULL;
01312     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_CHANNEL, arg);
01313     if (arg)
01314     {
01315       msg_ptr->channel = arg->value.U8;
01316     }
01317 
01318     arg = NULL;
01319     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_IN_OR_OUT, arg);
01320     if (arg)
01321     {
01322       msg_ptr->in_or_out = arg->value.U8;
01323     }
01324 
01325     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01326   }
01327 
01328 };  // Ardrone3NetworkStateWifiAuthChannelListChanged
01329 
01330 
01331 // Available wifi channels completed.\n When receiving this event, the list of [AvailableWifiChannels](#1-14-2) is complete.
01332 class Ardrone3NetworkStateAllWifiAuthChannelChanged : public AbstractState
01333 {
01334 private:
01335   ::bebop_msgs::Ardrone3NetworkStateAllWifiAuthChannelChanged::Ptr msg_ptr;
01336 
01337 public:
01338 
01339   Ardrone3NetworkStateAllWifiAuthChannelChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01340     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFIAUTHCHANNELCHANGED)
01341   {
01342     if (priv_nh.getParam("states/enable_networkstate_allwifiauthchannelchanged", pub_enabled_) && pub_enabled_)
01343     {
01344       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01345       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3NetworkStateAllWifiAuthChannelChanged>(topic, 10, true);
01346     } // pub_enabled_ is false
01347   }
01348 
01349   ::bebop_msgs::Ardrone3NetworkStateAllWifiAuthChannelChanged::ConstPtr GetDataCstPtr() const
01350   {
01351     ::boost::lock_guard<boost::mutex> lock(mutex_);
01352     return msg_ptr;
01353   }
01354 
01355   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01356   {
01357     if (arguments == NULL)
01358     {
01359       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3NetworkStateAllWifiAuthChannelChanged::Update() arguments is NULL");
01360       return;
01361     }
01362 
01363     ::boost::lock_guard<boost::mutex> lock(mutex_);
01364     msg_ptr.reset(new ::bebop_msgs::Ardrone3NetworkStateAllWifiAuthChannelChanged());
01365     msg_ptr->header.stamp = t;
01366     msg_ptr->header.frame_id = "base_link";
01367 
01368 
01369     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01370   }
01371 
01372 };  // Ardrone3NetworkStateAllWifiAuthChannelChanged
01373 
01374 
01375 // Video stream state.
01376 class Ardrone3MediaStreamingStateVideoEnableChanged : public AbstractState
01377 {
01378 private:
01379   ::bebop_msgs::Ardrone3MediaStreamingStateVideoEnableChanged::Ptr msg_ptr;
01380 
01381 public:
01382 
01383   Ardrone3MediaStreamingStateVideoEnableChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01384     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIASTREAMINGSTATE_VIDEOENABLECHANGED)
01385   {
01386     if (priv_nh.getParam("states/enable_mediastreamingstate_videoenablechanged", pub_enabled_) && pub_enabled_)
01387     {
01388       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01389       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaStreamingStateVideoEnableChanged>(topic, 10, true);
01390     } // pub_enabled_ is false
01391   }
01392 
01393   ::bebop_msgs::Ardrone3MediaStreamingStateVideoEnableChanged::ConstPtr GetDataCstPtr() const
01394   {
01395     ::boost::lock_guard<boost::mutex> lock(mutex_);
01396     return msg_ptr;
01397   }
01398 
01399   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01400   {
01401     if (arguments == NULL)
01402     {
01403       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaStreamingStateVideoEnableChanged::Update() arguments is NULL");
01404       return;
01405     }
01406 
01407     ::boost::lock_guard<boost::mutex> lock(mutex_);
01408     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaStreamingStateVideoEnableChanged());
01409     msg_ptr->header.stamp = t;
01410     msg_ptr->header.frame_id = "base_link";
01411 
01412 
01413     arg = NULL;
01414     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIASTREAMINGSTATE_VIDEOENABLECHANGED_ENABLED, arg);
01415     if (arg)
01416     {
01417       msg_ptr->enabled = arg->value.I32;
01418     }
01419 
01420     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01421   }
01422 
01423 };  // Ardrone3MediaStreamingStateVideoEnableChanged
01424 
01425 
01426 // 
01427 class Ardrone3MediaStreamingStateVideoStreamModeChanged : public AbstractState
01428 {
01429 private:
01430   ::bebop_msgs::Ardrone3MediaStreamingStateVideoStreamModeChanged::Ptr msg_ptr;
01431 
01432 public:
01433 
01434   Ardrone3MediaStreamingStateVideoStreamModeChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01435     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIASTREAMINGSTATE_VIDEOSTREAMMODECHANGED)
01436   {
01437     if (priv_nh.getParam("states/enable_mediastreamingstate_videostreammodechanged", pub_enabled_) && pub_enabled_)
01438     {
01439       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01440       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3MediaStreamingStateVideoStreamModeChanged>(topic, 10, true);
01441     } // pub_enabled_ is false
01442   }
01443 
01444   ::bebop_msgs::Ardrone3MediaStreamingStateVideoStreamModeChanged::ConstPtr GetDataCstPtr() const
01445   {
01446     ::boost::lock_guard<boost::mutex> lock(mutex_);
01447     return msg_ptr;
01448   }
01449 
01450   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01451   {
01452     if (arguments == NULL)
01453     {
01454       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3MediaStreamingStateVideoStreamModeChanged::Update() arguments is NULL");
01455       return;
01456     }
01457 
01458     ::boost::lock_guard<boost::mutex> lock(mutex_);
01459     msg_ptr.reset(new ::bebop_msgs::Ardrone3MediaStreamingStateVideoStreamModeChanged());
01460     msg_ptr->header.stamp = t;
01461     msg_ptr->header.frame_id = "base_link";
01462 
01463 
01464     arg = NULL;
01465     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIASTREAMINGSTATE_VIDEOSTREAMMODECHANGED_MODE, arg);
01466     if (arg)
01467     {
01468       msg_ptr->mode = arg->value.I32;
01469     }
01470 
01471     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01472   }
01473 
01474 };  // Ardrone3MediaStreamingStateVideoStreamModeChanged
01475 
01476 
01477 // Camera orientation.
01478 class Ardrone3CameraStateOrientation : public AbstractState
01479 {
01480 private:
01481   ::bebop_msgs::Ardrone3CameraStateOrientation::Ptr msg_ptr;
01482 
01483 public:
01484 
01485   Ardrone3CameraStateOrientation(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01486     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATION)
01487   {
01488     if (priv_nh.getParam("states/enable_camerastate_orientation", pub_enabled_) && pub_enabled_)
01489     {
01490       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01491       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3CameraStateOrientation>(topic, 10, true);
01492     } // pub_enabled_ is false
01493   }
01494 
01495   ::bebop_msgs::Ardrone3CameraStateOrientation::ConstPtr GetDataCstPtr() const
01496   {
01497     ::boost::lock_guard<boost::mutex> lock(mutex_);
01498     return msg_ptr;
01499   }
01500 
01501   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01502   {
01503     if (arguments == NULL)
01504     {
01505       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3CameraStateOrientation::Update() arguments is NULL");
01506       return;
01507     }
01508 
01509     ::boost::lock_guard<boost::mutex> lock(mutex_);
01510     msg_ptr.reset(new ::bebop_msgs::Ardrone3CameraStateOrientation());
01511     msg_ptr->header.stamp = t;
01512     msg_ptr->header.frame_id = "base_link";
01513 
01514 
01515     arg = NULL;
01516     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATION_TILT, arg);
01517     if (arg)
01518     {
01519       msg_ptr->tilt = arg->value.I8;
01520     }
01521 
01522     arg = NULL;
01523     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATION_PAN, arg);
01524     if (arg)
01525     {
01526       msg_ptr->pan = arg->value.I8;
01527     }
01528 
01529     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01530   }
01531 
01532 };  // Ardrone3CameraStateOrientation
01533 
01534 
01535 // Orientation of the center of the camera.\n This is the value to send when you want to center the camera.
01536 class Ardrone3CameraStatedefaultCameraOrientation : public AbstractState
01537 {
01538 private:
01539   ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientation::Ptr msg_ptr;
01540 
01541 public:
01542 
01543   Ardrone3CameraStatedefaultCameraOrientation(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01544     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATION)
01545   {
01546     if (priv_nh.getParam("states/enable_camerastate_defaultcameraorientation", pub_enabled_) && pub_enabled_)
01547     {
01548       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01549       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3CameraStatedefaultCameraOrientation>(topic, 10, true);
01550     } // pub_enabled_ is false
01551   }
01552 
01553   ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientation::ConstPtr GetDataCstPtr() const
01554   {
01555     ::boost::lock_guard<boost::mutex> lock(mutex_);
01556     return msg_ptr;
01557   }
01558 
01559   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01560   {
01561     if (arguments == NULL)
01562     {
01563       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3CameraStatedefaultCameraOrientation::Update() arguments is NULL");
01564       return;
01565     }
01566 
01567     ::boost::lock_guard<boost::mutex> lock(mutex_);
01568     msg_ptr.reset(new ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientation());
01569     msg_ptr->header.stamp = t;
01570     msg_ptr->header.frame_id = "base_link";
01571 
01572 
01573     arg = NULL;
01574     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATION_TILT, arg);
01575     if (arg)
01576     {
01577       msg_ptr->tilt = arg->value.I8;
01578     }
01579 
01580     arg = NULL;
01581     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATION_PAN, arg);
01582     if (arg)
01583     {
01584       msg_ptr->pan = arg->value.I8;
01585     }
01586 
01587     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01588   }
01589 
01590 };  // Ardrone3CameraStatedefaultCameraOrientation
01591 
01592 
01593 // Camera orientation with float arguments.
01594 class Ardrone3CameraStateOrientationV2 : public AbstractState
01595 {
01596 private:
01597   ::bebop_msgs::Ardrone3CameraStateOrientationV2::Ptr msg_ptr;
01598 
01599 public:
01600 
01601   Ardrone3CameraStateOrientationV2(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01602     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATIONV2)
01603   {
01604     if (priv_nh.getParam("states/enable_camerastate_orientationv2", pub_enabled_) && pub_enabled_)
01605     {
01606       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01607       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3CameraStateOrientationV2>(topic, 10, true);
01608     } // pub_enabled_ is false
01609   }
01610 
01611   ::bebop_msgs::Ardrone3CameraStateOrientationV2::ConstPtr GetDataCstPtr() const
01612   {
01613     ::boost::lock_guard<boost::mutex> lock(mutex_);
01614     return msg_ptr;
01615   }
01616 
01617   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01618   {
01619     if (arguments == NULL)
01620     {
01621       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3CameraStateOrientationV2::Update() arguments is NULL");
01622       return;
01623     }
01624 
01625     ::boost::lock_guard<boost::mutex> lock(mutex_);
01626     msg_ptr.reset(new ::bebop_msgs::Ardrone3CameraStateOrientationV2());
01627     msg_ptr->header.stamp = t;
01628     msg_ptr->header.frame_id = "base_link";
01629 
01630 
01631     arg = NULL;
01632     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATIONV2_TILT, arg);
01633     if (arg)
01634     {
01635       msg_ptr->tilt = arg->value.Float;
01636     }
01637 
01638     arg = NULL;
01639     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_ORIENTATIONV2_PAN, arg);
01640     if (arg)
01641     {
01642       msg_ptr->pan = arg->value.Float;
01643     }
01644 
01645     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01646   }
01647 
01648 };  // Ardrone3CameraStateOrientationV2
01649 
01650 
01651 // Orientation of the center of the camera.\n This is the value to send when you want to center the camera.
01652 class Ardrone3CameraStatedefaultCameraOrientationV2 : public AbstractState
01653 {
01654 private:
01655   ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientationV2::Ptr msg_ptr;
01656 
01657 public:
01658 
01659   Ardrone3CameraStatedefaultCameraOrientationV2(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01660     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATIONV2)
01661   {
01662     if (priv_nh.getParam("states/enable_camerastate_defaultcameraorientationv2", pub_enabled_) && pub_enabled_)
01663     {
01664       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01665       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3CameraStatedefaultCameraOrientationV2>(topic, 10, true);
01666     } // pub_enabled_ is false
01667   }
01668 
01669   ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientationV2::ConstPtr GetDataCstPtr() const
01670   {
01671     ::boost::lock_guard<boost::mutex> lock(mutex_);
01672     return msg_ptr;
01673   }
01674 
01675   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01676   {
01677     if (arguments == NULL)
01678     {
01679       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3CameraStatedefaultCameraOrientationV2::Update() arguments is NULL");
01680       return;
01681     }
01682 
01683     ::boost::lock_guard<boost::mutex> lock(mutex_);
01684     msg_ptr.reset(new ::bebop_msgs::Ardrone3CameraStatedefaultCameraOrientationV2());
01685     msg_ptr->header.stamp = t;
01686     msg_ptr->header.frame_id = "base_link";
01687 
01688 
01689     arg = NULL;
01690     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATIONV2_TILT, arg);
01691     if (arg)
01692     {
01693       msg_ptr->tilt = arg->value.Float;
01694     }
01695 
01696     arg = NULL;
01697     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_DEFAULTCAMERAORIENTATIONV2_PAN, arg);
01698     if (arg)
01699     {
01700       msg_ptr->pan = arg->value.Float;
01701     }
01702 
01703     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01704   }
01705 
01706 };  // Ardrone3CameraStatedefaultCameraOrientationV2
01707 
01708 
01709 // Camera Orientation velocity limits.
01710 class Ardrone3CameraStateVelocityRange : public AbstractState
01711 {
01712 private:
01713   ::bebop_msgs::Ardrone3CameraStateVelocityRange::Ptr msg_ptr;
01714 
01715 public:
01716 
01717   Ardrone3CameraStateVelocityRange(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01718     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_VELOCITYRANGE)
01719   {
01720     if (priv_nh.getParam("states/enable_camerastate_velocityrange", pub_enabled_) && pub_enabled_)
01721     {
01722       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01723       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3CameraStateVelocityRange>(topic, 10, true);
01724     } // pub_enabled_ is false
01725   }
01726 
01727   ::bebop_msgs::Ardrone3CameraStateVelocityRange::ConstPtr GetDataCstPtr() const
01728   {
01729     ::boost::lock_guard<boost::mutex> lock(mutex_);
01730     return msg_ptr;
01731   }
01732 
01733   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01734   {
01735     if (arguments == NULL)
01736     {
01737       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3CameraStateVelocityRange::Update() arguments is NULL");
01738       return;
01739     }
01740 
01741     ::boost::lock_guard<boost::mutex> lock(mutex_);
01742     msg_ptr.reset(new ::bebop_msgs::Ardrone3CameraStateVelocityRange());
01743     msg_ptr->header.stamp = t;
01744     msg_ptr->header.frame_id = "base_link";
01745 
01746 
01747     arg = NULL;
01748     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_VELOCITYRANGE_MAX_TILT, arg);
01749     if (arg)
01750     {
01751       msg_ptr->max_tilt = arg->value.Float;
01752     }
01753 
01754     arg = NULL;
01755     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_CAMERASTATE_VELOCITYRANGE_MAX_PAN, arg);
01756     if (arg)
01757     {
01758       msg_ptr->max_pan = arg->value.Float;
01759     }
01760 
01761     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01762   }
01763 
01764 };  // Ardrone3CameraStateVelocityRange
01765 
01766 
01767 // Electric frequency.\n This piece of information is used for the antiflickering when the [AntiflickeringMode](#1-30-1) is set to *auto*.
01768 class Ardrone3AntiflickeringStateelectricFrequencyChanged : public AbstractState
01769 {
01770 private:
01771   ::bebop_msgs::Ardrone3AntiflickeringStateelectricFrequencyChanged::Ptr msg_ptr;
01772 
01773 public:
01774 
01775   Ardrone3AntiflickeringStateelectricFrequencyChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01776     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ANTIFLICKERINGSTATE_ELECTRICFREQUENCYCHANGED)
01777   {
01778     if (priv_nh.getParam("states/enable_antiflickeringstate_electricfrequencychanged", pub_enabled_) && pub_enabled_)
01779     {
01780       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01781       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3AntiflickeringStateelectricFrequencyChanged>(topic, 10, true);
01782     } // pub_enabled_ is false
01783   }
01784 
01785   ::bebop_msgs::Ardrone3AntiflickeringStateelectricFrequencyChanged::ConstPtr GetDataCstPtr() const
01786   {
01787     ::boost::lock_guard<boost::mutex> lock(mutex_);
01788     return msg_ptr;
01789   }
01790 
01791   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01792   {
01793     if (arguments == NULL)
01794     {
01795       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3AntiflickeringStateelectricFrequencyChanged::Update() arguments is NULL");
01796       return;
01797     }
01798 
01799     ::boost::lock_guard<boost::mutex> lock(mutex_);
01800     msg_ptr.reset(new ::bebop_msgs::Ardrone3AntiflickeringStateelectricFrequencyChanged());
01801     msg_ptr->header.stamp = t;
01802     msg_ptr->header.frame_id = "base_link";
01803 
01804 
01805     arg = NULL;
01806     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ANTIFLICKERINGSTATE_ELECTRICFREQUENCYCHANGED_FREQUENCY, arg);
01807     if (arg)
01808     {
01809       msg_ptr->frequency = arg->value.I32;
01810     }
01811 
01812     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01813   }
01814 
01815 };  // Ardrone3AntiflickeringStateelectricFrequencyChanged
01816 
01817 
01818 // Antiflickering mode.
01819 class Ardrone3AntiflickeringStatemodeChanged : public AbstractState
01820 {
01821 private:
01822   ::bebop_msgs::Ardrone3AntiflickeringStatemodeChanged::Ptr msg_ptr;
01823 
01824 public:
01825 
01826   Ardrone3AntiflickeringStatemodeChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01827     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ANTIFLICKERINGSTATE_MODECHANGED)
01828   {
01829     if (priv_nh.getParam("states/enable_antiflickeringstate_modechanged", pub_enabled_) && pub_enabled_)
01830     {
01831       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01832       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3AntiflickeringStatemodeChanged>(topic, 10, true);
01833     } // pub_enabled_ is false
01834   }
01835 
01836   ::bebop_msgs::Ardrone3AntiflickeringStatemodeChanged::ConstPtr GetDataCstPtr() const
01837   {
01838     ::boost::lock_guard<boost::mutex> lock(mutex_);
01839     return msg_ptr;
01840   }
01841 
01842   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01843   {
01844     if (arguments == NULL)
01845     {
01846       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3AntiflickeringStatemodeChanged::Update() arguments is NULL");
01847       return;
01848     }
01849 
01850     ::boost::lock_guard<boost::mutex> lock(mutex_);
01851     msg_ptr.reset(new ::bebop_msgs::Ardrone3AntiflickeringStatemodeChanged());
01852     msg_ptr->header.stamp = t;
01853     msg_ptr->header.frame_id = "base_link";
01854 
01855 
01856     arg = NULL;
01857     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ANTIFLICKERINGSTATE_MODECHANGED_MODE, arg);
01858     if (arg)
01859     {
01860       msg_ptr->mode = arg->value.I32;
01861     }
01862 
01863     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01864   }
01865 
01866 };  // Ardrone3AntiflickeringStatemodeChanged
01867 
01868 
01869 // Number of GPS satellites.
01870 class Ardrone3GPSStateNumberOfSatelliteChanged : public AbstractState
01871 {
01872 private:
01873   ::bebop_msgs::Ardrone3GPSStateNumberOfSatelliteChanged::Ptr msg_ptr;
01874 
01875 public:
01876 
01877   Ardrone3GPSStateNumberOfSatelliteChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01878     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_NUMBEROFSATELLITECHANGED)
01879   {
01880     if (priv_nh.getParam("states/enable_gpsstate_numberofsatellitechanged", pub_enabled_) && pub_enabled_)
01881     {
01882       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01883       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3GPSStateNumberOfSatelliteChanged>(topic, 10, true);
01884     } // pub_enabled_ is false
01885   }
01886 
01887   ::bebop_msgs::Ardrone3GPSStateNumberOfSatelliteChanged::ConstPtr GetDataCstPtr() const
01888   {
01889     ::boost::lock_guard<boost::mutex> lock(mutex_);
01890     return msg_ptr;
01891   }
01892 
01893   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01894   {
01895     if (arguments == NULL)
01896     {
01897       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3GPSStateNumberOfSatelliteChanged::Update() arguments is NULL");
01898       return;
01899     }
01900 
01901     ::boost::lock_guard<boost::mutex> lock(mutex_);
01902     msg_ptr.reset(new ::bebop_msgs::Ardrone3GPSStateNumberOfSatelliteChanged());
01903     msg_ptr->header.stamp = t;
01904     msg_ptr->header.frame_id = "base_link";
01905 
01906 
01907     arg = NULL;
01908     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_NUMBEROFSATELLITECHANGED_NUMBEROFSATELLITE, arg);
01909     if (arg)
01910     {
01911       msg_ptr->numberOfSatellite = arg->value.U8;
01912     }
01913 
01914     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01915   }
01916 
01917 };  // Ardrone3GPSStateNumberOfSatelliteChanged
01918 
01919 
01920 // Home type availability.
01921 class Ardrone3GPSStateHomeTypeAvailabilityChanged : public AbstractState
01922 {
01923 private:
01924   ::bebop_msgs::Ardrone3GPSStateHomeTypeAvailabilityChanged::Ptr msg_ptr;
01925 
01926 public:
01927 
01928   Ardrone3GPSStateHomeTypeAvailabilityChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01929     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_HOMETYPEAVAILABILITYCHANGED)
01930   {
01931     if (priv_nh.getParam("states/enable_gpsstate_hometypeavailabilitychanged", pub_enabled_) && pub_enabled_)
01932     {
01933       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01934       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3GPSStateHomeTypeAvailabilityChanged>(topic, 10, true);
01935     } // pub_enabled_ is false
01936   }
01937 
01938   ::bebop_msgs::Ardrone3GPSStateHomeTypeAvailabilityChanged::ConstPtr GetDataCstPtr() const
01939   {
01940     ::boost::lock_guard<boost::mutex> lock(mutex_);
01941     return msg_ptr;
01942   }
01943 
01944   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
01945   {
01946     if (arguments == NULL)
01947     {
01948       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3GPSStateHomeTypeAvailabilityChanged::Update() arguments is NULL");
01949       return;
01950     }
01951 
01952     ::boost::lock_guard<boost::mutex> lock(mutex_);
01953     msg_ptr.reset(new ::bebop_msgs::Ardrone3GPSStateHomeTypeAvailabilityChanged());
01954     msg_ptr->header.stamp = t;
01955     msg_ptr->header.frame_id = "base_link";
01956 
01957 
01958     arg = NULL;
01959     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_HOMETYPEAVAILABILITYCHANGED_TYPE, arg);
01960     if (arg)
01961     {
01962       msg_ptr->type = arg->value.I32;
01963     }
01964 
01965     arg = NULL;
01966     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_HOMETYPEAVAILABILITYCHANGED_AVAILABLE, arg);
01967     if (arg)
01968     {
01969       msg_ptr->available = arg->value.U8;
01970     }
01971 
01972     if (pub_enabled_) ros_pub_.publish(msg_ptr);
01973   }
01974 
01975 };  // Ardrone3GPSStateHomeTypeAvailabilityChanged
01976 
01977 
01978 // Home type.\n This choice is made by the drone, according to the [PreferredHomeType](#1-24-4) and the [HomeTypeAvailability](#1-31-1). The drone will choose the type matching with the user preference only if this type is available. If not, it will chose a type in this order:\n FOLLOWEE ; TAKEOFF ; PILOT ; FIRST_FIX
01979 class Ardrone3GPSStateHomeTypeChosenChanged : public AbstractState
01980 {
01981 private:
01982   ::bebop_msgs::Ardrone3GPSStateHomeTypeChosenChanged::Ptr msg_ptr;
01983 
01984 public:
01985 
01986   Ardrone3GPSStateHomeTypeChosenChanged(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
01987     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_HOMETYPECHOSENCHANGED)
01988   {
01989     if (priv_nh.getParam("states/enable_gpsstate_hometypechosenchanged", pub_enabled_) && pub_enabled_)
01990     {
01991       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
01992       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3GPSStateHomeTypeChosenChanged>(topic, 10, true);
01993     } // pub_enabled_ is false
01994   }
01995 
01996   ::bebop_msgs::Ardrone3GPSStateHomeTypeChosenChanged::ConstPtr GetDataCstPtr() const
01997   {
01998     ::boost::lock_guard<boost::mutex> lock(mutex_);
01999     return msg_ptr;
02000   }
02001 
02002   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
02003   {
02004     if (arguments == NULL)
02005     {
02006       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3GPSStateHomeTypeChosenChanged::Update() arguments is NULL");
02007       return;
02008     }
02009 
02010     ::boost::lock_guard<boost::mutex> lock(mutex_);
02011     msg_ptr.reset(new ::bebop_msgs::Ardrone3GPSStateHomeTypeChosenChanged());
02012     msg_ptr->header.stamp = t;
02013     msg_ptr->header.frame_id = "base_link";
02014 
02015 
02016     arg = NULL;
02017     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_GPSSTATE_HOMETYPECHOSENCHANGED_TYPE, arg);
02018     if (arg)
02019     {
02020       msg_ptr->type = arg->value.I32;
02021     }
02022 
02023     if (pub_enabled_) ros_pub_.publish(msg_ptr);
02024   }
02025 
02026 };  // Ardrone3GPSStateHomeTypeChosenChanged
02027 
02028 
02029 // Pro features.
02030 class Ardrone3PROStateFeatures : public AbstractState
02031 {
02032 private:
02033   ::bebop_msgs::Ardrone3PROStateFeatures::Ptr msg_ptr;
02034 
02035 public:
02036 
02037   Ardrone3PROStateFeatures(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
02038     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PROSTATE_FEATURES)
02039   {
02040     if (priv_nh.getParam("states/enable_prostate_features", pub_enabled_) && pub_enabled_)
02041     {
02042       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
02043       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3PROStateFeatures>(topic, 10, true);
02044     } // pub_enabled_ is false
02045   }
02046 
02047   ::bebop_msgs::Ardrone3PROStateFeatures::ConstPtr GetDataCstPtr() const
02048   {
02049     ::boost::lock_guard<boost::mutex> lock(mutex_);
02050     return msg_ptr;
02051   }
02052 
02053   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
02054   {
02055     if (arguments == NULL)
02056     {
02057       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3PROStateFeatures::Update() arguments is NULL");
02058       return;
02059     }
02060 
02061     ::boost::lock_guard<boost::mutex> lock(mutex_);
02062     msg_ptr.reset(new ::bebop_msgs::Ardrone3PROStateFeatures());
02063     msg_ptr->header.stamp = t;
02064     msg_ptr->header.frame_id = "base_link";
02065 
02066 
02067     arg = NULL;
02068     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PROSTATE_FEATURES_FEATURES, arg);
02069     if (arg)
02070     {
02071       msg_ptr->features = arg->value.U64;
02072     }
02073 
02074     if (pub_enabled_) ros_pub_.publish(msg_ptr);
02075   }
02076 
02077 };  // Ardrone3PROStateFeatures
02078 
02079 
02080 // List of all connected accessories. This event presents the list of all connected accessories. To actually use the component, use the component dedicated feature.
02081 class Ardrone3AccessoryStateConnectedAccessories : public AbstractState
02082 {
02083 private:
02084   ::bebop_msgs::Ardrone3AccessoryStateConnectedAccessories::Ptr msg_ptr;
02085 
02086 public:
02087 
02088   Ardrone3AccessoryStateConnectedAccessories(::ros::NodeHandle& nh, ::ros::NodeHandle& priv_nh, const ::std::string& topic)
02089     : AbstractState(ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ACCESSORYSTATE_CONNECTEDACCESSORIES)
02090   {
02091     if (priv_nh.getParam("states/enable_accessorystate_connectedaccessories", pub_enabled_) && pub_enabled_)
02092     {
02093       ARSAL_PRINT(ARSAL_PRINT_INFO, "CB" , "[STATES] Enabling %s", topic.c_str());
02094       ros_pub_ = nh.advertise<bebop_msgs::Ardrone3AccessoryStateConnectedAccessories>(topic, 10, true);
02095     } // pub_enabled_ is false
02096   }
02097 
02098   ::bebop_msgs::Ardrone3AccessoryStateConnectedAccessories::ConstPtr GetDataCstPtr() const
02099   {
02100     ::boost::lock_guard<boost::mutex> lock(mutex_);
02101     return msg_ptr;
02102   }
02103 
02104   void Update(const ARCONTROLLER_DICTIONARY_ARG_t *arguments, const ::ros::Time& t)
02105   {
02106     if (arguments == NULL)
02107     {
02108       ARSAL_PRINT(ARSAL_PRINT_WARNING, "CB", "Ardrone3AccessoryStateConnectedAccessories::Update() arguments is NULL");
02109       return;
02110     }
02111 
02112     ::boost::lock_guard<boost::mutex> lock(mutex_);
02113     msg_ptr.reset(new ::bebop_msgs::Ardrone3AccessoryStateConnectedAccessories());
02114     msg_ptr->header.stamp = t;
02115     msg_ptr->header.frame_id = "base_link";
02116 
02117 
02118     arg = NULL;
02119     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ACCESSORYSTATE_CONNECTEDACCESSORIES_ID, arg);
02120     if (arg)
02121     {
02122       msg_ptr->id = arg->value.U8;
02123     }
02124 
02125     arg = NULL;
02126     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ACCESSORYSTATE_CONNECTEDACCESSORIES_ACCESSORY_TYPE, arg);
02127     if (arg)
02128     {
02129       msg_ptr->accessory_type = arg->value.I32;
02130     }
02131 
02132     arg = NULL;
02133     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ACCESSORYSTATE_CONNECTEDACCESSORIES_UID, arg);
02134     if (arg)
02135     {
02136       msg_ptr->uid = arg->value.String;
02137     }
02138 
02139     arg = NULL;
02140     HASH_FIND_STR (arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_ACCESSORYSTATE_CONNECTEDACCESSORIES_SWVERSION, arg);
02141     if (arg)
02142     {
02143       msg_ptr->swVersion = arg->value.String;
02144     }
02145 
02146     if (pub_enabled_) ros_pub_.publish(msg_ptr);
02147   }
02148 
02149 };  // Ardrone3AccessoryStateConnectedAccessories
02150 
02151 
02152 }  // namespace cb
02153 }  // namespace bebop_driver
02154 #endif  // BEBOP_AUTONOMY_AUTOGENERATED_ardrone3_STATE_CALLBACKS_H


bebop_driver
Author(s): Mani Monajjemi
autogenerated on Sat Jun 8 2019 20:37:45