Skip to content

Commit

Permalink
No more minus signs
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Oct 28, 2024
1 parent e167577 commit 5abd784
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/parking_controller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function navigate(pc::ParkingController, azimuth, elevation; limit=50.0)
end
y = sin(phi_set - phi) * cos(beta_set)
x = cos(beta) * sin(beta_set) - sin(beta) * cos(beta_set) * cos(phi_set - phi)
pc.chi_set = atan(-y, x)
pc.chi_set = atan(y, x)
end

"""
Expand Down
8 changes: 4 additions & 4 deletions examples/parking_wind_dir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ function sim_parking(integrator)
time = i * dt
steering = 0.0
if i > 100
heading = calc_heading(kps4; neg_azimuth=true, one_point=false)
if i == 100
pc.last_heading = heading
pc.last_heading = sys_state.heading
end
elevation = sys_state.elevation
chi_set = -navigate(pc, sys_state.azimuth, elevation)
steering, ndi_gain, psi_dot, psi_dot_set = calc_steering(pc, heading, chi_set; elevation, v_app = sys_state.v_app)
chi_set = navigate(pc, sys_state.azimuth, elevation)
steering, ndi_gain, psi_dot, psi_dot_set = calc_steering(pc, sys_state.heading, chi_set;
elevation, v_app = sys_state.v_app)
set_depower_steering(kps4.kcu, MIN_DEPOWER, steering)
end
SET_STEERING[i] = steering
Expand Down

0 comments on commit 5abd784

Please sign in to comment.