Skip to content

Commit

Permalink
AP_Scripting: added timestamp to SIYI_control
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Oct 5, 2024
1 parent b0c2d3f commit 6573aed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libraries/AP_Scripting/drivers/SIYI_control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ end
function send_packet_fmt(command_id, fmt, ...)
local args = { ... }
fmt = fmt or ""


if SIYI_DEBUG:get() > 1 then
gcs:send_text(MAV_SEVERITY.INFO, string.format("Sending cmd=0x%02x fmt=%s", command_id, fmt))
end
local success, err = pcall(function()
local packed_pkt = string.pack(fmt, table.unpack(args))
send_packet(command_id, packed_pkt)
Expand Down Expand Up @@ -228,7 +231,9 @@ local function handle_temp_full_screen(data)
return
end

local data = string.pack("<iifffHHffffff", loc:lat(), loc:lng(), loc:alt()*0.01, gpsloc:alt()*0.01,
local data = string.pack("<iiifffHHffffff",
millis():toint(),
loc:lat(), loc:lng(), loc:alt()*0.01, gpsloc:alt()*0.01,
tmax*0.01, tmax_x, tmax_y,
siyi_attitude[1], siyi_attitude[2], siyi_attitude[3],
math.deg(ahrs:get_roll()), math.deg(ahrs:get_pitch()), math.deg(ahrs:get_yaw()))
Expand Down

0 comments on commit 6573aed

Please sign in to comment.