mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 14:13:35 +08:00
input_rc.msg: remove timestamp_publication, use timestamp instead
This commit is contained in:
@@ -197,7 +197,7 @@ void RcInput::_measure(void)
|
||||
}
|
||||
|
||||
ts = hrt_absolute_time();
|
||||
_data.timestamp_publication = ts;
|
||||
_data.timestamp = ts;
|
||||
_data.timestamp_last_signal = ts;
|
||||
_data.channel_count = _channels;
|
||||
_data.rssi = 100;
|
||||
|
||||
@@ -323,7 +323,7 @@ void handle_message(mavlink_message_t *rc_message)
|
||||
{
|
||||
mavlink_rc_channels_t rc;
|
||||
mavlink_msg_rc_channels_decode(rc_message, &rc);
|
||||
_rc.timestamp_publication = hrt_absolute_time();
|
||||
_rc.timestamp = hrt_absolute_time();
|
||||
_rc.timestamp_last_signal = hrt_absolute_time();
|
||||
_rc.channel_count = rc.chancount;
|
||||
_rc.rc_lost = false;
|
||||
|
||||
@@ -810,8 +810,8 @@ PX4FMU::fill_rc_in(uint16_t raw_rc_count,
|
||||
}
|
||||
}
|
||||
|
||||
_rc_in.timestamp_publication = now;
|
||||
_rc_in.timestamp_last_signal = _rc_in.timestamp_publication;
|
||||
_rc_in.timestamp = now;
|
||||
_rc_in.timestamp_last_signal = _rc_in.timestamp;
|
||||
_rc_in.rc_ppm_frame_length = 0;
|
||||
|
||||
/* fake rssi if no value was provided */
|
||||
|
||||
@@ -1839,7 +1839,7 @@ PX4IO::io_get_raw_rc_input(rc_input_values &input_rc)
|
||||
|
||||
_rc_chan_count = channel_count;
|
||||
|
||||
input_rc.timestamp_publication = hrt_absolute_time();
|
||||
input_rc.timestamp = hrt_absolute_time();
|
||||
|
||||
input_rc.rc_ppm_frame_length = regs[PX4IO_P_RAW_RC_DATA];
|
||||
|
||||
@@ -1868,7 +1868,7 @@ PX4IO::io_get_raw_rc_input(rc_input_values &input_rc)
|
||||
|
||||
/* rc_lost has to be set before the call to this function */
|
||||
if (!input_rc.rc_lost && !input_rc.rc_failsafe) {
|
||||
_rc_last_valid = input_rc.timestamp_publication;
|
||||
_rc_last_valid = input_rc.timestamp;
|
||||
}
|
||||
|
||||
input_rc.timestamp_last_signal = _rc_last_valid;
|
||||
|
||||
@@ -234,7 +234,7 @@ void set_pwm_output(mavlink_actuator_control_target_t *actuator_controls)
|
||||
void send_rc_mavlink()
|
||||
{
|
||||
mavlink_rc_channels_t rc_message;
|
||||
rc_message.time_boot_ms = _rc.timestamp_publication / 1000;
|
||||
rc_message.time_boot_ms = _rc.timestamp / 1000;
|
||||
rc_message.chancount = _rc.channel_count;
|
||||
rc_message.chan1_raw = (_rc.channel_count > 0) ? _rc.values[0] : UINT16_MAX;
|
||||
rc_message.chan2_raw = (_rc.channel_count > 1) ? _rc.values[1] : UINT16_MAX;
|
||||
|
||||
Reference in New Issue
Block a user