Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Oct 27, 2024
1 parent 2bba7a0 commit 82c8e52
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/joystick.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ if ! @isdefined js;
const jsbuttons = JSButtonState()
async_read!(js, jsaxes, jsbuttons)
end
wcs::WCSettings = WCSettings(); wcs.dt = 1/set.sample_freq
fcs::FPCSettings = FPCSettings(dt=wcs.dt)
fpps::FPPSettings = FPPSettings()
wcs::WCSettings = WCSettings(true, dt = 1/set.sample_freq)
fcs::FPCSettings = FPCSettings(true, dt=wcs.dt)
fpps::FPPSettings = FPPSettings(true)
u_d0 = 0.01 * set.depower_offset
u_d = 0.01 * set.depower
ssc::SystemStateControl = SystemStateControl(wcs, fcs, fpps; u_d0, u_d)
ssc::SystemStateControl = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind = set.v_wind)
dt::Float64 = wcs.dt

# the following values can be changed to match your interest
Expand Down Expand Up @@ -51,7 +51,8 @@ function simulate(integrator)
depower = KiteControllers.get_depower(ssc)
# println("dp: ", dp)
if depower < 0.22; depower = 0.22; end
steering = calc_steering(ssc, jsaxes.x)
heading = calc_heading(app.kps4; neg_azimuth=true)
steering = calc_steering(ssc, jsaxes.x; heading)
set_depower_steering(kps4.kcu, depower, steering)
println("depower: ", depower, " steering: ", round(steering, digits=3))
# set_depower_steering(kps4.kcu, depower, jsaxes.x)
Expand Down

0 comments on commit 82c8e52

Please sign in to comment.