added measurement print option to calibration
This commit is contained in:
parent
fc0e75f15c
commit
71e59e20bb
6 changed files with 18 additions and 11 deletions
|
|
@ -22,7 +22,8 @@ bool measure_calibration_data(
|
|||
ServoController& servo_controller,
|
||||
float calibration_range,
|
||||
float field_velocity,
|
||||
size_t table_size)
|
||||
size_t table_size,
|
||||
bool print_measurements)
|
||||
{
|
||||
LOG_INFO("Measuring motor to encoder angle lookup table...");
|
||||
int sample_count = table_size*4;
|
||||
|
|
@ -47,6 +48,9 @@ bool measure_calibration_data(
|
|||
float motor_pos = (field_angle-start_field_angle)/pole_pair_count;
|
||||
// TODO: read motor_pos from precise reference encoder
|
||||
|
||||
if(print_measurements)
|
||||
LOG_INFO("%f, %15.10f, %15.10f", encoder_angle_raw, field_angle, motor_pos);
|
||||
|
||||
encoder_angle_and_motor_pos.push_back({encoder_angle_raw, motor_pos});
|
||||
motor_pos_and_field_angle.push_back({motor_pos, field_angle});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,5 +18,6 @@ bool measure_calibration_data(
|
|||
ServoController& servo_controller,
|
||||
float field_angle_range,
|
||||
float field_velocity,
|
||||
size_t size);
|
||||
size_t size,
|
||||
bool print_measurements);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue