original_docstring: 
      This is the preflight sequence. It calls all other subroutines before takeoff.
      
docstring: This is the preflight sequence. It calls all other subroutines before takeoff.
docstring_tokens: This is the preflight sequence . It calls all other subroutines before takeoff .
code: def preflight_sequence(scf: SyncCrazyflie):
      """
      This is the preflight sequence. It calls all other subroutines before takeoff.
      """
      cf = scf.cf  # type: Crazyflie
  
      # switch to Kalman filter
      cf.param.set_value('stabilizer.estimator', '2')
      cf.param.set_value('locSrv.extQuatStdDev', 0.06)
  
      # enable high level commander
      cf.param.set_value('commander.enHighLevel', '1')
  
      # prepare for motor shut-off
      cf.param.set_value('motorPowerSet.enable', '0')
      cf.param.set_value('motorPowerSet.m1', '0')
      cf.param.set_value('motorPowerSet.m2', '0')
      cf.param.set_value('motorPowerSet.m3', '0')
      cf.param.set_value('motorPowerSet.m4', '0')
  
      # ensure params are downloaded
      wait_for_param_download(scf)
  
      # make sure not already flying
      # land_sequence(scf)
  
      cf.param.set_value('ring.effect', '0')
  
      # set pid gains, tune down Kp to smooth trajectories
      cf.param.set_value('posCtlPid.xKp', '1')
      cf.param.set_value('posCtlPid.yKp', '1')
      cf.param.set_value('posCtlPid.zKp', '1')
  
      # set maximum velocity (m/s)
      cf.param.set_value('posCtlPid.xyVelMax', MAX_VELOCITY)
      cf.param.set_value('posCtlPid.zVelMax', MAX_VELOCITY)
  
      # enable logging
      cf.param.set_value('usd.logging', '1')
  
      # check battery level
      check_battery(scf, 3.7)
  
      # reset the estimator
      reset_estimator(scf)
  
      # check state
      check_state(scf)
code_tokens: def preflight_sequence ( scf : SyncCrazyflie ) : cf = scf . cf cf . param . set_value ( 'stabilizer.estimator' , '2' ) cf . param . set_value ( 'locSrv.extQuatStdDev' , 0.06 ) cf . param . set_value ( 'commander.enHighLevel' , '1' ) cf . param . set_value ( 'motorPowerSet.enable' , '0' ) cf . param . set_value ( 'motorPowerSet.m1' , '0' ) cf . param . set_value ( 'motorPowerSet.m2' , '0' ) cf . param . set_value ( 'motorPowerSet.m3' , '0' ) cf . param . set_value ( 'motorPowerSet.m4' , '0' ) wait_for_param_download ( scf ) cf . param . set_value ( 'ring.effect' , '0' ) cf . param . set_value ( 'posCtlPid.xKp' , '1' ) cf . param . set_value ( 'posCtlPid.yKp' , '1' ) cf . param . set_value ( 'posCtlPid.zKp' , '1' ) cf . param . set_value ( 'posCtlPid.xyVelMax' , MAX_VELOCITY ) cf . param . set_value ( 'posCtlPid.zVelMax' , MAX_VELOCITY ) cf . param . set_value ( 'usd.logging' , '1' ) check_battery ( scf , 3.7 ) reset_estimator ( scf ) check_state ( scf )
short_docstring: This is the preflight sequence.
short_docstring_tokens: This is the preflight sequence .
comment: """
      This is the preflight sequence. It calls all other subroutines before takeoff.
      """$SEP$# type: Crazyflie$SEP$# switch to Kalman filter$SEP$# enable high level commander$SEP$# prepare for motor shut-off$SEP$# ensure params are downloaded$SEP$# make sure not already flying$SEP$# land_sequence(scf)$SEP$# set pid gains, tune down Kp to smooth trajectories$SEP$# set maximum velocity (m/s)$SEP$# enable logging$SEP$# check battery level$SEP$# reset the estimator$SEP$# check state