Skip to content

Commit d4493fe

Browse files
committed
pbio/drivebase: Prioritize heading on stall.
Partially fixes pybricks/support#1032
1 parent 7920923 commit d4493fe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
time ([support#1022]).
1212
- Fixed iterator for `Matrix` objects giving bad values.
1313
- Fixed Bluetooth sometimes locking up on Technic/City hubs ([support#567]).
14+
- Fixed `GyroDriveBase` being slow to respond to heading perturbations when
15+
driving at high speed ([support#1032]).
1416

1517
### Added
1618
- Added `pybricks.geometry.cross(a, b)` to get a vector cross product.
@@ -37,6 +39,7 @@
3739
[support#992]: https://github.com/pybricks/support/issues/992
3840
[support#1022]: https://github.com/pybricks/support/issues/1022
3941
[support#1026]: https://github.com/pybricks/support/issues/1026
42+
[support#1032]: https://github.com/pybricks/support/issues/1032
4043

4144
## [3.3.0b3] - 2023-03-28
4245

lib/pbio/src/drivebase.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ static void drivebase_adopt_settings(pbio_control_settings_t *s_distance, pbio_c
106106
// diameter, the wheels are often quite close together, so this
107107
// compensates by setting it at 33% instead of 40%.
108108
s_heading->speed_default = s_heading->speed_max / 3;
109+
110+
// Most users intuitively expect heading control to take priority. When
111+
// heading controller is completely saturated, this ensures that it "wins"
112+
// against the distance controller.
113+
s_heading->actuation_max = s_distance->actuation_max * 2;
109114
}
110115

111116
/**

0 commit comments

Comments
 (0)