apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Maybe obtained a NAN value when calculate lon_controller cmd

Open follow123 opened this issue 8 years ago • 1 comments

In apollo\modules\control\controller\lon_controller.cc, line 220

double slope_offset_compenstaion = digital_filter_pitch_angle_.Filter( GRA_ACC * std::sin(VehicleStateProvider::instance()->pitch()));

the values of slope_offset_compenstaion maybe 1.#QNAN000, this can lead to an error in computing the acceleration_cmd

double acceleration_cmd = acceleration_cmd_closeloop + debug->preview_acceleration_reference() + FLAGS_enable_slope_offset * debug->slope_offset_compensation();

Maybe a judgment need to be added after the calculation of slope_offset_compenstaion, like:

if (isnan(slope_offset_compenstaion)) { slope_offset_compenstaion = 0; }

follow123 avatar Jun 29 '18 03:06 follow123

@follow123, thanks for your reporting! Would you like to submit a patch to fix that?

freeHackOfJeff avatar Jul 02 '18 12:07 freeHackOfJeff