Skip to content

Commit

Permalink
Merge pull request #2 from PX4/master
Browse files Browse the repository at this point in the history
合并主分支
  • Loading branch information
crossa authored Mar 21, 2017
2 parents a7d9e1d + 8f1e851 commit 1ba268a
Show file tree
Hide file tree
Showing 172 changed files with 2,943 additions and 2,883 deletions.
18 changes: 14 additions & 4 deletions Debug/poor-mans-profiler.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/bash
#
# Author: Pavel Kirienko <[email protected]>
#
# Poor man's sampling profiler for NuttX.
#
# Usage: Install flamegraph.pl in your PATH, configure your .gdbinit, run the script with proper arguments and go
# have a coffee. When you're back, you'll see the flamegraph. Note that frequent calls to GDB significantly
# interfere with normal operation of the target, which means that you can't profile real-time tasks with it.
# For best results, ensure that the PC is not overloaded, the USB host controller to which the debugger is
# connected is not congested. You should also allow the current user to set negative nice values.
#
# The FlameGraph script can be downloaded from https://github.com/brendangregg/FlameGraph. Thanks Mr. Gregg.
#
# Requirements: ARM GDB with Python support
# Requirements: ARM GDB with Python support. You can get one by downloading the sources from
# https://launchpad.net/gcc-arm-embedded and building them with correct flags.
# Note that Python support is not required if no per-task sampling is needed.
#

set -e
Expand All @@ -33,7 +41,7 @@ which flamegraph.pl > /dev/null || die "Install flamegraph.pl first"
nsamples=0
sleeptime=0.1 # Doctors recommend 7-8 hours a day
taskname=
elf=$root/Build/px4fmu-v2_default.build/firmware.elf
elf=
append=0
fgfontsize=10
fgwidth=1900
Expand Down Expand Up @@ -69,6 +77,8 @@ do
shift
done

