View Single Post
  #3   Spotlight this post!  
Unread 02-13-2016, 05:09 PM
Peter Mitrano Peter Mitrano is offline
Registered User
no team
 
Join Date: Jan 2016
Location: Worcester MA
Posts: 23
Peter Mitrano is an unknown quantity at this point
Re: FRCSIM Gazebo Model Problem

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);
  }
}