Skip to content

Commit

Permalink
pbio/drivebase: Fix gyro use not resetting.
Browse files Browse the repository at this point in the history
This was called before the drivebase could be used, and the error was not returned.

Fixes 3ae1fb8 (which was unreleased).
  • Loading branch information
laurensvalk committed Oct 23, 2023
1 parent 6044449 commit 5e83281
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/pbio/src/drivebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ pbio_error_t pbio_drivebase_get_drivebase(pbio_drivebase_t **db_address, pbio_se
db->left = left;
db->right = right;

// By default, don't use gyro.
pbio_drivebase_set_use_gyro(db, false);

// Set parents of both servos, so they can stop this drivebase.
pbio_parent_set(&left->parent, db, pbio_drivebase_stop_from_servo);
pbio_parent_set(&right->parent, db, pbio_drivebase_stop_from_servo);
Expand Down Expand Up @@ -332,7 +329,8 @@ pbio_error_t pbio_drivebase_get_drivebase(pbio_drivebase_t **db_address, pbio_se
return PBIO_ERROR_INVALID_ARG;
}

return PBIO_SUCCESS;
// Finish setup. By default, don't use gyro.
return pbio_drivebase_set_use_gyro(db, false);
}

/**
Expand Down

0 comments on commit 5e83281

Please sign in to comment.