Skip to content

Commit 521bdbd

Browse files
committed
add parameter ned
1 parent a394655 commit 521bdbd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/common.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function init_system(kv::AbstractKiteViewer, scene; show_kite=true)
6868
end
6969

7070
# update the kite power system, consisting of the tether, the kite and the state (text and numbers)
71-
function update_system(kv::AKV, state::SysState; scale=1.0, kite_scale=1.0)
71+
function update_system(kv::AKV, state::SysState; scale=1.0, kite_scale=1.0, ned=true)
7272
azimuth = state.azimuth
7373
if azimuth 0 # suppress -0 and replace it with 0
7474
azimuth=zero(azimuth)
@@ -200,7 +200,11 @@ function update_system(kv::AKV, state::SysState; scale=1.0, kite_scale=1.0)
200200

201201
if fourpoint
202202
s = kv.set.segments
203-
q0 = state.orient # SVector in the order w,x,y,z
203+
if ned
204+
q0 = quat2viewer(state.orient) # SVector in the order w,x,y,z
205+
else
206+
q0 = state.orient # SVector in the order w,x,y,z
207+
end
204208
quat[] = Quaternionf(q0[2], q0[3], q0[4], q0[1]) # the constructor expects the order x,y,z,w
205209
kite_pos[] = 0.8 * 0.5 * (kv.points[s+4] + kv.points[s+5]) + 0.2 * kv.points[s+1]
206210
elseif fourpoint_3l

0 commit comments

Comments
 (0)