Skip to content

Commit

Permalink
Sub: optimise get-posvelaccel-target usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Sep 17, 2024
1 parent 380518b commit d971584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ArduSub/mode_guided.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ float ModeGuided::get_auto_heading()
float track_bearing = get_bearing_cd(sub.wp_nav.get_wp_origin().xy(), sub.wp_nav.get_wp_destination().xy());

// Bearing from current position towards intermediate position target (centidegrees)
const Vector2f target_vel_xy{position_control->get_vel_target_cms().x, position_control->get_vel_target_cms().y};
const Vector2f target_vel_xy = position_control->get_vel_target_cms().xy();
float angle_error = 0.0f;
if (target_vel_xy.length() >= position_control->get_max_speed_xy_cms() * 0.1f) {
const float desired_angle_cd = degrees(target_vel_xy.angle()) * 100.0f;
Expand Down

0 comments on commit d971584

Please sign in to comment.