Reset trajectory_done_ during homing to fix #634

This commit is contained in:
Paul Guenette
2021-10-26 20:34:43 -04:00
parent d1bb0049bf
commit 7402cf8044
2 changed files with 5 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ Please add a note of your changes below this heading if you make a Pull Request.
* CANSimple messages which previously required the rtr bit to be set will now also respond if DLC = 0
* Ensure endstops update before being checked for errors, to prevent [#625](https://github.com/odriverobotics/ODrive/issues/625)
* Reset trajectory_done_ during homing to ensure a new trajectory is actually computed [#634](https://github.com/odriverobotics/ODrive/issues/634)
# Releases
## [0.5.4] - 2021-10-12

View File

@@ -421,6 +421,10 @@ bool Axis::run_homing() {
controller_.pos_setpoint_ = pos_estimate_local.value();
controller_.vel_setpoint_ = 0.0f;
controller_.input_pos_updated();
// Synchronization issue. Ensure trajectory_done is false prior to the while loop, so that
// the controller has time to run move_to_pos() on the next update()
controller_.trajectory_done_ = false;
while ((requested_state_ == AXIS_STATE_UNDEFINED) && motor_.is_armed_ && !(done = controller_.trajectory_done_)) {
osDelay(1);