Skip to content
Snippets Groups Projects
Commit 3da3e826 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

BugFix: play and pause of the simulator too quickly cause acceleration to be...

BugFix: play and pause of the simulator too quickly cause acceleration to be NaN and crash when Json converts it
parent c046867f
No related branches found
No related tags found
No related merge requests found
......@@ -180,7 +180,13 @@ public class ModelSimulation {
(velocity.getZ()-tmp_vel.getZ())/delay);
new_state.value_acceleration[0] = acceleration.getX();
new_state.value_acceleration[1] = acceleration.getY();
new_state.value_acceleration[2] = acceleration.getZ();
new_state.value_acceleration[2] = acceleration.getZ();
if(Double.isNaN(new_state.value_acceleration[0]))
new_state.value_acceleration[0]=0.0;
if(Double.isNaN(new_state.value_acceleration[1]))
new_state.value_acceleration[1]=0.0;
if(Double.isNaN(new_state.value_acceleration[2]))
new_state.value_acceleration[2]=0.0;
new_info.acceleration = acceleration.getNorm();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment