Skip to content

Commit

Permalink
Copter:scale input and add PSC PID logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsgeyer committed Sep 15, 2023
1 parent 7d20ec3 commit d436efb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ArduCopter/mode_systemid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,24 +289,24 @@ void ModeSystemId::run()
break;
case AxisType::DISTURB_POS_LAT:
disturb_state.x = 0.0f;
disturb_state.y = waveform_sample;
disturb_state.y = waveform_sample * 100.0f;
copter.rotate_target_body_frame_to_NE(disturb_state.x, disturb_state.y);
pos_control->set_disturb_pos_cm(disturb_state);
break;
case AxisType::DISTURB_POS_LONG:
disturb_state.x = waveform_sample;
disturb_state.x = waveform_sample * 100.0f;
disturb_state.y = 0.0f;
copter.rotate_target_body_frame_to_NE(disturb_state.x, disturb_state.y);
pos_control->set_disturb_pos_cm(disturb_state);
break;
case AxisType::DISTURB_VEL_LAT:
disturb_state.x = 0.0f;
disturb_state.y = waveform_sample;
disturb_state.y = waveform_sample * 100.0f;
copter.rotate_target_body_frame_to_NE(disturb_state.x, disturb_state.y);
pos_control->set_disturb_vel_cms(disturb_state);
break;
case AxisType::DISTURB_VEL_LONG:
disturb_state.x = waveform_sample;
disturb_state.x = waveform_sample * 100.0f;
disturb_state.y = 0.0f;
copter.rotate_target_body_frame_to_NE(disturb_state.x, disturb_state.y);
pos_control->set_disturb_vel_cms(disturb_state);
Expand Down Expand Up @@ -476,6 +476,9 @@ void ModeSystemId::log_data() const
|| (AxisType)axis.get() == AxisType::DISTURB_VEL_LAT || (AxisType)axis.get() == AxisType::DISTURB_VEL_LONG
|| (AxisType)axis.get() == AxisType::INPUT_LOITER_LAT || (AxisType)axis.get() == AxisType::INPUT_LOITER_LONG) {
pos_control->write_log();
copter.logger.Write_PID(LOG_PIDN_MSG, pos_control->get_vel_xy_pid().get_pid_info_x());
copter.logger.Write_PID(LOG_PIDE_MSG, pos_control->get_vel_xy_pid().get_pid_info_y());

}
}

Expand Down

0 comments on commit d436efb

Please sign in to comment.