Skip to content

Commit

Permalink
Add function to index into cogmap (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetmelon committed Sep 22, 2022
1 parent 073da34 commit 3056a4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Firmware/MotorControl/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class Controller : public ODriveIntf::ControllerIntf {
// TODO: make this more similar to other calibration loops
void start_anticogging_calibration();
bool anticogging_calibration(float pos_estimate, float vel_estimate);

float get_anticogging_value(uint32_t index) {
return (index < 3600) ? config_.anticogging.cogging_map[index] : 0.0f;
}

void update_filter_gains();
bool update();
Expand Down
1 change: 1 addition & 0 deletions Firmware/odrive-interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,7 @@ interfaces:
usually corresponds roughly to the current position of the axis.'
}
start_anticogging_calibration:
get_anticogging_value: {in: {index: uint32}, out: {val: float32}}


ODrive.Encoder:
Expand Down

0 comments on commit 3056a4c

Please sign in to comment.