mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 08:03:34 +08:00
Set timestamp with vehicle commands
The vehicle_command uORB messages had the timestamp unset at 0.
This commit is contained in:
@@ -479,7 +479,9 @@ MissionBlock::issue_command(const struct mission_item_s *item)
|
||||
PX4_INFO("forwarding command %d", item->nav_cmd);
|
||||
struct vehicle_command_s cmd = {};
|
||||
mission_item_to_vehicle_command(item, &cmd);
|
||||
_action_start = hrt_absolute_time();
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
_action_start = now;
|
||||
cmd.timestamp = now;
|
||||
|
||||
_navigator->publish_vehicle_cmd(cmd);
|
||||
}
|
||||
@@ -715,6 +717,7 @@ MissionBlock::set_land_item(struct mission_item_s *item, bool at_current_locatio
|
||||
struct vehicle_command_s cmd = {};
|
||||
cmd.command = NAV_CMD_DO_VTOL_TRANSITION;
|
||||
cmd.param1 = vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC;
|
||||
cmd.timestamp = hrt_absolute_time();
|
||||
|
||||
_navigator->publish_vehicle_cmd(cmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user