Hey there! You're in luck--There is a well known solution to this.
You can find a detailed video that indirectly addresses the issue
here
The issue is that the PID calculations can produce NaN if the timestep is too small. Sending NaN as a protobuf message over gazebo transport turns into 2000 netwons in Gazebo, and the robot kinda explodes... I haven't worked out a good solution to this yet, but an easy temporary fix is to write pidOutput in an if statement.
EX:
Code:
void usePIDOutput(double output){
if (!Double.isNaN(output)){
motor.set(output);
}
}