Skip to content

Commit

Permalink
pbio/drivebase: Prioritize heading on stall.
Browse files Browse the repository at this point in the history
Partially fixes pybricks/support#1032
  • Loading branch information
laurensvalk committed Apr 20, 2023
1 parent 7920923 commit abe43c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/pbio/src/drivebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ static void drivebase_adopt_settings(pbio_control_settings_t *s_distance, pbio_c
// diameter, the wheels are often quite close together, so this
// compensates by setting it at 33% instead of 40%.
s_heading->speed_default = s_heading->speed_max / 3;

// Most users intuitively expect heading control to take priority. When
// heading controller is completely saturated, this ensures that it "wins"
// against the distance controller.
s_heading->actuation_max = s_distance->actuation_max * 2;
}

/**
Expand Down

0 comments on commit abe43c4

Please sign in to comment.