File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed
Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,17 @@ void Mavlink::handle_msg_offboard_control(const mavlink_message_t * const msg)
479479 control.Fz .valid = !(ctrl.ignore & IGNORE_VALUE6);
480480
481481 if (listener_ != nullptr ) { listener_->offboard_control_callback (control); }
482+
483+ received_offboard_ctrl_ = true ;
484+ prev_offboard_msg_ = *msg;
485+ }
486+
487+ void Mavlink::send_previous_offboard_control ()
488+ {
489+ if (received_offboard_ctrl_) {
490+ send_message (prev_offboard_msg_);
491+ received_offboard_ctrl_ = false ;
492+ }
482493}
483494
484495void Mavlink::handle_msg_external_attitude (const mavlink_message_t * const msg)
Original file line number Diff line number Diff line change @@ -112,6 +112,11 @@ class Mavlink : public CommLinkInterface
112112 bool initialized_ = false ;
113113
114114 ListenerInterface * listener_ = nullptr ;
115+
116+ // Timing experiment
117+ bool received_offboard_ctrl_ = false ;
118+ mavlink_message_t prev_offboard_msg_;
119+ void send_previous_offboard_control () override ;
115120};
116121
117122} // namespace rosflight_firmware
Original file line number Diff line number Diff line change @@ -167,6 +167,9 @@ class CommLinkInterface
167167
168168 // register listener
169169 virtual void set_listener (ListenerInterface * listener) = 0;
170+
171+ // Timing experiments
172+ virtual void send_previous_offboard_control () = 0;
170173};
171174
172175} // namespace rosflight_firmware
Original file line number Diff line number Diff line change @@ -510,6 +510,7 @@ void CommManager::stream(got_flags got)
510510
511511 send_buffered_log_messages ();
512512
513+ comm_link_.send_previous_offboard_control ();
513514}
514515
515516void CommManager::send_next_param (void )
You can’t perform that action at this time.
0 commit comments