ardupilot/Makefile
- MAKEFILE_LIST
- WAF_BINARY= …/modules/waf/waf-light
- WAF = python WAF_BINARY WAF_FLAGS
- EXPLICIT_COMMANDS=‘check’ ‘check-all’ ‘clean’ ‘list_boards’
- VEHICLES = ‘copter’ ‘plane’ ‘rover’ ‘sub’ ‘heli’
- BOARD_LIST = WAF list_boards
sim_vehicle.py
- WAF build //对应脚本279行
- Configure waf
- ''ardupilot/modules/waf/waf-light"(287行) ''configure" ‘’–board" “sitl”(289行)
- Setting top to “/ardupilot”
- Setting out to “/ardupilot/build”
- Autoconfiguration “enable”
- Setting board to “sitl”
- /usr/bin/g++
- /usr/bin/gcc
- cxx flags ‘-MMD’
- ‘/usr/bin/python’
- ’configure’ finished successfully.
- Building
- “/ardupilot/modules/waf/waf-light” “build” “–target” “bin/arducopter”(305行)
- Waf: ‘/ardupilot/build/sitl’
- 333行“param_parse_path=ardupilot/Tools/autotest/param_metadata/param_parse.py”
- cmd_param_build=“python …/param_parse.py --vehilce”
- def do_build(vehicledir, opts, frame_options):
- 如果opts=“waf”,则执行 do_build_waf(opts,frame_options )
- ’build’ finished successfully
- sim_vehilce: using defaults from (/ardupilot/Tools/autotest/default_params/copter.parm)
- Run ArduCopter
- “/ardupilot/Tools/autotest/run_in_terminal_window.sh” “ArduCopter” “/ardupilot/build/sitl/bin/arducopter”
- “-S” “-I0” “–home” “-w” “–model” “–speedup” “–defaults” 依次对应540至547行 “/ardupilot/Tools/autotest/default_params/copter.parm” “-S” “-I0” “–home” “-w” “–model” “–speedup” “–defaults” “/ardupilot/Tools/autotest/default_params/copter.parm”
def start_mavproxy(opts,stuff)
如果在Windows下,/usr/bin/cygstart -w mavproxy.exe,否则mavproxy.py。
如果选择HTL,则“–load-module” “HIL”;
否则(“–master”,mavlink_port),
如果stuff[“sitl-port”],则("–sitl", simout_port)