PX4 APP

Application List

Top

nsh> top

Processes: 20 total, 2 running, 18 sleeping
CPU usage: 33.80% tasks, 0.66% sched, 65.54% idle
DMA Memory: 5120 total, 0 used 0 peak
Uptime: 44.153s total, 29.698s idle

 PID COMMAND                   CPU(ms) CPU(%)  USED/STACK PRIO(BASE) STATE
   0 Idle Task                   29698 65.539     0/    0   0 (  0)  READY
   1 hpwork                        784  2.065   764/ 1592 192 (192)  w:sig
   2 lpwork                        206  0.469   572/ 1592  50 ( 50)  READY
   3 init                         1278  0.000  1628/ 2496 100 (100)  w:sem
 241 top                            45  3.286  1268/ 1696 100 (100)  RUN
  93 gps                            48  0.093   900/ 1192 220 (220)  w:sem
 122 sensors                      1829  4.037  1028/ 1496 250 (250)  w:sem
 124 commander                     851  1.877  2404/ 2992 140 (140)  w:sig
 126 commander_low_prio              1  0.000   644/ 2992  50 ( 50)  w:sem
 134 px4io                        1336  3.192   948/ 1392 240 (240)  w:sem
 140 mavlink_if0                   497  1.126  1692/ 2392 100 (100)  READY
 141 mavlink_rcv_if0                12  0.000  1216/ 2096 175 (175)  w:sem
 148 mavlink_if1                   406  0.938  1692/ 2392 100 (100)  READY
 149 mavlink_rcv_if1                 3  0.000   996/ 2096 175 (175)  w:sem
 175 nshterm                         0  0.000   836/ 1496  70 ( 70)  w:sem
 215 attitude_estimator_q         1186  3.098  1292/ 1992 250 (250)  w:sem
 217 lp_estimator                 3628  9.671 10652/12992 250 (250)  w:sem
 228 mc_att_control               1378  3.474  1228/ 1496 250 (250)  w:sem
 231 mc_pos_control                200  0.469  1068/ 1896 250 (250)  w:sem
 234 navigator                       4  0.000   812/ 1296 105 (105)  w:sem

Help

