udacity / dlnd-issue-reports

5 stars 0 forks source link

quadcopter physics_sim.py throws error with 0 rotor speed #599

Open jetojedno opened 6 years ago

jetojedno commented 6 years ago

The code in get_propeler_thrust should be:

        # fix for zero rotor speed
        if n>0.0:
            J = V / n * D
            # From http://m-selig.ae.illinois.edu/pubs/BrandtSelig-2011-AIAA-2011-1255-LRN-Propellers.pdf
            C_T = max(.12 - .07*max(0, J)-.1*max(0, J)**2, 0)
            thrusts.append(C_T * self.rho * n**2 * D**4)
        else:
            thrusts.append(0.0)