[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build_px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx"

#
# Temporary files
#
Expand Down Expand Up @@ -237,8 +247,8 @@ for s, f in sorted(stacks.items(), key=lambda (s, f): s):
print('Total stack frames:', num_stack_frames, file=sys.stderr)
print('Top consumers (distribution of the stack tops):', file=sys.stderr)
for name,num in sorted(stack_tops.items(), key=lambda (name, num): num, reverse=True)[:10]:
print('% 5.1f%% ' % (100 * num / num_stack_frames), name, file=sys.stderr)
for name,num in sorted(stack_tops.items(), key=lambda (name, num): num, reverse=True)[:300]:
print('% 7.3f%% ' % (100 * num / num_stack_frames), name, file=sys.stderr)
EOF

cat $stacksfile | python /tmp/pmpn-folder.py > $foldfile
Expand Down
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/4012_quad_x_can
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ then
param set MC_YAWRATE_D 0.0
fi

set MIXER quad_x_can
set OUTPUT_MODE uavcan_esc
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/mixers/quad_x_can.main.mix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
R: 4x 10000 10000 10000 0
6 changes: 3 additions & 3 deletions ROMFS/px4fmu_test/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uorb start

if rgbled start
then
rgbled rgb 20 20 255
led_control on -c blue
fi

if sercon
Expand Down Expand Up @@ -122,11 +122,11 @@ if tests all
then
echo
echo "All Unit Tests PASSED"
rgbled rgb 20 255 20
led_control on -c green
else
echo
echo "Some Unit Tests FAILED"
rgbled rgb 255 20 20
led_control on -c red
fi

free
2 changes: 1 addition & 1 deletion Tools/jMAVSim
13 changes: 8 additions & 5 deletions Tools/sdlog2/sdlog2_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

"""Dump binary log generated by PX4's sdlog2 or APM as CSV
Usage: python sdlog2_dump.py <log.bin> [-v] [-e] [-d delimiter] [-n null] [-m MSG[.field1,field2,...]]
Usage: python sdlog2_dump.py <log.bin> [-v] [-e] [-d delimiter] [-n null] [-m MSG[_field1,field2,...]]
Example Usage: python sdlog2_dump.py log.bin -m GPS_Lat,Lng -m AHR2_Roll,Pitch,Yaw
-v Use plain debug output instead of CSV.
Expand All @@ -14,9 +16,10 @@
-n Use "null" as placeholder for empty values in CSV. Default is empty.
-m MSG[.field1,field2,...]
-m MSG[_field1,field2,...]
Dump only messages of specified type, and only specified fields.
Multiple -m options allowed."""
Multiple -m options allowed.
"""

__author__ = "Anton Babushkin"
__version__ = "1.2"
Expand Down Expand Up @@ -273,12 +276,12 @@ def __parseMsg(self, msg_descr):

def _main():
if len(sys.argv) < 2:
print("Usage: python sdlog2_dump.py <log.bin> [-v] [-e] [-d delimiter] [-n null] [-m MSG[.field1,field2,...]] [-t TIME_MSG_NAME]\n")
print("Usage: python sdlog2_dump.py <log.bin> [-v] [-e] [-d delimiter] [-n null] [-m MSG[_field1,field2,...]] [-t TIME_MSG_NAME]\n")
print("\t-v\tUse plain debug output instead of CSV.\n")
print("\t-e\tRecover from errors.\n")
print("\t-d\tUse \"delimiter\" in CSV. Default is \",\".\n")
print("\t-n\tUse \"null\" as placeholder for empty values in CSV. Default is empty.\n")
print("\t-m MSG[.field1,field2,...]\n\t\tDump only messages of specified type, and only specified fields.\n\t\tMultiple -m options allowed.")
print("\t-m MSG[_field1,field2,...]\n\t\tDump only messages of specified type, and only specified fields.\n\t\tMultiple -m options allowed.")
print("\t-t\tSpecify TIME message name to group data messages by time and significantly reduce duplicate output.\n")
print("\t-fPrint to file instead of stdout")
return
Expand Down
2 changes: 1 addition & 1 deletion Tools/sitl_gazebo
2 changes: 2 additions & 0 deletions cmake/configs/nuttx_auav-x21_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ set(config_module_list
systemcmds/config
systemcmds/dumpfile
systemcmds/esc_calib
systemcmds/led_control
systemcmds/mixer
systemcmds/hardfault_log
systemcmds/motor_ramp
Expand Down Expand Up @@ -140,6 +141,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
2 changes: 2 additions & 0 deletions cmake/configs/nuttx_mindpx-v2_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(config_module_list
systemcmds/perf
systemcmds/pwm
systemcmds/esc_calib
systemcmds/led_control
systemcmds/hardfault_log
systemcmds/reboot
systemcmds/topic_listener
Expand Down Expand Up @@ -145,6 +146,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
1 change: 1 addition & 0 deletions cmake/configs/nuttx_px4fmu-v1_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
1 change: 1 addition & 0 deletions cmake/configs/nuttx_px4fmu-v2_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
1 change: 1 addition & 0 deletions cmake/configs/nuttx_px4fmu-v2_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
21 changes: 15 additions & 6 deletions cmake/configs/nuttx_px4fmu-v3_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(config_module_list
systemcmds/dumpfile
systemcmds/esc_calib
systemcmds/hardfault_log
systemcmds/led_control
systemcmds/mixer
systemcmds/motor_ramp
systemcmds/mtd
Expand Down Expand Up @@ -146,16 +147,19 @@ set(config_module_list
lib/geo
lib/geo_lookup
lib/launchdetection
lib/led
lib/mathlib
lib/mathlib/math/filter
lib/runway_takeoff
lib/tailsitter_recovery
lib/terrain_estimation
lib/version
platforms/nuttx

# had to add for cmake, not sure why wasn't in original config
#
# Platform
#
platforms/common
platforms/nuttx
platforms/nuttx/px4_layer

#
Expand All @@ -168,28 +172,33 @@ set(config_module_list
#
examples/rover_steering_control

#
# Segway
#
examples/segway

#
# Demo apps
#
#examples/math_demo

# Tutorial code from
# https://px4.io/dev/px4_simple_app
examples/px4_simple_app

# Tutorial code from
# https://px4.io/dev/daemon
#examples/px4_daemon_app
examples/px4_daemon_app

# Tutorial code from
# https://px4.io/dev/debug_values
#examples/px4_mavlink_debug
examples/px4_mavlink_debug

# Tutorial code from
# https://px4.io/dev/example_fixedwing_control
examples/fixedwing_control

# Hardware test
#examples/hwtest
examples/hwtest

# EKF
examples/ekf_att_pos_estimator
Expand Down
2 changes: 2 additions & 0 deletions cmake/configs/nuttx_px4fmu-v4_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ set(config_module_list
# System commands
#
systemcmds/bl_update
systemcmds/led_control
systemcmds/mixer
systemcmds/param
systemcmds/perf
Expand Down Expand Up @@ -146,6 +147,7 @@ set(config_module_list
lib/geo_lookup
lib/conversion
lib/launchdetection
lib/led
lib/terrain_estimation
lib/runway_takeoff
lib/tailsitter_recovery
Expand Down
Loading

0 comments on commit 1ba268a

Please sign in to comment.