nsh> help
help usage:  help [-v] [<cmd>]

  [           dd          hexdump     mkfifo      pwd         umount
  ?           df          kill        mkrd        rm          unset
  cat         echo        losetup     mh          rmdir       usleep
  cd          exec        ls          mount       set         xd
  cp          exit        mb          mv          sh
  cmp         free        mkdir       mw          sleep
  date        help        mkfatfs     ps          test

Builtin Apps:
  adc
  tone_alarm
  fmu
  px4io
  rgbled
  mpu6000
  mpu9250
  lsm303d
  l3gd20
  hmc5883
  ms5611
  srf02
  sf0x
  ll40ls
  trone
  gps
  pwm_out_sim
  blinkm
  ets_airspeed
  meas_airspeed
  frsky_telemetry
  sensors
  px4flow
  gimbal
  pwm_input
  camera_trigger
  bst
  snapdragon_rc_pwm
  lis3mdl
  bl_update
  config
  dumpfile
  mixer
  mtd
  nshterm
  param
  perf
  pwm
  reboot
  top
  ver
  commander
  load_mon
  navigator
  mavlink
  uavcan
  land_detector
  attitude_estimator_q
  position_estimator_inav
  local_position_estimator
  ekf2
  fw_pos_control_l1
  fw_att_control
  mc_att_control
  mc_pos_control
  vtol_att_control
  sdlog2
  uorb
  dataman
  serdis
  sercon

PS

nsh> ps
PID   PRI SCHD TYPE   NP STATE    NAME
    0   0 FIFO TASK      READY    Idle Task()
    1 192 FIFO KTHREAD   WAITSIG  hpwork()
    2  50 FIFO KTHREAD   WAITSIG  lpwork()
    3 100 FIFO TASK      WAITSEM  init()
  228 250 FIFO TASK      WAITSEM  mc_att_control()
  134 240 FIFO TASK      WAITSEM  px4io()
  231 250 FIFO TASK      WAITSEM  mc_pos_control()
  234 105 FIFO TASK      WAITSEM  navigator()
  140 100 FIFO TASK      WAITSIG  mavlink_if0(1000a2f0, 10004110, 10008760, 100048e0)
  141 175 FIFO PTHREAD   WAITSEM  mavlink_rcv_if0(2000d080)
  175  70 FIFO TASK      RUNNING  nshterm(1000c3c0)
  148 100 FIFO TASK      WAITSIG  mavlink_if1(20011640, 20011650, 20011660, 20011670, 20011690, 200116a0, 200116b0, 200116c0, 200116d0, 200116e0)
  149 175 FIFO PTHREAD   WAITSEM  mavlink_rcv_if1(200116f0)
  215 250 FIFO TASK      WAITSEM  attitude_estimator_q()
  217 250 FIFO TASK      WAITSEM  lp_estimator()
  122 250 FIFO TASK      WAITSEM  sensors()
  124 140 FIFO TASK      WAITSIG  commander(1000a0d0, 1000a900)
   93 220 FIFO TASK      WAITSEM  gps(10003d20)
  126  50 FIFO PTHREAD   WAITSEM  commander_low_prio(0)
nsh>

Apps

  • hpwork : high priority worker queue
  • lpwork : low priority work queue
  • mc_att_control: multicopter attitude controller
  • px4io : PX4IO driver interfaces to sends servo, battery voltage, current, rc input
  • mc_pos_control: multicopter position controller // http://www-personal.acfr.usyd.edu.au/spns/cdm/papers/Mellinger.pdf
  • navigator: Helper class to access missions, mission, rtl, follow, takeoff, loiter, geofence, failure
  • nshterm: nshell
  • mavlink: mavlink!
  • attitude_estimator_q: attitude estimator (q stands for quaternion based)
  • lp_estimator: local position estimator, use extended kalman filter for 3D position and velocity states. http://dev.px4.io/advanced-switching_state_estimators.html
  • sensors: gather all data from the gyroscope, accelerometer, magnetometer, barometer, ADC, and IO RC inputs (PPM, Spektrum, S.Bus)
  • commander: Main state machine / business logic. 코드가 길다.
  • gps: gps driver

Test APP

https://pixhawk.org/firmware/apps/tests

nsh> tests help
Available tests:
  led
  int
  float
  sensors
  gpio
  hrt
  ppm
  servo
  adc
  jig_voltages
  eeproms
  uart_loopback
  uart_baudchange
  uart_send
  uart_console
  tone
  sleep
  time
  perf
  all
  jig
  help
nsh> tests sensors
Running sensors tests:

sensor: l3gd20
L3GD20: test start
L3GD20 values #1: x:-1 y:-140 z:-23
L3GD20 values #2: x:8 y:-104 z:-3
L3GD20: Drained FIFO with 1 values (expected 8-12)
L3GD20: Note: read3 got data - there should not have been data ready
OK: L3GD20 passed all tests successfully
sensor: bma180
BMA180: test start
BMA180 values: x:-84 y:-6 z:2085
BMA180: x:-75 y:-37 z:2063
OK: BMA180 passed all tests successfully
sensor: hmc5883l
HMC5883L: test start
HMC5883L: read1 fail (1) values: x:0 y:0 z:0
sensor: ms5611
MS5611: test start
MS5611: pressure:1014.220 mbar - altitude: -8.-7 meters - temp:25.78 deg celcius
MS5611: pressure:1014.120 mbar - altitude: -7.-24 meters - temp:25.78 deg celcius
MS5611: pressure:1014.060 mbar - altitude: -6.-74 meters - temp:25.78 deg celcius
OK: MS5611 passed all tests successfully
sensor: mpu6000
MPU-6000: test start
MPU-6000: open fail

질문: 무슨 센서가 잘못되었나?