fixing code style and enter/exit radius logic

This commit is contained in:
Jimmy Johnson
2016-03-27 12:10:57 +02:00
committed by Lorenz Meier
parent dfc2d9b5e0
commit 142884bcd8
4 changed files with 87 additions and 90 deletions
+6 -4
View File
@@ -127,7 +127,7 @@ MavlinkReceiver::MavlinkReceiver(Mavlink *parent) :
_manual_pub(nullptr),
_land_detector_pub(nullptr),
_time_offset_pub(nullptr),
_follow_me_pub(nullptr),
_follow_target_pub(nullptr),
_control_mode_sub(orb_subscribe(ORB_ID(vehicle_control_mode))),
_hil_frames(0),
_old_timestamp(0),
@@ -1642,11 +1642,13 @@ void MavlinkReceiver::handle_message_follow_target(mavlink_message_t *msg)
follow_target_topic.lon = follow_target_msg.lon*1e-7;
follow_target_topic.alt = follow_target_msg.alt;
if (_follow_me_pub == nullptr) {
_follow_me_pub = orb_advertise(ORB_ID(follow_target), &follow_target_topic);
if (_follow_target_pub == nullptr) {
_follow_target_pub = orb_advertise(ORB_ID(follow_target), &follow_target_topic);
} else {
orb_publish(ORB_ID(follow_target), _follow_me_pub, &follow_target_topic);
orb_publish(ORB_ID(follow_target), _follow_target_pub, &follow_target_topic);
}
warnx("new msg recieved");
}
void
+1 -1
View File
@@ -199,7 +199,7 @@ private:
orb_advert_t _manual_pub;
orb_advert_t _land_detector_pub;
orb_advert_t _time_offset_pub;
orb_advert_t _follow_me_pub;
orb_advert_t _follow_target_pub;
int _control_mode_sub;
int _hil_frames;
uint64_t _old_timestamp;