Set timestamp with vehicle commands

The vehicle_command uORB messages had the timestamp unset at 0.
This commit is contained in:
Julian Oes
2017-07-08 11:52:23 +02:00
committed by Lorenz Meier
parent d64b7706f5
commit 9854fc0d84
8 changed files with 18 additions and 1 deletions
+2
View File
@@ -63,6 +63,7 @@ int OutputMavlink::update(const ControlData *control_data)
vehicle_command.command = vehicle_command_s::VEHICLE_CMD_DO_MOUNT_CONFIGURE;
vehicle_command.target_system = _config.mavlink_sys_id;
vehicle_command.target_component = _config.mavlink_comp_id;
vehicle_command.timestamp = hrt_absolute_time();
if (control_data->type == ControlData::Type::Neutral) {
vehicle_command.param1 = vehicle_command_s::VEHICLE_MOUNT_MODE_NEUTRAL;
@@ -90,6 +91,7 @@ int OutputMavlink::update(const ControlData *control_data)
hrt_abstime t = hrt_absolute_time();
_calculate_output_angles(t);
vehicle_command.timestamp = t;
vehicle_command.command = vehicle_command_s::VEHICLE_CMD_DO_MOUNT_CONTROL;
vehicle_command.target_system = _config.mavlink_sys_id;
vehicle_command.target_component = _config.mavlink_comp_id;