Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b940f68b4c | |||
| 0389c5d17f |
@@ -42,8 +42,6 @@ pipeline {
|
||||
"ark_can-gps_default",
|
||||
"ark_can-rtk-gps_canbootloader",
|
||||
"ark_can-rtk-gps_default",
|
||||
"ark_fmu-v6x_bootloader",
|
||||
"ark_fmu-v6x_default",
|
||||
"atl_mantis-edu_default",
|
||||
"av_x-v1_default",
|
||||
"bitcraze_crazyflie_default",
|
||||
@@ -69,18 +67,23 @@ pipeline {
|
||||
"matek_h743-slim_default",
|
||||
"matek_h743_default",
|
||||
"modalai_fc-v1_default",
|
||||
"modalai_fc-v1_rtps",
|
||||
"modalai_fc-v2_default",
|
||||
"modalai_voxl2-io_default",
|
||||
"mro_ctrl-zero-f7_default",
|
||||
"mro_ctrl-zero-f7-oem_default",
|
||||
"mro_ctrl-zero-h7-oem_default",
|
||||
"mro_ctrl-zero-h7-oem_rtps",
|
||||
"mro_ctrl-zero-h7_default",
|
||||
"mro_ctrl-zero-h7_rtps",
|
||||
"mro_pixracerpro_default",
|
||||
"mro_pixracerpro_rtps",
|
||||
"mro_x21-777_default",
|
||||
"mro_x21_default",
|
||||
"nxp_fmuk66-e_default",
|
||||
"nxp_fmuk66-e_rtps",
|
||||
"nxp_fmuk66-e_socketcan",
|
||||
"nxp_fmuk66-v3_default",
|
||||
"nxp_fmuk66-v3_rtps",
|
||||
"nxp_fmuk66-v3_socketcan",
|
||||
"nxp_fmurt1062-v1_default",
|
||||
"nxp_ucans32k146_canbootloader",
|
||||
@@ -98,6 +101,7 @@ pipeline {
|
||||
"px4_fmu-v5_debug",
|
||||
"px4_fmu-v5_default",
|
||||
"px4_fmu-v5_lto",
|
||||
"px4_fmu-v5_rtps",
|
||||
"px4_fmu-v5_stackcheck",
|
||||
"px4_fmu-v5_uavcanv0periph",
|
||||
"px4_fmu-v5x_default",
|
||||
|
||||
@@ -61,13 +61,9 @@ pipeline {
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_RATEMAX" --value "2000"'
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "13000"' // generic vtol standard
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -136,12 +132,8 @@ pipeline {
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_RATEMAX" --value "2000"'
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "13000"' // generic vtol standard
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -160,6 +152,76 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage("px4_fmu-v3_test") {
|
||||
stages {
|
||||
stage("build px4_fmu-v3_test") {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-nuttx-focal:2021-09-08'
|
||||
args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
checkoutSCM()
|
||||
sh 'make px4_fmu-v3_test'
|
||||
sh 'make px4_fmu-v3_test bootloader_elf'
|
||||
sh 'ccache -s'
|
||||
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit, Tools/HIL/*', name: 'px4_fmu-v3_test'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'make distclean; git clean -ff -x -d .'
|
||||
}
|
||||
}
|
||||
} // stage build
|
||||
stage("hardware") {
|
||||
agent {
|
||||
label 'px4_fmu-v3'
|
||||
}
|
||||
stages {
|
||||
stage("flash") {
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'find /dev/serial'
|
||||
unstash 'px4_fmu-v3_test'
|
||||
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v3_test/px4_fmu-v3_bootloader.elf'
|
||||
// flash board and watch bootup
|
||||
sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
|
||||
resetBoard()
|
||||
}
|
||||
}
|
||||
stage("tests") {
|
||||
steps {
|
||||
runTests()
|
||||
}
|
||||
}
|
||||
stage("status") {
|
||||
steps {
|
||||
// configure
|
||||
resetParameters()
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "13000"' // generic vtol standard
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status"'
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
steps {
|
||||
printTopics()
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'cat /tmp/pyserial_spy_file.txt || true'
|
||||
sh './platforms/nuttx/Debug/jlink_gdb_backtrace_simple.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf || true'
|
||||
}
|
||||
}
|
||||
} // stage test
|
||||
}
|
||||
}
|
||||
|
||||
stage("px4_fmu-v4_test") {
|
||||
stages {
|
||||
stage("build px4_fmu-v4_test") {
|
||||
@@ -209,12 +271,8 @@ pipeline {
|
||||
resetParameters()
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -282,13 +340,9 @@ pipeline {
|
||||
resetParameters()
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "13000"' // generic vtol standard
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -377,7 +431,6 @@ pipeline {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set IMU_GYRO_RATEMAX 200" || true' // limit cpu usage
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_0_CONFIG 0" || true' // limit cpu usage
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_1_CONFIG 0" || true' // limit cpu usage
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
checkStatus()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status" || true'
|
||||
}
|
||||
@@ -460,7 +513,6 @@ pipeline {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set IMU_GYRO_RATEMAX 200" || true' // limit cpu usage
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_0_CONFIG 0" || true' // limit cpu usage
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param set MAV_1_CONFIG 0" || true' // limit cpu usage
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
checkStatus()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status" || true'
|
||||
}
|
||||
@@ -530,13 +582,9 @@ pipeline {
|
||||
resetParameters()
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "px4io status" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -605,12 +653,8 @@ pipeline {
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "IMU_GYRO_RATEMAX" --value "400"'
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
|
||||
sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"' // run logger
|
||||
checkStatus()
|
||||
quickCalibrate()
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"' // stop logger
|
||||
}
|
||||
}
|
||||
stage("print topics") {
|
||||
@@ -684,8 +728,14 @@ void checkStatus() {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param save"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param status"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show SYS*"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
|
||||
sh './Tools/HIL/reboot.py --device `find /dev/serial -name *usb-*`' // reboot to apply
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show SYS*"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
|
||||
|
||||
// run logger
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger on"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sleep 1"' // sleep before continuing
|
||||
// status commands
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "cat /proc/fs/blocks"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "cat /proc/fs/mount"'
|
||||
@@ -715,7 +765,7 @@ void checkStatus() {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mavlink status" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mount"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd status"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param show" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param status"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "perf latency"'
|
||||
@@ -729,6 +779,8 @@ void checkStatus() {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb top -1 -a" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "ver all"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "work_queue status"'
|
||||
// stop logger
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "logger off"'
|
||||
}
|
||||
|
||||
void resetParameters() {
|
||||
@@ -767,13 +819,13 @@ void runTests() {
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd readtest"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd rwtest"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "mtd erase"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "bsondump /fs/mtd_params"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "param dump /fs/mtd_params"'
|
||||
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench"'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_bench -v"'
|
||||
@@ -868,6 +920,7 @@ void printTopics() {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener tune_control" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_acceleration" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_air_data" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_angular_acceleration" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_angular_velocity" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_attitude" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_attitude_setpoint" || true'
|
||||
@@ -884,7 +937,7 @@ void printTopics() {
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_odometry" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_rates_setpoint" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_status" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener failsafe_flags" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_status_flags" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vtol_vehicle_status" || true'
|
||||
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener yaw_estimator_status" || true'
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ labels: feature-request
|
||||
|
||||
---
|
||||
|
||||
For general questions please use [PX4 Discuss](http://discuss.px4.io/) or Discord (you can find an invite link on this project README).
|
||||
For general questions please use [PX4 Discuss](http://discuss.px4.io/) or Slack (you can find an invite link on this project README).
|
||||
|
||||
## Describe problem solved by the proposed feature
|
||||
A clear and concise description of the problem, if any, this feature will solve. E.g. I'm always frustrated when ...
|
||||
|
||||
@@ -1,29 +1,17 @@
|
||||
<!--
|
||||
Please use [PX4 Discuss](http://discuss.px4.io/) or [Slack](http://slack.px4.io/) to align on pull requests if necessary. You can then open draft pull requests to get early feedback.
|
||||
|
||||
Thank you for your contribution!
|
||||
## Describe problem solved by this pull request
|
||||
A clear and concise description of the problem this proposed change will solve. Or, what it will improve.
|
||||
E.g. For this use case I ran into...
|
||||
|
||||
Get early feedback through
|
||||
- Dronecode Discord: https://discord.gg/dronecode
|
||||
- PX4 Discuss: http://discuss.px4.io/
|
||||
- opening a draft pr and sharing the link
|
||||
## Describe your solution
|
||||
A clear and concise description of what you have implemented.
|
||||
|
||||
-->
|
||||
## Describe possible alternatives
|
||||
A clear and concise description of alternative solutions or features you've considered.
|
||||
|
||||
### Solved Problem
|
||||
When ... I found that ...
|
||||
## Test data / coverage
|
||||
How was it tested? What cases were covered? Logs uploaded to https://review.px4.io/ and screenshots of the important plot parts.
|
||||
|
||||
Fixes #{Github issue ID}
|
||||
|
||||
### Solution
|
||||
- Add ... for ...
|
||||
- Refactor ...
|
||||
|
||||
### Alternatives
|
||||
We could also ...
|
||||
|
||||
### Test coverage
|
||||
- Unit/integration test: ...
|
||||
- Simulation/hardware testing logs: https://review.px4.io/
|
||||
|
||||
### Context
|
||||
Related links, screenshot before/after, video
|
||||
## Additional context
|
||||
Add any other related context or media.
|
||||
|
||||
@@ -23,6 +23,7 @@ jobs:
|
||||
"shellcheck_all",
|
||||
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
|
||||
"NO_NINJA_BUILD=1 px4_sitl_default",
|
||||
"BUILD_MICRORTPS_AGENT=1 px4_sitl_rtps",
|
||||
"airframe_metadata",
|
||||
"module_documentation",
|
||||
"parameters_metadata",
|
||||
|
||||
@@ -21,7 +21,6 @@ jobs:
|
||||
ark_can-gps,
|
||||
ark_can-rtk-gps,
|
||||
ark_cannode,
|
||||
ark_fmu-v6x,
|
||||
atl_mantis-edu,
|
||||
av_x-v1,
|
||||
bitcraze_crazyflie,
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
name: Failsafe Simulator Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
check: [
|
||||
"failsafe_web",
|
||||
]
|
||||
container:
|
||||
image: px4io/px4-dev-nuttx-focal:2021-09-08
|
||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: check environment
|
||||
run: |
|
||||
export
|
||||
ulimit -a
|
||||
- name: install emscripten
|
||||
run: |
|
||||
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk
|
||||
cd _emscripten_sdk
|
||||
./emsdk install latest
|
||||
./emsdk activate latest
|
||||
- name: ${{matrix.check}}
|
||||
run: |
|
||||
. ./_emscripten_sdk/emsdk_env.sh
|
||||
make ${{matrix.check}}
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
ls -ls *
|
||||
# TODO: deploy graph_px4_sitl.json to S3 px4-travis:Firmware/master/
|
||||
|
||||
ROS2_msgs:
|
||||
micrortps_agent:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
@@ -124,8 +124,34 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: PX4 ROS2 msgs
|
||||
- name: microRTPS agent
|
||||
run: |
|
||||
make px4_sitl_rtps
|
||||
git clone https://github.com/PX4/micrortps_agent.git
|
||||
cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent
|
||||
|
||||
ROS_msgs:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: PX4 ROS msgs
|
||||
run: |
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
rm px4_msgs/msg/*.msg
|
||||
cp msg/*.msg px4_msgs/msg/
|
||||
python3 msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/
|
||||
|
||||
ROS2_bridge:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: PX4 ROS2 bridge
|
||||
run: |
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
./msg/tools/uorb_to_ros_urtps_topics.py -i msg/tools/urtps_bridge_topics.yaml -o px4_ros_com/templates/urtps_bridge_topics.yaml
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
matrix:
|
||||
config:
|
||||
- {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska
|
||||
# - {model: "standard_vtol", latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer" } # Australia
|
||||
- {model: "standard_vtol", latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer" } # Australia
|
||||
- {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida
|
||||
- {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich
|
||||
|
||||
|
||||
@@ -47,8 +47,6 @@ GTAGS
|
||||
*.files
|
||||
*.includes
|
||||
|
||||
Tools/jlink-nuttx.so
|
||||
|
||||
# CLion ignores
|
||||
.idea
|
||||
cmake-build-*/
|
||||
|
||||
@@ -9,23 +9,27 @@
|
||||
[submodule "Tools/simulation/jmavsim/jMAVSim"]
|
||||
path = Tools/simulation/jmavsim/jMAVSim
|
||||
url = https://github.com/PX4/jMAVSim.git
|
||||
branch = main
|
||||
branch = master
|
||||
[submodule "Tools/simulation/gazebo/sitl_gazebo"]
|
||||
path = Tools/simulation/gazebo/sitl_gazebo
|
||||
url = https://github.com/PX4/PX4-SITL_gazebo.git
|
||||
branch = main
|
||||
branch = master
|
||||
[submodule "src/drivers/gps/devices"]
|
||||
path = src/drivers/gps/devices
|
||||
url = https://github.com/PX4/PX4-GPSDrivers.git
|
||||
branch = main
|
||||
branch = master
|
||||
[submodule "src/modules/micrortps_bridge/micro-CDR"]
|
||||
path = src/modules/micrortps_bridge/micro-CDR
|
||||
url = https://github.com/PX4/Micro-CDR.git
|
||||
branch = master
|
||||
[submodule "platforms/nuttx/NuttX/nuttx"]
|
||||
path = platforms/nuttx/NuttX/nuttx
|
||||
url = https://github.com/PX4/NuttX.git
|
||||
branch = px4_firmware_nuttx-10.3.0+
|
||||
branch = px4_firmware_nuttx-10.1.0+
|
||||
[submodule "platforms/nuttx/NuttX/apps"]
|
||||
path = platforms/nuttx/NuttX/apps
|
||||
url = https://github.com/PX4/NuttX-apps.git
|
||||
branch = px4_firmware_nuttx-10.3.0+
|
||||
branch = px4_firmware_nuttx-10.1.0+
|
||||
[submodule "Tools/flightgear_bridge"]
|
||||
path = Tools/simulation/flightgear/flightgear_bridge
|
||||
url = https://github.com/PX4/PX4-FlightGear-Bridge.git
|
||||
@@ -49,7 +53,6 @@
|
||||
[submodule "src/lib/events/libevents"]
|
||||
path = src/lib/events/libevents
|
||||
url = https://github.com/mavlink/libevents.git
|
||||
branch = main
|
||||
[submodule "src/lib/crypto/libtomcrypt"]
|
||||
path = src/lib/crypto/libtomcrypt
|
||||
url = https://github.com/PX4/libtomcrypt.git
|
||||
@@ -60,5 +63,4 @@
|
||||
branch = px4
|
||||
[submodule "src/modules/microdds_client/Micro-XRCE-DDS-Client"]
|
||||
path = src/modules/microdds_client/Micro-XRCE-DDS-Client
|
||||
url = https://github.com/PX4/Micro-XRCE-DDS-Client.git
|
||||
branch = px4
|
||||
url = https://github.com/eProsima/Micro-XRCE-DDS-Client.git
|
||||
|
||||
@@ -6,11 +6,11 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_default
|
||||
px4_sitl_nolockstep:
|
||||
short: px4_sitl_nolockstep
|
||||
px4_sitl_rtps:
|
||||
short: px4_sitl_rtps
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_nolockstep
|
||||
CONFIG: px4_sitl_rtps
|
||||
px4_sitl_asan:
|
||||
short: px4_sitl (AddressSanitizer)
|
||||
buildType: AddressSanitizer
|
||||
@@ -131,16 +131,6 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_cannode_canbootloader
|
||||
ark_fmu-v6x_bootloader:
|
||||
short: ark_fmu-v6x_bootloader
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_fmu-v6x_bootloader
|
||||
ark_fmu-v6x_default:
|
||||
short: ark_fmu-v6x_default
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_fmu-v6x_default
|
||||
atl_mantis-edu_default:
|
||||
short: atl_mantis-edu
|
||||
buildType: MinSizeRel
|
||||
@@ -236,11 +226,6 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: modalai_fc-v2_default
|
||||
modalai_voxl2-io_default:
|
||||
short: modalai_voxl2-io
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: modalai_voxl2-io_default
|
||||
mro_ctrl-zero-f7_default:
|
||||
short: mro_ctrl-zero-f7
|
||||
buildType: MinSizeRel
|
||||
|
||||
@@ -133,5 +133,6 @@
|
||||
"workbench.settings.enableNaturalLanguageSearch": false,
|
||||
"yaml.schemas": {
|
||||
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
|
||||
}
|
||||
},
|
||||
"cortex-debug.openocdPath": "${env:PICO_SDK_PATH}/../openocd/src/openocd" // Added for rp2040
|
||||
}
|
||||
|
||||
@@ -218,10 +218,10 @@
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"IGN_GAZEBO_RESOURCE_PATH": "${workspaceFolder}/Tools/simulation/gz/models",
|
||||
"IGN_GAZEBO_RESOURCE_PATH": "${workspaceFolder}/Tools/simulation/ignition/models",
|
||||
}
|
||||
},
|
||||
"command": "ign gazebo -v 4 -r ${workspaceFolder}/Tools/simulation/gz/worlds/${input:gzWorld}.sdf",
|
||||
"command": "ign gazebo -v 4 -r ${workspaceFolder}/Tools/simulation/ignition/worlds/${input:ignWorld}.sdf",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
@@ -342,8 +342,8 @@
|
||||
"inputs": [
|
||||
{
|
||||
"type": "pickString",
|
||||
"id": "gzWorld",
|
||||
"description": "gz world",
|
||||
"id": "ignWorld",
|
||||
"description": "Ignition world",
|
||||
"options": [
|
||||
"default"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2017 - 2022 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2017 - 2019 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -143,17 +143,25 @@ define_property(GLOBAL PROPERTY PX4_SRC_FILES
|
||||
# configuration
|
||||
#
|
||||
|
||||
set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration")
|
||||
|
||||
include(px4_add_module)
|
||||
set(config_module_list)
|
||||
set(config_kernel_list)
|
||||
|
||||
# Find Python
|
||||
find_package(PythonInterp 3)
|
||||
# We have a custom error message to tell users how to install python3.
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
|
||||
" macOS: brew install python")
|
||||
# If using catkin, Python 2 is found since it points
|
||||
# to the Python libs installed with the ROS distro
|
||||
if (NOT CATKIN_DEVEL_PREFIX)
|
||||
find_package(PythonInterp 3)
|
||||
# We have a custom error message to tell users how to install python3.
|
||||
if (NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
|
||||
" macOS: brew install python")
|
||||
endif()
|
||||
else()
|
||||
find_package(PythonInterp REQUIRED)
|
||||
endif()
|
||||
|
||||
option(PYTHON_COVERAGE "Python code coverage" OFF)
|
||||
@@ -199,11 +207,6 @@ if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/init.cmake")
|
||||
include(init)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# project definition
|
||||
#
|
||||
project(px4 CXX C ASM)
|
||||
|
||||
# CMake build type (Debug Release RelWithDebInfo MinSizeRel Coverage)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
if(${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
@@ -232,6 +235,11 @@ endif()
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel;Coverage;AddressSanitizer;UndefinedBehaviorSanitizer")
|
||||
message(STATUS "cmake build type: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
#=============================================================================
|
||||
# project definition
|
||||
#
|
||||
project(px4 CXX C ASM)
|
||||
|
||||
# Check if LTO option and check if toolchain supports it
|
||||
if(LTO)
|
||||
include(CheckIPOSupported)
|
||||
@@ -248,9 +256,15 @@ set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
|
||||
# For the catkin build process, unset build of dynamically-linked binaries
|
||||
# and do not change CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
if (NOT CATKIN_DEVEL_PREFIX)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
|
||||
else()
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -295,6 +309,21 @@ endif()
|
||||
|
||||
include(ccache)
|
||||
|
||||
#=============================================================================
|
||||
# find programs and packages
|
||||
#
|
||||
|
||||
# see if catkin was invoked to build this
|
||||
if (CATKIN_DEVEL_PREFIX)
|
||||
message(STATUS "catkin ENABLED")
|
||||
find_package(catkin REQUIRED)
|
||||
if (catkin_FOUND)
|
||||
catkin_package()
|
||||
else()
|
||||
message(FATAL_ERROR "catkin not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# get chip and chip manufacturer
|
||||
#
|
||||
@@ -421,10 +450,10 @@ add_subdirectory(src/lib/metadata EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(src/lib/parameters EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${PX4_PLATFORM} STREQUAL "nuttx" AND NOT CONFIG_BUILD_FLAT)
|
||||
target_link_libraries(parameters_interface INTERFACE usr_parameters)
|
||||
target_link_libraries(kernel_parameters_interface INTERFACE parameters)
|
||||
target_link_libraries(parameters_interface INTERFACE usr_parameters)
|
||||
target_link_libraries(kernel_parameters_interface INTERFACE parameters)
|
||||
else()
|
||||
target_link_libraries(parameters_interface INTERFACE parameters)
|
||||
target_link_libraries(parameters_interface INTERFACE parameters)
|
||||
endif()
|
||||
|
||||
# firmware added last to generate the builtin for included modules
|
||||
@@ -457,13 +486,17 @@ include(doxygen)
|
||||
include(metadata)
|
||||
include(package)
|
||||
|
||||
# print size
|
||||
add_custom_target(size
|
||||
COMMAND size $<TARGET_FILE:px4>
|
||||
DEPENDS px4
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
# install python requirements using configured python
|
||||
add_custom_target(install_python_requirements
|
||||
COMMAND ${PYTHON_EXECUTABLE} -m pip install --requirement ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt
|
||||
DEPENDS ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/finalize.cmake")
|
||||
include(finalize)
|
||||
endif()
|
||||
|
||||
@@ -829,6 +829,7 @@ RECURSIVE = YES
|
||||
# run.
|
||||
|
||||
EXCLUDE = @CMAKE_SOURCE_DIR@/src/modules/uavcan/libuavcan \
|
||||
@CMAKE_SOURCE_DIR@/src/modules/micrortps_bridge/micro-CDR \
|
||||
@CMAKE_SOURCE_DIR@/src/examples \
|
||||
@CMAKE_SOURCE_DIR@/src/templates
|
||||
|
||||
|
||||
@@ -13,6 +13,76 @@ pipeline {
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
// stage('Catkin build on ROS workspace') {
|
||||
// agent {
|
||||
// docker {
|
||||
// image 'px4io/px4-dev-ros-melodic:2021-08-18'
|
||||
// args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
// }
|
||||
// }
|
||||
// steps {
|
||||
// sh 'ls -l'
|
||||
// sh '''#!/bin/bash -l
|
||||
// echo $0;
|
||||
// mkdir -p catkin_ws/src;
|
||||
// cd catkin_ws;
|
||||
// git -C ${WORKSPACE}/catkin_ws/src/Firmware submodule update --init --recursive --force Tools/simulation/gazebo/sitl_gazebo
|
||||
// git clone --recursive ${WORKSPACE}/catkin_ws/src/Firmware/Tools/simulation/gazebo/sitl_gazebo src/mavlink_sitl_gazebo;
|
||||
// git -C ${WORKSPACE}/catkin_ws/src/Firmware fetch --tags;
|
||||
// source /opt/ros/melodic/setup.bash;
|
||||
// export PYTHONPATH=/opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages;
|
||||
// catkin init;
|
||||
// catkin build -j$(nproc) -l$(nproc);
|
||||
// '''
|
||||
// // test if the binary was correctly installed and runs using 'mavros_posix_sitl.launch'
|
||||
// sh '''#!/bin/bash -l
|
||||
// echo $0;
|
||||
// source catkin_ws/devel/setup.bash;
|
||||
// rostest px4 pub_test.launch;
|
||||
// '''
|
||||
// }
|
||||
// post {
|
||||
// always {
|
||||
// sh 'rm -rf catkin_ws'
|
||||
// }
|
||||
// failure {
|
||||
// archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.xml, .ros/**/*.log')
|
||||
// }
|
||||
// }
|
||||
// options {
|
||||
// checkoutToSubdirectory('catkin_ws/src/Firmware')
|
||||
// }
|
||||
// }
|
||||
|
||||
stage('Colcon build on ROS2 workspace') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros2-foxy:2021-08-18'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'ls -l'
|
||||
sh '''#!/bin/bash -l
|
||||
echo $0;
|
||||
unset ROS_DISTRO;
|
||||
mkdir -p colcon_ws/src;
|
||||
cd colcon_ws;
|
||||
git -C ${WORKSPACE}/colcon_ws/src/Firmware submodule update --init --recursive --force Tools/simulation/gazebo/sitl_gazebo;
|
||||
git -C ${WORKSPACE}/colcon_ws/src/Firmware fetch --tags;
|
||||
source /opt/ros/foxy/setup.sh;
|
||||
colcon build --event-handlers console_direct+ --symlink-install;
|
||||
'''
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'rm -rf colcon_ws'
|
||||
}
|
||||
}
|
||||
options {
|
||||
checkoutToSubdirectory('colcon_ws/src/Firmware')
|
||||
}
|
||||
}
|
||||
|
||||
stage('Airframe') {
|
||||
agent {
|
||||
@@ -79,7 +149,7 @@ pipeline {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh 'mkdir -p build/msg_docs; ./Tools/msg/generate_msg_docs.py -d build/msg_docs'
|
||||
sh 'mkdir -p build/msg_docs; ./msg/tools/generate_msg_docs.py -d build/msg_docs'
|
||||
dir('build') {
|
||||
archiveArtifacts(artifacts: 'msg_docs/*.md')
|
||||
stash includes: 'msg_docs/*.md', name: 'msg_documentation'
|
||||
@@ -92,36 +162,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('failsafe docs') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-nuttx-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh '''#!/bin/bash -l
|
||||
echo $0;
|
||||
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk;
|
||||
cd _emscripten_sdk;
|
||||
./emsdk install latest;
|
||||
./emsdk activate latest;
|
||||
cd ..;
|
||||
. ./_emscripten_sdk/emsdk_env.sh;
|
||||
make failsafe_web;
|
||||
cd build/px4_sitl_default_failsafe_web;
|
||||
mkdir -p failsafe_sim;
|
||||
cp index.* parameters.json failsafe_sim;
|
||||
'''
|
||||
dir('build/px4_sitl_default_failsafe_web') {
|
||||
archiveArtifacts(artifacts: 'failsafe_sim/*')
|
||||
stash includes: 'failsafe_sim/*', name: 'failsafe_sim'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'make distclean; git clean -ff -x -d .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('uORB graphs') {
|
||||
agent {
|
||||
docker {
|
||||
@@ -163,7 +203,6 @@ pipeline {
|
||||
unstash 'metadata_parameters'
|
||||
unstash 'metadata_module_documentation'
|
||||
unstash 'msg_documentation'
|
||||
unstash 'failsafe_sim'
|
||||
unstash 'uorb_graph'
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh('git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/PX4-user_guide.git')
|
||||
@@ -172,7 +211,6 @@ pipeline {
|
||||
sh('cp -R modules/*.md PX4-user_guide/en/modules/')
|
||||
sh('cp -R graph_*.json PX4-user_guide/.vuepress/public/en/middleware/')
|
||||
sh('cp -R msg_docs/*.md PX4-user_guide/en/msg_docs/')
|
||||
sh('cp -R failsafe_sim/* PX4-user_guide/.vuepress/public/en/config/failsafe')
|
||||
sh('cd PX4-user_guide; git status; git add .; git commit -a -m "Update PX4 Firmware metadata `date`" || true')
|
||||
sh('cd PX4-user_guide; git push origin main || true')
|
||||
sh('rm -rf PX4-user_guide')
|
||||
@@ -219,6 +257,37 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('microRTPS agent') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('git fetch --all --tags')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
sh('make px4_sitl_rtps')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/micrortps_agent.git -b ${BRANCH_NAME}")
|
||||
sh("rm -rf micrortps_agent/src micrortps_agent/idl")
|
||||
sh('cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent')
|
||||
sh('cd micrortps_agent; git status; git add src; git commit -a -m "Update microRTPS agent source code `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('cd micrortps_agent; git status; git add idl; git commit -a -m "Update IDL definitions `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('cd micrortps_agent; git status; git add CMakeLists.txt; git commit -a -m "Update CMakeLists.txt `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('rm -rf micrortps_agent')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'main'
|
||||
branch 'master' // should be removed, but in case there is something going on...
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('PX4 ROS msgs') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
@@ -229,16 +298,66 @@ pipeline {
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_msgs.git")
|
||||
// 'main' branch
|
||||
sh('rm -f px4_msgs/msg/*.msg')
|
||||
sh('cp msg/*.msg px4_msgs/msg/')
|
||||
sh('./msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/')
|
||||
sh('cd px4_msgs; git status; git add .; git commit -a -m "Update message definitions `date`" || true')
|
||||
sh('cd px4_msgs; git push origin main || true')
|
||||
// 'ros1' branch
|
||||
sh('cd px4_msgs; git checkout ros1')
|
||||
sh('./msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/')
|
||||
sh('cd px4_msgs; git status; git add .; git commit -a -m "Update message definitions `date`" || true')
|
||||
sh('cd px4_msgs; git push origin ros1 || true')
|
||||
sh('rm -rf px4_msgs')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'main'
|
||||
branch 'master' // should be removed, but in case there is something going on...
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('PX4 ROS2 bridge') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_ros_com.git -b ${BRANCH_NAME}")
|
||||
// deploy uORB RTPS ID map
|
||||
sh('./msg/tools/uorb_to_ros_urtps_topics.py -i msg/tools/urtps_bridge_topics.yaml -o px4_ros_com/templates/urtps_bridge_topics.yaml')
|
||||
sh('cd px4_ros_com; git status; git add .; git commit -a -m "Update uORB RTPS ID map `date`" || true')
|
||||
sh('cd px4_ros_com; git push origin ${BRANCH_NAME} || true')
|
||||
// deploy uORB RTPS required tools
|
||||
sh('cp msg/tools/uorb_rtps_classifier.py px4_ros_com/scripts/uorb_rtps_classifier.py')
|
||||
sh('cp msg/tools/generate_microRTPS_bridge.py px4_ros_com/scripts/generate_microRTPS_bridge.py')
|
||||
sh('cp msg/tools/px_generate_uorb_topic_files.py px4_ros_com/scripts/px_generate_uorb_topic_files.py')
|
||||
sh('cp msg/tools/px_generate_uorb_topic_helper.py px4_ros_com/scripts/px_generate_uorb_topic_helper.py')
|
||||
// deploy templates
|
||||
sh('cp msg/templates/urtps/microRTPS_agent.cpp.em px4_ros_com/templates/microRTPS_agent.cpp.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_timesync.cpp.em px4_ros_com/templates/microRTPS_timesync.cpp.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_timesync.h.em px4_ros_com/templates/microRTPS_timesync.h.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_transport.cpp px4_ros_com/templates/microRTPS_transport.cpp')
|
||||
sh('cp msg/templates/urtps/microRTPS_transport.h px4_ros_com/templates/microRTPS_transport.h')
|
||||
sh('cp msg/templates/urtps/Publisher.cpp.em px4_ros_com/templates/Publisher.cpp.em')
|
||||
sh('cp msg/templates/urtps/Publisher.h.em px4_ros_com/templates/Publisher.h.em')
|
||||
sh('cp msg/templates/urtps/Subscriber.cpp.em px4_ros_com/templates/Subscriber.cpp.em')
|
||||
sh('cp msg/templates/urtps/Subscriber.h.em px4_ros_com/templates/Subscriber.h.em')
|
||||
sh('cp msg/templates/urtps/RtpsTopics.cpp.em px4_ros_com/templates/RtpsTopics.cpp.em')
|
||||
sh('cp msg/templates/urtps/RtpsTopics.h.em px4_ros_com/templates/RtpsTopics.h.em')
|
||||
sh('cd px4_ros_com; git status; git add .; git commit -a -m "Update uORB RTPS script tools `date`" || true')
|
||||
sh('cd px4_ros_com; git push origin ${BRANCH_NAME} || true')
|
||||
sh('rm -rf px4_msgs')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'main'
|
||||
branch 'master' // should be removed, but in case there is something going on...
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ menu "Toolchain"
|
||||
bool "posix"
|
||||
config PLATFORM_QURT
|
||||
bool "qurt"
|
||||
config PLATFORM_ROS2
|
||||
bool "ros2"
|
||||
endchoice
|
||||
|
||||
config BOARD_PLATFORM
|
||||
@@ -26,7 +24,6 @@ menu "Toolchain"
|
||||
default "nuttx" if PLATFORM_NUTTX
|
||||
default "posix" if PLATFORM_POSIX
|
||||
default "qurt" if PLATFORM_QURT
|
||||
default "ros2" if PLATFORM_ROS2
|
||||
|
||||
config BOARD_LOCKSTEP
|
||||
bool "Force enable lockstep"
|
||||
@@ -40,8 +37,8 @@ menu "Toolchain"
|
||||
help
|
||||
forces nolockstep behaviour, despite REPLAY env variable
|
||||
|
||||
config BOARD_LINUX_TARGET
|
||||
bool "Linux OS Target"
|
||||
config BOARD_LINUX
|
||||
bool "Linux OS"
|
||||
depends on PLATFORM_POSIX
|
||||
help
|
||||
Board Platform is running the Linux operating system
|
||||
@@ -193,7 +190,3 @@ endmenu
|
||||
menu "examples"
|
||||
source "src/examples/Kconfig"
|
||||
endmenu
|
||||
|
||||
menu "platforms"
|
||||
source "platforms/common/Kconfig"
|
||||
endmenu
|
||||
|
||||
@@ -172,6 +172,11 @@ ifdef PYTHON_EXECUTABLE
|
||||
override CMAKE_ARGS += -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||
endif
|
||||
|
||||
# Check if the microRTPS agent is to be built
|
||||
ifdef BUILD_MICRORTPS_AGENT
|
||||
override CMAKE_ARGS += -DBUILD_MICRORTPS_AGENT=ON
|
||||
endif
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
@@ -248,7 +253,7 @@ endef
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware
|
||||
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware check_rtps
|
||||
|
||||
# QGroundControl flashable NuttX firmware
|
||||
qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware
|
||||
@@ -273,7 +278,15 @@ misc_qgc_extra_firmware: \
|
||||
check_airmind_mindpx-v2_default \
|
||||
sizes
|
||||
|
||||
.PHONY: sizes check quick_check uorb_graphs
|
||||
# builds with RTPS
|
||||
check_rtps: \
|
||||
check_px4_fmu-v3_rtps \
|
||||
check_px4_fmu-v4_rtps \
|
||||
check_px4_fmu-v4pro_rtps \
|
||||
check_px4_sitl_rtps \
|
||||
sizes
|
||||
|
||||
.PHONY: sizes check quick_check check_rtps uorb_graphs
|
||||
|
||||
sizes:
|
||||
@-find build -name *.elf -type f | xargs size 2> /dev/null || :
|
||||
@@ -307,7 +320,6 @@ px4io_update:
|
||||
@$(MAKE) --no-print-directory px4_io-v2_default
|
||||
@$(MAKE) --no-print-directory cubepilot_io-v2_default
|
||||
# px4_io-v2_default
|
||||
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/ark/fmu-v6x/extras/px4_io-v2_default.bin
|
||||
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/holybro/durandal-v1/extras/px4_io-v2_default.bin
|
||||
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/holybro/pix32v5/extras/px4_io-v2_default.bin
|
||||
cp build/px4_io-v2_default/px4_io-v2_default.bin boards/mro/x21/extras/px4_io-v2_default.bin
|
||||
@@ -324,11 +336,7 @@ px4io_update:
|
||||
cp build/cubepilot_io-v2_default/cubepilot_io-v2_default.bin boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin
|
||||
git status
|
||||
|
||||
jlink-nuttx:
|
||||
$(CC) -shared -fPIC platforms/nuttx/NuttX/nuttx/tools/jlink-nuttx.c -o Tools/jlink-nuttx.so
|
||||
|
||||
|
||||
bootloaders_update: ark_fmu-v6x_bootloader cuav_nora_bootloader cuav_x7pro_bootloader cubepilot_cubeorange_bootloader holybro_durandal-v1_bootloader holybro_kakuteh7_bootloader matek_h743_bootloader matek_h743-mini_bootloader matek_h743-slim_bootloader modalai_fc-v2_bootloader mro_ctrl-zero-classic_bootloader mro_ctrl-zero-h7_bootloader mro_ctrl-zero-h7-oem_bootloader mro_pixracerpro_bootloader px4_fmu-v6c_bootloader px4_fmu-v6u_bootloader px4_fmu-v6x_bootloader
|
||||
bootloaders_update: cuav_nora_bootloader cuav_x7pro_bootloader cubepilot_cubeorange_bootloader holybro_durandal-v1_bootloader holybro_kakuteh7_bootloader matek_h743_bootloader matek_h743-mini_bootloader matek_h743-slim_bootloader modalai_fc-v2_bootloader mro_ctrl-zero-classic_bootloader mro_ctrl-zero-h7_bootloader mro_ctrl-zero-h7-oem_bootloader mro_pixracerpro_bootloader px4_fmu-v6c_bootloader px4_fmu-v6u_bootloader px4_fmu-v6x_bootloader
|
||||
git status
|
||||
|
||||
.PHONY: coverity_scan
|
||||
@@ -486,9 +494,7 @@ shellcheck_all:
|
||||
|
||||
validate_module_configs:
|
||||
@find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f \
|
||||
-not -path "$(SRC_DIR)/src/lib/mixer_module/*" \
|
||||
-not -path "$(SRC_DIR)/src/modules/microdds_client/dds_topics.yaml" \
|
||||
-not -path "$(SRC_DIR)/src/lib/crypto/libtommath/*" -print0 | \
|
||||
-not -path "$(SRC_DIR)/src/lib/mixer_module/*" -not -path "$(SRC_DIR)/src/lib/crypto/libtommath/*" -print0 | \
|
||||
xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
|
||||
|
||||
# Cleanup
|
||||
@@ -554,12 +560,17 @@ check_px4: $(call make_list,nuttx,"px4") \
|
||||
check_nxp: $(call make_list,nuttx,"nxp") \
|
||||
sizes
|
||||
|
||||
.PHONY: failsafe_web run_failsafe_web_server
|
||||
failsafe_web:
|
||||
@if ! command -v emcc; then echo -e "Install emscripten first: https://emscripten.org/docs/getting_started/downloads.html\nAnd source the env: source <path>/emsdk_env.sh"; exit 1; fi
|
||||
@$(MAKE) --no-print-directory px4_sitl_default failsafe_test parameters_xml \
|
||||
PX4_CMAKE_BUILD_TYPE=Release BUILD_DIR_SUFFIX=_failsafe_web \
|
||||
CMAKE_ARGS="-DCMAKE_CXX_COMPILER=em++ -DCMAKE_C_COMPILER=emcc"
|
||||
run_failsafe_web_server: failsafe_web
|
||||
@cd build/px4_sitl_default_failsafe_web && \
|
||||
python3 -m http.server
|
||||
ifneq ($(ROS2_WS_DIR),)
|
||||
ROS2_WS_DIR := $(basename ${ROS2_WS_DIR})
|
||||
else
|
||||
ROS2_WS_DIR := ~/colcon_ws
|
||||
endif
|
||||
|
||||
update_ros2_bridge:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --all
|
||||
|
||||
update_px4_ros_com:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --px4_ros_com
|
||||
|
||||
update_px4_msgs:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --px4_msgs
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
[](https://github.com/PX4/PX4-Autopilot/actions?query=workflow%3A%22Nuttx+Targets%22?branch=master) [](https://github.com/PX4/PX4-Autopilot/actions?query=workflow%3A%22SITL+Tests%22)
|
||||
|
||||
[](https://discord.gg/dronecode)
|
||||
[](https://join.slack.com/t/px4/shared_invite/zt-si4xo5qs-R4baYFmMjlrT4rQK5yUnaA)
|
||||
|
||||
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
|
||||
@@ -75,7 +75,7 @@ The PX4 Dev Team syncs up on a [weekly dev call](https://docs.px4.io/main/en/con
|
||||
* [Paul Riseborough](https://github.com/priseborough)
|
||||
* Vision based navigation and Obstacle Avoidance
|
||||
* [Markus Achtelik](https://github.com/markusachtelik)
|
||||
* DDS/ROS2 Interface
|
||||
* RTPS/ROS2 Interface
|
||||
* [Nuno Marques](https://github.com/TSC21)
|
||||
|
||||
See also [maintainers list](https://px4.io/community/maintainers/) (px4.io) and the [contributors list](https://github.com/PX4/PX4-Autopilot/graphs/contributors) (Github).
|
||||
|
||||
@@ -31,11 +31,6 @@ then
|
||||
set PARAM_FILE /dev/eeeprom0
|
||||
fi
|
||||
|
||||
if mft query -q -k MTD -s MTD_PARAMETERS -v /mnt/qspi/params
|
||||
then
|
||||
set PARAM_FILE /mnt/qspi/params
|
||||
fi
|
||||
|
||||
#
|
||||
# Load parameters.
|
||||
#
|
||||
|
||||
@@ -36,6 +36,7 @@ add_subdirectory(airframes)
|
||||
px4_add_romfs_files(
|
||||
px4-rc.mavlink
|
||||
px4-rc.params
|
||||
px4-rc.rtps
|
||||
px4-rc.simulator
|
||||
rc.replay
|
||||
rcS
|
||||
|
||||
@@ -14,7 +14,7 @@ PX4_SIM_MODEL=${PX4_SIM_MODEL:=xvert}
|
||||
param set-default VT_ELEV_MC_LOCK 0
|
||||
param set-default VT_TYPE 0
|
||||
param set-default VT_FW_DIFTHR_EN 1
|
||||
param set-default VT_FW_DIFTHR_S_Y 0.3
|
||||
param set-default VT_FW_DIFTHR_SC 0.3
|
||||
param set-default MPC_MAN_Y_MAX 60
|
||||
param set-default MC_PITCH_P 5
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
# EKF2: Vision position and heading
|
||||
param set-default EKF2_AID_MASK 24
|
||||
param set-default EKF2_EV_DELAY 5
|
||||
param set-default EKF2_EV_CTRL 15
|
||||
param set-default EKF2_GPS_CTRL 0
|
||||
|
||||
# LPE: Vision + baro
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
param set-default EKF2_MAG_ACCLIM 0
|
||||
param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
|
||||
param set-default FW_L1_PERIOD 12
|
||||
@@ -40,6 +41,7 @@ param set-default FW_T_SINK_MIN 2.2
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 30
|
||||
|
||||
param set-default NAV_ACC_RAD 15
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
@@ -23,6 +24,7 @@ param set-default FW_RR_P 0.085
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 20
|
||||
param set-default MIS_DIST_1WP 2500
|
||||
param set-default MIS_DIST_WPS 10000
|
||||
@@ -31,7 +33,11 @@ param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
@@ -23,6 +24,7 @@ param set-default FW_RR_P 0.085
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 20
|
||||
param set-default MIS_DIST_1WP 2500
|
||||
param set-default MIS_DIST_WPS 10000
|
||||
@@ -31,7 +33,11 @@ param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
param set-default EKF2_MAG_ACCLIM 0
|
||||
param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
|
||||
param set-default FW_L1_PERIOD 15
|
||||
@@ -26,6 +27,7 @@ param set-default FW_L1_PERIOD 12
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 30
|
||||
|
||||
param set-default NAV_ACC_RAD 15
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1.1
|
||||
param set-default FW_LND_ANG 5
|
||||
param set-default FW_LND_FL_PMIN 9.5
|
||||
param set-default FW_LND_FL_PMAX 20
|
||||
@@ -23,6 +24,7 @@ param set-default FW_RR_P 0.085
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 20
|
||||
param set-default MIS_DIST_1WP 2500
|
||||
param set-default MIS_DIST_WPS 10000
|
||||
@@ -31,7 +33,9 @@ param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
param set-default RWTO_MAX_PITCH 20
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
param set-default EKF2_MAG_ACCLIM 0
|
||||
param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_AIRSPD_SC 1
|
||||
param set-default FW_LND_ANG 8
|
||||
|
||||
param set-default FW_L1_PERIOD 12
|
||||
@@ -33,11 +34,14 @@ param set-default FW_T_TAS_TC 2
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 30
|
||||
param set-default MIS_TAKEOFF_ALT 30
|
||||
|
||||
param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default FW_USE_NPFG 1
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Advanced Plane SITL
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default EKF2_MAG_ACCLIM 0
|
||||
param set-default EKF2_MAG_YAWLIM 0
|
||||
|
||||
param set-default FW_LND_ANG 8
|
||||
param set-default FW_THR_LND_MAX 0
|
||||
|
||||
param set-default FW_L1_PERIOD 12
|
||||
|
||||
param set-default FW_MAN_P_MAX 30
|
||||
|
||||
param set-default FW_PSP_OFF 2
|
||||
param set-default FW_P_LIM_MAX 32
|
||||
param set-default FW_P_LIM_MIN -15
|
||||
|
||||
param set-default FW_SPOILERS_LND 0.4
|
||||
|
||||
param set-default FW_THR_MIN 0.05
|
||||
param set-default FW_THR_TRIM 0.25
|
||||
|
||||
param set-default FW_T_CLMB_MAX 8
|
||||
param set-default FW_T_SINK_MAX 2.7
|
||||
param set-default FW_T_SINK_MIN 2.2
|
||||
|
||||
param set-default FW_W_EN 1
|
||||
|
||||
param set-default MIS_TAKEOFF_ALT 30
|
||||
|
||||
param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
#param set-default SYS_CTRL_ALLOC 1
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
param set-default CA_SV_CS_COUNT 6
|
||||
param set-default CA_SV_CS0_TRQ_R -0.5
|
||||
param set-default CA_SV_CS0_TYPE 1
|
||||
param set-default CA_SV_CS1_TRQ_R 0.5
|
||||
param set-default CA_SV_CS1_TYPE 2
|
||||
param set-default CA_SV_CS2_TRQ_P 1.0
|
||||
param set-default CA_SV_CS2_TYPE 3
|
||||
param set-default CA_SV_CS3_TRQ_Y 1.0
|
||||
param set-default CA_SV_CS3_TYPE 4
|
||||
param set-default CA_SV_CS4_TYPE 9
|
||||
param set-default CA_SV_CS5_TYPE 10
|
||||
param set-default PWM_MAIN_FUNC3 204
|
||||
param set-default PWM_MAIN_FUNC4 205
|
||||
param set-default PWM_MAIN_FUNC5 101
|
||||
param set-default PWM_MAIN_FUNC6 201
|
||||
param set-default PWM_MAIN_FUNC7 202
|
||||
param set-default PWM_MAIN_FUNC8 203
|
||||
param set-default PWM_MAIN_FUNC9 206
|
||||
param set-default PWM_MAIN_REV 256
|
||||
|
||||
|
||||
set MIXER_FILE etc/mixers-sitl/plane_sitl.main.mix
|
||||
set MIXER custom
|
||||
@@ -61,7 +61,6 @@ param set-default FW_T_CLMB_MAX 8
|
||||
param set-default FW_T_SINK_MAX 2.7
|
||||
param set-default FW_T_SINK_MIN 2.2
|
||||
|
||||
param set-default MC_AIRMODE 1
|
||||
param set-default MC_ROLLRATE_P 0.3
|
||||
param set-default MC_YAW_P 1.6
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ param set-default FW_T_SINK_MAX 2.7
|
||||
param set-default FW_T_SINK_MIN 2.2
|
||||
param set-default FW_T_TAS_TC 2
|
||||
|
||||
param set-default MC_AIRMODE 1
|
||||
param set-default MC_ROLLRATE_P 0.3
|
||||
|
||||
param set-default MPC_ACC_HOR_MAX 2
|
||||
@@ -70,7 +69,7 @@ param set-default MPC_XY_VEL_D_ACC 0.1
|
||||
param set-default NAV_ACC_RAD 5
|
||||
|
||||
param set-default VT_FW_DIFTHR_EN 1
|
||||
param set-default VT_FW_DIFTHR_S_Y 0.5
|
||||
param set-default VT_FW_DIFTHR_SC 0.5
|
||||
param set-default VT_F_TRANS_DUR 1.5
|
||||
param set-default VT_F_TRANS_THR 0.7
|
||||
param set-default VT_TYPE 0
|
||||
|
||||
@@ -34,6 +34,8 @@ param set-default CA_SV_CS1_TYPE 2
|
||||
param set-default CA_SV_CS2_TRQ_P 1.0
|
||||
param set-default CA_SV_CS2_TYPE 3
|
||||
param set-default CA_SV_CS_COUNT 3
|
||||
param set-default CA_SV_TL0_CT 0
|
||||
param set-default CA_SV_TL1_CT 0
|
||||
param set-default CA_SV_TL_COUNT 2
|
||||
|
||||
param set-default PWM_MAIN_FUNC1 101
|
||||
@@ -60,7 +62,6 @@ param set-default FW_T_CLMB_MAX 8
|
||||
param set-default FW_T_SINK_MAX 2.7
|
||||
param set-default FW_T_SINK_MIN 2.2
|
||||
|
||||
param set-default MC_AIRMODE 1
|
||||
param set-default MC_YAWRATE_P 0.3
|
||||
param set-default MC_YAWRATE_I 0.3
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ param set-default GND_THR_CRUISE 0.3
|
||||
param set-default GND_THR_MAX 0.5
|
||||
param set-default GND_THR_MIN 0
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
param set-default NAV_LOITER_RAD 2
|
||||
|
||||
@@ -18,6 +18,7 @@ param set-default GND_THR_CRUISE 0.3
|
||||
param set-default GND_THR_MAX 0.5
|
||||
param set-default GND_THR_MIN 0
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
param set-default NAV_LOITER_RAD 2
|
||||
|
||||
@@ -25,6 +25,7 @@ param set-default GND_THR_CRUISE 0.3
|
||||
param set-default GND_THR_MAX 0.5
|
||||
param set-default GND_THR_MIN 0
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
param set-default NAV_LOITER_RAD 2
|
||||
|
||||
@@ -18,6 +18,7 @@ param set-default GND_THR_CRUISE 0.85
|
||||
param set-default GND_THR_MAX 1
|
||||
param set-default GND_THR_MIN 0
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
param set-default NAV_LOITER_RAD 2
|
||||
|
||||
@@ -20,6 +20,7 @@ param set-default FW_W_EN 1
|
||||
|
||||
param set-default FW_RR_P 0.08
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 50
|
||||
param set-default MIS_TAKEOFF_ALT 3
|
||||
|
||||
param set-default NAV_ACC_RAD 20
|
||||
|
||||
@@ -20,6 +20,7 @@ param set-default FW_W_EN 1
|
||||
|
||||
param set-default FW_RR_P 0.08
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 50
|
||||
param set-default MIS_TAKEOFF_ALT 7
|
||||
|
||||
param set-default NAV_ACC_RAD 20
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Gazebo x500
|
||||
# @name Ignition Gazebo X3
|
||||
#
|
||||
# @type Quadrotor
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=ignition}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=x500}
|
||||
PX4_SIM_WORLD=${PX4_SIM_WORLD:=default}
|
||||
|
||||
param set-default CA_AIRFRAME 0
|
||||
param set-default CA_ROTOR_COUNT 4
|
||||
@@ -30,19 +30,19 @@ param set-default CA_ROTOR3_PX -0.13
|
||||
param set-default CA_ROTOR3_PY 0.20
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
|
||||
param set-default SIM_GZ_FUNC1 101
|
||||
param set-default SIM_GZ_FUNC2 102
|
||||
param set-default SIM_GZ_FUNC3 103
|
||||
param set-default SIM_GZ_FUNC4 104
|
||||
param set-default SIM_IGN_FUNC1 101
|
||||
param set-default SIM_IGN_FUNC2 102
|
||||
param set-default SIM_IGN_FUNC3 103
|
||||
param set-default SIM_IGN_FUNC4 104
|
||||
|
||||
param set-default SIM_GZ_MIN1 150
|
||||
param set-default SIM_GZ_MIN2 150
|
||||
param set-default SIM_GZ_MIN3 150
|
||||
param set-default SIM_GZ_MIN4 150
|
||||
param set-default SIM_IGN_MIN1 150
|
||||
param set-default SIM_IGN_MIN2 150
|
||||
param set-default SIM_IGN_MIN3 150
|
||||
param set-default SIM_IGN_MIN4 150
|
||||
|
||||
param set-default SIM_GZ_MAX1 1000
|
||||
param set-default SIM_GZ_MAX2 1000
|
||||
param set-default SIM_GZ_MAX3 1000
|
||||
param set-default SIM_GZ_MAX4 1000
|
||||
param set-default SIM_IGN_MAX1 1000
|
||||
param set-default SIM_IGN_MAX2 1000
|
||||
param set-default SIM_IGN_MAX3 1000
|
||||
param set-default SIM_IGN_MAX4 1000
|
||||
|
||||
param set-default MPC_THR_HOVER 0.60
|
||||
|
||||
@@ -61,7 +61,6 @@ px4_add_romfs_files(
|
||||
1036_malolo
|
||||
1037_believer
|
||||
1038_glider
|
||||
1039_advanced_plane
|
||||
1040_standard_vtol
|
||||
1041_tailsitter
|
||||
1042_tiltrotor
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
udp_offboard_port_local=$((14580+px4_instance))
|
||||
udp_offboard_port_remote=$((14540+px4_instance))
|
||||
[ "$px4_instance" -gt 9 ] && udp_offboard_port_remote=14549 # use the same ports for more than 10 instances to avoid port overlaps
|
||||
[ $px4_instance -gt 9 ] && udp_offboard_port_remote=14549 # use the same ports for more than 10 instances to avoid port overlaps
|
||||
udp_onboard_payload_port_local=$((14280+px4_instance))
|
||||
udp_onboard_payload_port_remote=$((14030+px4_instance))
|
||||
udp_onboard_gimbal_port_local=$((13030+px4_instance))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
micrortps_client start -t UDP -r $((2019+2*px4_instance)) -s $((2020+2*px4_instance))
|
||||
@@ -13,98 +13,64 @@ if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0"
|
||||
sensor_mag_sim start
|
||||
|
||||
else
|
||||
echo "ERROR [init] simulator_sih failed to start"
|
||||
echo "ERROR [init] simulator_sih failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elif [ "$PX4_SIMULATOR" = "gz" ]; then
|
||||
elif [ "$PX4_SIMULATOR" = "ignition" ]; then
|
||||
|
||||
# source generated gazebo_env.sh for IGN_GAZEBO_RESOURCE_PATH
|
||||
if [ -f ./gazebo_env.sh ]; then
|
||||
if [ -f gazebo_env.sh ]; then
|
||||
. ./gazebo_env.sh
|
||||
|
||||
elif [ -f ../gazebo_env.sh ]; then
|
||||
. ../gazebo_env.sh
|
||||
fi
|
||||
|
||||
gz_command="ign" # "ign" before garden
|
||||
gz_sub_command="gazebo" # "gazebo" before garden
|
||||
ign_world=$( ign topic -l | grep -m 1 -e "/world/.*/clock" | sed 's/\/world\///g; s/\/clock//g' )
|
||||
|
||||
# look for running ${gz_command} gazebo world
|
||||
gz_world=$( ${gz_command} topic -l | grep -m 1 -e "/world/.*/clock" | sed 's/\/world\///g; s/\/clock//g' )
|
||||
if [ -z $ign_world ]; then
|
||||
|
||||
# shellcheck disable=SC2153
|
||||
if [ -z "${gz_world}" ] && [ -n "${PX4_GZ_WORLDS}" ] && [ -n "${PX4_GZ_WORLD}" ]; then
|
||||
# starting ign gazebo with ${PX4_SIM_WORLD} world
|
||||
echo "INFO [init] starting ign gazebo"
|
||||
|
||||
echo "INFO [init] starting gazebo with world: ${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf"
|
||||
ign gazebo --verbose=1 -r -s "${PX4_IGN_GAZEBO_WORLDS}/${PX4_SIM_WORLD}.sdf" &
|
||||
|
||||
${gz_command} ${gz_sub_command} --verbose=1 -r -s "${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf" &
|
||||
|
||||
if [ -z "${HEADLESS}" ]; then
|
||||
if [ -z $HEADLESS ]; then
|
||||
# HEADLESS not set, starting ign gazebo gui
|
||||
${gz_command} gazebo -g &
|
||||
ign gazebo -g &
|
||||
fi
|
||||
|
||||
else
|
||||
echo "INFO [init] gazebo already running world: ${gz_world}"
|
||||
PX4_GZ_WORLD=${gz_world}
|
||||
echo "INFO [init] ign gazebo already running world: $ign_world"
|
||||
PX4_SIM_WORLD=$ign_world
|
||||
fi
|
||||
|
||||
# start gz_bridge
|
||||
if [ -n "${PX4_GZ_MODEL}" ] && [ -z "${PX4_GZ_MODEL_NAME}" ]; then
|
||||
# model specified, gz_bridge will spawn model
|
||||
|
||||
if [ -n "${PX4_GZ_MODEL_POSE}" ]; then
|
||||
# Clean potential input line formatting.
|
||||
model_pose="$( echo "${PX4_GZ_MODEL_POSE}" | sed -e 's/^[ \t]*//; s/[ \t]*$//; s/,/ /g; s/ / /g; s/ /,/g' )"
|
||||
echo "INFO [init] PX4_GZ_MODEL_POSE set, spawning at: ${model_pose}"
|
||||
|
||||
else
|
||||
echo "WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin."
|
||||
model_pose="0,0,0,0,0,0"
|
||||
fi
|
||||
|
||||
# start gz bridge with pose arg.
|
||||
if gz_bridge start -p "${model_pose}" -m "${PX4_GZ_MODEL}" -w "${PX4_GZ_WORLD}" -i "${px4_instance}"; then
|
||||
if [ -z $PX4_IGN_MODEL_POSE ]; then
|
||||
# start ignition bridge without pose arg.
|
||||
echo "WARN [init] PX4_IGN_MODEL_POSE not set, spawning at origin."
|
||||
if simulator_ignition_bridge start -m "${PX4_SIM_MODEL}" -w "${PX4_SIM_WORLD}"; then
|
||||
sensor_baro_sim start
|
||||
sensor_gps_sim start
|
||||
sensor_mag_sim start
|
||||
|
||||
else
|
||||
echo "ERROR [init] gazebo failed to start"
|
||||
echo "ERROR [init] ign gazebo failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elif [ -n "${PX4_GZ_MODEL_NAME}" ] && [ -z "${PX4_GZ_MODEL}" ]; then
|
||||
# model name specificed, gz_bridge will attach to existing model
|
||||
|
||||
if gz_bridge start -n "${PX4_GZ_MODEL_NAME}" -w "${PX4_GZ_WORLD}"; then
|
||||
sensor_baro_sim start
|
||||
sensor_gps_sim start
|
||||
sensor_mag_sim start
|
||||
|
||||
else
|
||||
echo "ERROR [init] gazebo failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elif [ -n "${PX4_SIM_MODEL}" ] && [ -z "${PX4_GZ_MODEL_NAME}" ] && [ -z "${PX4_GZ_MODEL}" ]; then
|
||||
|
||||
echo "WARN [init] PX4_GZ_MODEL_NAME or PX4_GZ_MODEL not set using PX4_SIM_MODEL."
|
||||
|
||||
if gz_bridge start -m "${PX4_SIM_MODEL}" -w "${PX4_GZ_WORLD}" -i "${px4_instance}"; then
|
||||
sensor_baro_sim start
|
||||
sensor_gps_sim start
|
||||
sensor_mag_sim start
|
||||
|
||||
else
|
||||
echo "ERROR [init] gazebo failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
echo "ERROR [init] failed to pass only PX4_GZ_MODEL_NAME or PX4_GZ_MODEL"
|
||||
exit 1
|
||||
|
||||
# Clean potential input line formatting.
|
||||
model_pose="$( echo ${PX4_IGN_MODEL_POSE} | sed -e 's/^[ \t]*//; s/[ \t]*$//; s/,/ /g; s/ / /g; s/ /,/g' )"
|
||||
echo "INFO [init] PX4_IGN_MODEL_POSE set, spawning at: ${model_pose}"
|
||||
|
||||
# start ignition bridge with pose arg.
|
||||
if simulator_ignition_bridge start -p "${model_pose}" -m "${PX4_SIM_MODEL}" -w "${PX4_SIM_WORLD}"; then
|
||||
sensor_baro_sim start
|
||||
sensor_gps_sim start
|
||||
sensor_mag_sim start
|
||||
else
|
||||
echo "ERROR [init] ign gazebo failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
@@ -120,13 +86,13 @@ else
|
||||
echo "PX4 SIM HOST: localhost"
|
||||
simulator_mavlink start -c $simulator_tcp_port
|
||||
else
|
||||
echo "PX4 SIM HOST: ${PX4_SIM_HOST_ADDR}"
|
||||
simulator_mavlink start -t "${PX4_SIM_HOST_ADDR}" "${simulator_tcp_port}"
|
||||
echo "PX4 SIM HOST: $PX4_SIM_HOST_ADDR"
|
||||
simulator_mavlink start -t $PX4_SIM_HOST_ADDR $simulator_tcp_port
|
||||
fi
|
||||
|
||||
else
|
||||
echo "PX4 SIM HOST: ${PX4_SIM_HOSTNAME}"
|
||||
simulator_mavlink start -h "${PX4_SIM_HOSTNAME}" "${simulator_tcp_port}"
|
||||
echo "PX4 SIM HOST: $PX4_SIM_HOSTNAME"
|
||||
simulator_mavlink start -h $PX4_SIM_HOSTNAME $simulator_tcp_port
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
@@ -74,7 +74,7 @@ if [ -f $PARAM_FILE ]; then
|
||||
then
|
||||
echo "ERROR [init] param import failed"
|
||||
|
||||
bsondump $PARAM_FILE
|
||||
param dump $PARAM_FILE
|
||||
|
||||
# try to make a backup copy
|
||||
cp $PARAM_FILE param_import_fail.bson
|
||||
@@ -85,7 +85,7 @@ if [ -f $PARAM_FILE ]; then
|
||||
echo "[init] importing from parameter backup"
|
||||
|
||||
# dump current backup file contents for comparison
|
||||
bsondump $PARAM_BACKUP_FILE
|
||||
param dump $PARAM_BACKUP_FILE
|
||||
|
||||
param import $PARAM_BACKUP_FILE
|
||||
|
||||
@@ -142,9 +142,7 @@ then
|
||||
param set CAL_GYRO2_ID 1311004 # 1311004: DRV_IMU_DEVTYPE_SIM, BUS: 3, ADDR: 1, TYPE: SIMULATION
|
||||
|
||||
param set CAL_MAG0_ID 197388
|
||||
param set CAL_MAG0_PRIO 50
|
||||
param set CAL_MAG1_ID 197644
|
||||
param set CAL_MAG1_PRIO 50
|
||||
|
||||
param set SENS_BOARD_X_OFF 0.000001
|
||||
param set SENS_DPRES_OFF 0.001
|
||||
@@ -227,7 +225,7 @@ then
|
||||
elif [ ! -e "$autostart_file" ] && [ "$SYS_AUTOSTART" -ne "0" ]
|
||||
then
|
||||
echo "Error: no autostart file found ($autostart_file)"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#user defined params for instances can be in PATH
|
||||
@@ -261,20 +259,11 @@ fi
|
||||
|
||||
navigator start
|
||||
|
||||
# Try to start the microdds_client with UDP transport if module exists
|
||||
microdds_ns=""
|
||||
if [ "$px4_instance" -ne "0" ]
|
||||
# Try to start the micrortps_client with UDP transport if module exists
|
||||
if px4-micrortps_client status > /dev/null 2>&1
|
||||
then
|
||||
# Assign new xrce dds key based on instance number and set default namespace
|
||||
param set XRCE_DDS_KEY ${px4_instance}
|
||||
microdds_ns="-n px4_$px4_instance"
|
||||
. px4-rc.rtps
|
||||
fi
|
||||
if [ -n "$PX4_MICRODDS_NS" ]
|
||||
then
|
||||
# Override namespace if environment variable is defined
|
||||
microdds_ns="-n $PX4_MICRODDS_NS"
|
||||
fi
|
||||
microdds_client start -t udp -p 8888 $microdds_ns
|
||||
|
||||
if param greater -s MNT_MODE_IN -1
|
||||
then
|
||||
|
||||
@@ -31,12 +31,14 @@ param set-default MC_PITCH_P 6
|
||||
param set-default MC_PITCHRATE_P 0.2
|
||||
param set-default MC_ROLL_P 6
|
||||
param set-default MC_ROLLRATE_P 0.3
|
||||
param set-default MIS_LTRMIN_ALT 10
|
||||
param set-default MIS_TAKEOFF_ALT 10
|
||||
param set-default MIS_YAW_TMT 10
|
||||
|
||||
param set-default MPC_ACC_HOR_MAX 2
|
||||
param set-default MPC_ACC_HOR_MAX 2
|
||||
param set-default MPC_THR_MIN 0.1
|
||||
param set-default MPC_TKO_SPEED 1
|
||||
param set-default MPC_XY_P 0.8
|
||||
param set-default MPC_XY_VEL_D_ACC 0.1
|
||||
param set-default MPC_XY_VEL_I_ACC 4
|
||||
|
||||
@@ -22,7 +22,7 @@ param set-default VT_ELEV_MC_LOCK 0
|
||||
param set-default VT_MOT_COUNT 2
|
||||
param set-default VT_TYPE 0
|
||||
param set-default VT_FW_DIFTHR_EN 1
|
||||
param set-default VT_FW_DIFTHR_S_Y 0.3
|
||||
param set-default VT_FW_DIFTHR_SC 0.3
|
||||
param set-default MPC_MAN_Y_MAX 60
|
||||
param set-default MC_PITCH_P 5
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ param set-default COM_SPOOLUP_TIME 1.5
|
||||
param set-default MPC_THR_HOVER 0.45
|
||||
param set-default MPC_TILTMAX_AIR 25
|
||||
param set-default MPC_TKO_RAMP_T 1.8
|
||||
param set-default MPC_TKO_SPEED 1
|
||||
param set-default MPC_VEL_MANUAL 3
|
||||
param set-default MPC_XY_CRUISE 3
|
||||
param set-default MPC_XY_VEL_MAX 3.5
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name PX4 Vision Dev Kit v1
|
||||
# @name PX4 Vision DevKit Platform
|
||||
#
|
||||
# @type Quadrotor x
|
||||
# @class Copter
|
||||
@@ -63,6 +63,7 @@ param set-default MPC_ACC_UP_MAX 4
|
||||
param set-default MPC_MAN_Y_MAX 120
|
||||
param set-default MPC_TILTMAX_AIR 45
|
||||
param set-default MPC_THR_HOVER 0.3
|
||||
param set-default MPC_TKO_SPEED 1
|
||||
param set-default MPC_VEL_MANUAL 5
|
||||
param set-default MPC_XY_CRUISE 5
|
||||
param set-default MPC_XY_VEL_MAX 5
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name PX4 Vision Dev Kit v1.5
|
||||
#
|
||||
# @type Quadrotor x
|
||||
# @class Copter
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
# Commander Parameters
|
||||
param set-default COM_OBS_AVOID 1
|
||||
param set-default COM_DISARM_LAND 0.5
|
||||
|
||||
# EKF2 parameters
|
||||
param set-default EKF2_AID_MASK 35
|
||||
param set-default EKF2_IMU_POS_X 0.02
|
||||
param set-default EKF2_GPS_POS_X 0.055
|
||||
param set-default EKF2_GPS_POS_Z -0.15
|
||||
param set-default EKF2_MIN_RNG 0.03
|
||||
param set-default EKF2_OF_POS_X 0.055
|
||||
param set-default EKF2_OF_POS_Y 0.02
|
||||
param set-default EKF2_OF_POS_Z 0.065
|
||||
param set-default EKF2_REQ_HDRIFT 0.3
|
||||
param set-default EKF2_REQ_SACC 1
|
||||
param set-default EKF2_REQ_VDRIFT 0.3
|
||||
param set-default EKF2_RNG_A_HMAX 8
|
||||
param set-default EKF2_RNG_A_VMAX 2
|
||||
param set-default EKF2_RNG_POS_X 0.055
|
||||
param set-default EKF2_RNG_POS_Y -0.01
|
||||
param set-default EKF2_RNG_POS_Z 0.065
|
||||
param set-default EKF2_PCOEF_XP -0.25
|
||||
param set-default EKF2_PCOEF_YN -0.55
|
||||
param set-default EKF2_PCOEF_YP -0.55
|
||||
|
||||
# MAVLink parameters
|
||||
param set-default MAV_0_CONFIG 101
|
||||
param set-default MAV_1_CONFIG 102
|
||||
param set-default MAV_1_RATE 80000
|
||||
param set-default MAV_1_MODE 9
|
||||
param set-default SER_TEL1_BAUD 921600
|
||||
|
||||
# Vehicle attitude PID tuning
|
||||
param set-default MC_ACRO_EXPO 0
|
||||
param set-default MC_ACRO_EXPO_Y 0
|
||||
param set-default MC_ACRO_P_MAX 200
|
||||
param set-default MC_ACRO_R_MAX 200
|
||||
param set-default MC_ACRO_SUPEXPO 0
|
||||
param set-default MC_ACRO_SUPEXPOY 0
|
||||
param set-default MC_ACRO_Y_MAX 150
|
||||
param set-default MC_PITCHRATE_D 0.0015
|
||||
param set-default MC_ROLLRATE_D 0.0015
|
||||
param set-default MC_YAWRATE_P 0.3
|
||||
|
||||
# Position Control Tuning
|
||||
param set-default CP_DIST 6
|
||||
param set-default MPC_ACC_DOWN_MAX 5
|
||||
param set-default MPC_ACC_HOR_MAX 10
|
||||
param set-default MPC_ACC_UP_MAX 4
|
||||
param set-default MPC_MANTHR_MIN 0
|
||||
param set-default MPC_MAN_Y_MAX 120
|
||||
param set-default MPC_TILTMAX_AIR 45
|
||||
param set-default MPC_THR_HOVER 0.3
|
||||
param set-default MPC_VEL_MANUAL 5
|
||||
param set-default MPC_XY_CRUISE 5
|
||||
param set-default MPC_XY_VEL_MAX 5
|
||||
param set-default MPC_XY_VEL_P_ACC 1.58
|
||||
param set-default MPC_XY_TRAJ_P 0.3
|
||||
param set-default MPC_Z_TRAJ_P 0.3
|
||||
param set-default MPC_Z_VEL_P_ACC 5
|
||||
param set-default MPC_Z_VEL_I_ACC 3
|
||||
param set-default MPC_LAND_ALT1 3
|
||||
param set-default MPC_LAND_ALT2 1
|
||||
param set-default MPC_POS_MODE 3
|
||||
param set-default CP_GO_NO_DATA 1
|
||||
|
||||
# Navigator Parameters
|
||||
param set-default NAV_ACC_RAD 2
|
||||
|
||||
# RTL Parameters
|
||||
param set-default RTL_DESCEND_ALT 5
|
||||
param set-default RTL_RETURN_ALT 5
|
||||
|
||||
# Logging Parameters
|
||||
param set-default SDLOG_PROFILE 131
|
||||
|
||||
# Sensors Parameters
|
||||
param set-default SENS_CM8JL65_CFG 202
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
param set-default SENS_FLOW_MINHGT 0.5
|
||||
param set-default IMU_GYRO_CUTOFF 100
|
||||
param set-default SENS_TFLOW_CFG 103
|
||||
|
||||
# Power Parameters
|
||||
param set-default BAT1_N_CELLS 4
|
||||
param set-default BAT1_A_PER_V 36.364
|
||||
param set-default BAT1_V_DIV 18.182
|
||||
|
||||
# Circuit breakers
|
||||
param set-default CBRK_IO_SAFETY 22027
|
||||
|
||||
param set-default THR_MDL_FAC 0.3
|
||||
|
||||
param set-default CA_ROTOR_COUNT 4
|
||||
param set-default CA_ROTOR0_PX 0.15
|
||||
param set-default CA_ROTOR0_PY 0.15
|
||||
param set-default CA_ROTOR0_KM 0.05
|
||||
param set-default CA_ROTOR1_PX -0.15
|
||||
param set-default CA_ROTOR1_PY -0.15
|
||||
param set-default CA_ROTOR1_KM 0.05
|
||||
param set-default CA_ROTOR2_PX 0.15
|
||||
param set-default CA_ROTOR2_PY -0.15
|
||||
param set-default CA_ROTOR2_KM -0.05
|
||||
param set-default CA_ROTOR3_PX -0.15
|
||||
param set-default CA_ROTOR3_PY 0.15
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
|
||||
# Outputs
|
||||
param set-default PWM_AUX_FUNC1 101
|
||||
param set-default PWM_AUX_FUNC2 102
|
||||
param set-default PWM_AUX_FUNC3 103
|
||||
param set-default PWM_AUX_FUNC4 104
|
||||
|
||||
@@ -53,6 +53,7 @@ param set-default MPC_XY_VEL_P_ACC 2.6
|
||||
param set-default MPC_XY_VEL_I_ACC 1.2
|
||||
param set-default MPC_XY_VEL_D_ACC 0.2
|
||||
param set-default MPC_TKO_RAMP_T 1
|
||||
param set-default MPC_TKO_SPEED 1.1
|
||||
param set-default MPC_VEL_MANUAL 3
|
||||
|
||||
param set-default BAT1_SOURCE 0
|
||||
|
||||
@@ -62,6 +62,7 @@ param set-default MPC_XY_VEL_P_ACC 2.6
|
||||
param set-default MPC_XY_VEL_I_ACC 1.2
|
||||
param set-default MPC_XY_VEL_D_ACC 0.2
|
||||
param set-default MPC_TKO_RAMP_T 1
|
||||
param set-default MPC_TKO_SPEED 1.1
|
||||
param set-default MPC_VEL_MANUAL 3
|
||||
|
||||
param set-default BAT1_SOURCE 0
|
||||
|
||||
@@ -39,6 +39,7 @@ param set-default GND_THR_CRUISE 0.3
|
||||
param set-default GND_THR_MAX 0.5
|
||||
param set-default GND_THR_MIN 0
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Aion Robotics R1 UGV
|
||||
#
|
||||
# @url https://www.aionrobotics.com/r1
|
||||
#
|
||||
# @type Rover
|
||||
# @class Rover
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.rover_defaults
|
||||
|
||||
param set-default BAT1_N_CELLS 4
|
||||
|
||||
param set-default EKF2_GBIAS_INIT 0.01
|
||||
param set-default EKF2_ANGERR_INIT 0.01
|
||||
param set-default EKF2_MAG_TYPE 1
|
||||
|
||||
param set-default FW_AIRSPD_MIN 0
|
||||
param set-default FW_AIRSPD_TRIM 1
|
||||
param set-default FW_AIRSPD_MAX 3
|
||||
|
||||
param set-default GND_SP_CTRL_MODE 1
|
||||
param set-default GND_L1_DIST 5
|
||||
param set-default GND_L1_PERIOD 3
|
||||
param set-default GND_THR_CRUISE 0.7
|
||||
param set-default GND_THR_MAX 0.5
|
||||
|
||||
# Because this is differential drive, it can make a turn with radius 0.
|
||||
# This corresponds to a turn angle of pi radians.
|
||||
# If a special case is made for differential-drive, this will need to change.
|
||||
param set-default GND_MAX_ANG 3.142
|
||||
param set-default GND_WHEEL_BASE 0.3
|
||||
|
||||
# TODO: Set to -1.0, to allow reversing. This will require many changes in the codebase
|
||||
# to support negative throttle.
|
||||
param set-default GND_THR_MIN 0
|
||||
param set-default GND_SPEED_P 0.25
|
||||
param set-default GND_SPEED_I 3
|
||||
param set-default GND_SPEED_D 0.001
|
||||
param set-default GND_SPEED_IMAX 0.125
|
||||
param set-default GND_SPEED_THR_SC 1
|
||||
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
# Enable Airspeed check circuit breaker because Rovers will have no airspeed sensor
|
||||
param set-default CBRK_AIRSPD_CHK 162128
|
||||
|
||||
# Differential drive acts like ackermann steering with a maximum turn angle of 180 degrees, or pi radians
|
||||
param set-default GND_MAX_ANG 3.1415
|
||||
|
||||
param set-default RBCLW_BAUD 8
|
||||
param set-default RBCLW_COUNTS_REV 1200
|
||||
param set-default RBCLW_ADDRESS 128
|
||||
# 104 corresponds to Telem 4
|
||||
param set-default RBCLW_SER_CFG 104
|
||||
# Start this driver after setting parameters, because the driver uses some of those parameters.
|
||||
# roboclaw start /dev/ttyS3
|
||||
|
||||
# Set geometry & output configration
|
||||
param set-default CA_AIRFRAME 6
|
||||
param set-default CA_R_REV 3
|
||||
param set-default PWM_MAIN_FUNC1 101
|
||||
param set-default PWM_MAIN_FUNC2 102
|
||||
param set-default PWM_MAIN_DIS1 1500
|
||||
param set-default PWM_MAIN_DIS2 1500
|
||||
param set-default PWM_MAIN_TIM0 50
|
||||
param set-default PWM_MAIN_TIM1 50
|
||||
|
||||
@@ -45,6 +45,7 @@ param set-default GND_SPEED_D 0.001
|
||||
param set-default GND_SPEED_IMAX 0.125
|
||||
param set-default GND_SPEED_THR_SC 1
|
||||
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
@@ -57,7 +57,6 @@ px4_add_romfs_files(
|
||||
4016_holybro_px4vision
|
||||
4017_nxp_hovergames
|
||||
4019_x500_v2
|
||||
4020_holybro_px4vision_v1_5
|
||||
4040_reaper
|
||||
4041_beta75x
|
||||
4050_generic_250
|
||||
@@ -118,7 +117,6 @@ px4_add_romfs_files(
|
||||
|
||||
50000_generic_ground_vehicle
|
||||
50004_nxpcup_car_dfrobot_gpx
|
||||
50003_aion_robotics_r1_rover
|
||||
|
||||
# [60000, 61000] (Unmanned) Underwater Robots
|
||||
60000_uuv_generic
|
||||
|
||||
@@ -13,6 +13,7 @@ param set-default MAV_TYPE 11
|
||||
#
|
||||
# Default parameters for UGVs.
|
||||
#
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set-default NAV_ACC_RAD 2
|
||||
|
||||
@@ -43,8 +43,8 @@ param set-default RTL_LAND_DELAY -1
|
||||
param set-default NAV_ACC_RAD 10
|
||||
|
||||
param set-default MIS_DIST_WPS 5000
|
||||
param set-default MIS_LTRMIN_ALT 25
|
||||
param set-default MIS_TAKEOFF_ALT 25
|
||||
param set-default MIS_TKO_LAND_REQ 2
|
||||
|
||||
#
|
||||
# FW takeoff acceleration can easily exceed ublox GPS 2G default.
|
||||
|
||||
@@ -13,6 +13,7 @@ param set-default MAV_TYPE 10
|
||||
#
|
||||
# Default parameters for UGVs.
|
||||
#
|
||||
param set-default MIS_LTRMIN_ALT 0.01
|
||||
param set-default MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set-default NAV_ACC_RAD 2
|
||||
|
||||
@@ -191,10 +191,7 @@ then
|
||||
ist8308 -X -q start
|
||||
ist8310 -X -q start
|
||||
lis2mdl -X -q start
|
||||
if ! lis3mdl -X -q start
|
||||
then
|
||||
lis3mdl -X -q -a 0x1c start
|
||||
fi
|
||||
lis3mdl -X -q start
|
||||
qmc5883l -X -q start
|
||||
rm3100 -X -q start
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ param set-default EKF2_FUSE_BETA 1
|
||||
param set-default HTE_VXY_THR 2.0
|
||||
|
||||
param set-default MIS_DIST_WPS 5000
|
||||
param set-default MIS_TKO_LAND_REQ 2
|
||||
|
||||
param set-default MPC_ACC_HOR_MAX 2
|
||||
param set-default MPC_VEL_MANUAL 5
|
||||
|
||||
@@ -130,7 +130,7 @@ else
|
||||
echo "ERROR [init] param import failed"
|
||||
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
|
||||
|
||||
bsondump $PARAM_FILE
|
||||
param dump $PARAM_FILE
|
||||
|
||||
if [ -d "/fs/microsd" ]
|
||||
then
|
||||
@@ -143,7 +143,7 @@ else
|
||||
echo "[init] importing from parameter backup"
|
||||
|
||||
# dump current backup file contents for comparison
|
||||
bsondump $PARAM_BACKUP_FILE
|
||||
param dump $PARAM_BACKUP_FILE
|
||||
|
||||
param import $PARAM_BACKUP_FILE
|
||||
|
||||
@@ -162,7 +162,7 @@ else
|
||||
param select-backup $PARAM_BACKUP_FILE
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X ARK_FMU_V6X
|
||||
if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X
|
||||
then
|
||||
netman update -i eth0
|
||||
fi
|
||||
@@ -264,6 +264,23 @@ else
|
||||
. $FCONFIG
|
||||
fi
|
||||
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs.
|
||||
#
|
||||
if param greater -s UAVCAN_ENABLE 0
|
||||
then
|
||||
# Start core UAVCAN module.
|
||||
if ! uavcan start
|
||||
then
|
||||
tune_control play error
|
||||
fi
|
||||
else
|
||||
if param greater -s CYPHAL_ENABLE 0
|
||||
then
|
||||
cyphal start
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Start IO for PWM output or RC input if enabled
|
||||
#
|
||||
@@ -307,27 +324,6 @@ else
|
||||
rc_update start
|
||||
manual_control start
|
||||
|
||||
# Start camera trigger, capture and PPS before pwm_out as they might access
|
||||
# pwm pins
|
||||
if param greater -s TRIG_MODE 0
|
||||
then
|
||||
camera_trigger start
|
||||
camera_feedback start
|
||||
fi
|
||||
# PPS capture driver
|
||||
if param greater -s PPS_CAP_ENABLE 0
|
||||
then
|
||||
pps_capture start
|
||||
fi
|
||||
# Camera capture driver
|
||||
if param greater -s CAM_CAP_FBACK 0
|
||||
then
|
||||
if camera_capture start
|
||||
then
|
||||
camera_capture on
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Sensors System (start before Commander so Preflight checks are properly run).
|
||||
# Commander needs to be this early for in-air-restarts.
|
||||
@@ -394,6 +390,12 @@ else
|
||||
mag_bias_estimator start
|
||||
fi
|
||||
|
||||
if param greater -s TRIG_MODE 0
|
||||
then
|
||||
camera_trigger start
|
||||
camera_feedback start
|
||||
fi
|
||||
|
||||
#
|
||||
# Optional board mavlink streams: rc.board_mavlink
|
||||
#
|
||||
@@ -414,6 +416,21 @@ else
|
||||
# Must be started after the serial config is read
|
||||
rc_input start $RC_INPUT_ARGS
|
||||
|
||||
# PPS capture driver (before pwm_out)
|
||||
if param greater -s PPS_CAP_ENABLE 0
|
||||
then
|
||||
pps_capture start
|
||||
fi
|
||||
|
||||
# Camera capture driver (before pwm_out)
|
||||
if param greater -s CAM_CAP_FBACK 0
|
||||
then
|
||||
if camera_capture start
|
||||
then
|
||||
camera_capture on
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Play the startup tune (if not disabled or there is an error)
|
||||
#
|
||||
@@ -510,23 +527,6 @@ else
|
||||
fi
|
||||
unset BOARD_BOOTLOADER_UPGRADE
|
||||
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs.
|
||||
#
|
||||
if param greater -s UAVCAN_ENABLE 0
|
||||
then
|
||||
# Start core UAVCAN module.
|
||||
if ! uavcan start
|
||||
then
|
||||
tune_control play error
|
||||
fi
|
||||
else
|
||||
if param greater -s CYPHAL_ENABLE 0
|
||||
then
|
||||
cyphal start
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# End of autostart.
|
||||
#
|
||||
|
||||
@@ -43,13 +43,13 @@ do
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param reset SYS_HITL'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param status'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param save'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/mtd_params'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param dump'
|
||||
|
||||
${DIR}/reboot.py --device ${SERIAL_DEVICE}
|
||||
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param status'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/mtd_params' || true
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/microsd/parameters_backup.bson' || true
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param dump /fs/mtd_params' || true
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param dump /fs/microsd/parameters_backup.bson' || true
|
||||
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'ps'
|
||||
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'work_queue status'
|
||||
|
||||
@@ -8,6 +8,7 @@ if [ $# -gt 0 ]; then
|
||||
fi
|
||||
|
||||
exec find boards msg src platforms test \
|
||||
-path msg/templates/urtps -prune -o \
|
||||
-path platforms/nuttx/NuttX -prune -o \
|
||||
-path platforms/qurt/dspal -prune -o \
|
||||
-path src/drivers/uavcan/libuavcan -prune -o \
|
||||
@@ -20,6 +21,8 @@ exec find boards msg src platforms test \
|
||||
-path src/modules/ekf2/EKF -prune -o \
|
||||
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
|
||||
-path src/modules/mavlink/mavlink -prune -o \
|
||||
-path src/modules/micrortps_bridge/micro-CDR -prune -o \
|
||||
-path src/modules/micrortps_bridge/microRTPS_client -prune -o \
|
||||
-path test/mavsdk_tests/catch2 -prune -o \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/crypto/libtomcrypt -prune -o \
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$0
|
||||
if [[ ${SCRIPT_DIR:0:1} != '/' ]]; then
|
||||
SCRIPT_DIR=$(dirname $(realpath -s "$PWD/$0"))
|
||||
fi
|
||||
|
||||
PX4_DIR=$(cd "$(dirname $(dirname $SCRIPT_DIR))" && pwd)
|
||||
|
||||
if [ -d $PX4_DIR/build/*_rtps ]; then
|
||||
cd $PX4_DIR/build/*_rtps/src/modules/micrortps_bridge/micrortps_agent/
|
||||
cmake -Bbuild
|
||||
cmake --build build -j$(nproc --all)
|
||||
fi
|
||||
@@ -28,13 +28,12 @@ args = parser.parse_args()
|
||||
verbose = args.verbose
|
||||
|
||||
build_configs = []
|
||||
excluded_boards = ['modalai_voxl2', 'px4_ros2'] # TODO: fix and enable
|
||||
excluded_manufacturers = ['atlflight']
|
||||
excluded_platforms = ['qurt']
|
||||
excluded_labels = [
|
||||
'stackcheck',
|
||||
'nolockstep', 'replay', 'test',
|
||||
'uavcanv1', # TODO: fix and enable
|
||||
'uavcanv1' # TODO: fix and enable
|
||||
]
|
||||
|
||||
def process_target(px4board_file, target_name):
|
||||
@@ -88,18 +87,10 @@ for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
|
||||
for board in os.scandir(manufacturer.path):
|
||||
if not board.is_dir():
|
||||
continue
|
||||
|
||||
for files in os.scandir(board.path):
|
||||
if files.is_file() and files.name.endswith('.px4board'):
|
||||
|
||||
board_name = manufacturer.name + '_' + board.name
|
||||
label = files.name[:-9]
|
||||
target_name = manufacturer.name + '_' + board.name + '_' + label
|
||||
|
||||
if board_name in excluded_boards:
|
||||
if verbose: print(f'excluding board {board_name} ({target_name})')
|
||||
continue
|
||||
|
||||
if label in excluded_labels:
|
||||
if verbose: print(f'excluding label {label} ({target_name})')
|
||||
continue
|
||||
|
||||
@@ -489,7 +489,7 @@ actuators = {
|
||||
|
||||
with open(output_file, 'w') as outfile:
|
||||
indent = 2 if verbose else None
|
||||
json.dump(actuators, outfile, indent=indent, sort_keys=True)
|
||||
json.dump(actuators, outfile, indent=indent)
|
||||
|
||||
if compress:
|
||||
save_compressed(output_file)
|
||||
|
||||
@@ -32,16 +32,16 @@ def extract_timer(line):
|
||||
# Try format: initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}),
|
||||
search = re.search('Timer::([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
|
||||
if search:
|
||||
return search.group(1), 'generic'
|
||||
return search.group(1)
|
||||
|
||||
# nxp rt1062 format: initIOPWM(PWM::FlexPWM2),
|
||||
search = re.search('PWM::Flex([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
|
||||
if search:
|
||||
return search.group(1), 'imxrt'
|
||||
return search.group(1)
|
||||
|
||||
return None, 'unknown'
|
||||
return None
|
||||
|
||||
def extract_timer_from_channel(line, num_channels_already_found):
|
||||
def extract_timer_from_channel(line):
|
||||
# Try format: initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}),
|
||||
search = re.search('Timer::([0-9a-zA-Z_]+), ', line, re.IGNORECASE)
|
||||
if search:
|
||||
@@ -50,8 +50,7 @@ def extract_timer_from_channel(line, num_channels_already_found):
|
||||
# nxp rt1062 format: initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule0}, IOMUX::Pad::GPIO_B0_06),
|
||||
search = re.search('PWM::(PWM[0-9]+)[_,\)]', line, re.IGNORECASE)
|
||||
if search:
|
||||
# imxrt uses a 1:1 timer group to channel association
|
||||
return str(num_channels_already_found)
|
||||
return search.group(1)
|
||||
|
||||
return None
|
||||
|
||||
@@ -73,14 +72,7 @@ def get_timer_groups(timer_config_file, verbose=False):
|
||||
line = line.strip()
|
||||
if len(line) == 0 or line.startswith('//'):
|
||||
continue
|
||||
timer, timer_type = extract_timer(line)
|
||||
|
||||
if timer_type == 'imxrt':
|
||||
if verbose: print('imxrt timer found')
|
||||
max_num_channels = 16 # Just add a fixed number of timers
|
||||
timers = [str(i) for i in range(max_num_channels)]
|
||||
dshot_support = {str(i): False for i in range(max_num_channels)}
|
||||
break
|
||||
timer = extract_timer(line)
|
||||
|
||||
if timer:
|
||||
if verbose: print('found timer def: {:}'.format(timer))
|
||||
@@ -109,7 +101,7 @@ def get_timer_groups(timer_config_file, verbose=False):
|
||||
continue
|
||||
|
||||
if verbose: print('--'+line+'--')
|
||||
timer = extract_timer_from_channel(line, len(channel_timers))
|
||||
timer = extract_timer_from_channel(line)
|
||||
|
||||
if timer:
|
||||
if verbose: print('Found timer: {:} in channel line {:}'.format(timer, line))
|
||||
|
||||
@@ -1,245 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) 2013-2022 PX4 Pro Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
"""
|
||||
px_generate_uorb_topic_files.py
|
||||
Generates c/cpp header/source files for uorb topics from .msg
|
||||
message files
|
||||
"""
|
||||
|
||||
import os
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
try:
|
||||
import em
|
||||
except ImportError as e:
|
||||
print("Failed to import em: " + str(e))
|
||||
print("")
|
||||
print("You may need to install it using:")
|
||||
print(" pip3 install --user empy")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import genmsg.template_tools
|
||||
except ImportError as e:
|
||||
print("Failed to import genmsg: " + str(e))
|
||||
print("")
|
||||
print("You may need to install it using:")
|
||||
print(" pip3 install --user pyros-genmsg")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
__author__ = "Sergey Belash, Thomas Gubler, Beat Kueng"
|
||||
__copyright__ = "Copyright (C) 2013-2022 PX4 Development Team."
|
||||
__license__ = "BSD"
|
||||
__email__ = "thomasgubler@gmail.com"
|
||||
|
||||
|
||||
TEMPLATE_FILE = ['msg.h.em', 'msg.cpp.em']
|
||||
TOPICS_LIST_TEMPLATE_FILE = ['uORBTopics.hpp.em', 'uORBTopics.cpp.em']
|
||||
OUTPUT_FILE_EXT = ['.h', '.cpp']
|
||||
INCL_DEFAULT = ['std_msgs:./msg/std_msgs']
|
||||
PACKAGE = 'px4'
|
||||
TOPICS_TOKEN = '# TOPICS '
|
||||
|
||||
|
||||
def get_topics(filename):
|
||||
"""
|
||||
Get TOPICS names from a "# TOPICS" line
|
||||
"""
|
||||
ofile = open(filename, 'r')
|
||||
text = ofile.read()
|
||||
result = []
|
||||
for each_line in text.split('\n'):
|
||||
if each_line.startswith(TOPICS_TOKEN):
|
||||
topic_names_str = each_line.strip()
|
||||
topic_names_str = topic_names_str.replace(TOPICS_TOKEN, "")
|
||||
topic_names_list = topic_names_str.split(" ")
|
||||
for topic in topic_names_list:
|
||||
# topic name PascalCase (file name) to snake_case (topic name)
|
||||
topic_name = re.sub(r'(?<!^)(?=[A-Z])', '_', topic).lower()
|
||||
result.append(topic_name)
|
||||
ofile.close()
|
||||
|
||||
if len(result) == 0:
|
||||
# topic name PascalCase (file name) to snake_case (topic name)
|
||||
file_base_name = os.path.basename(filename).replace(".msg", "")
|
||||
topic_name = re.sub(r'(?<!^)(?=[A-Z])', '_', file_base_name).lower()
|
||||
result.append(topic_name)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def generate_output_from_file(format_idx, filename, outputdir, package, templatedir, includepath):
|
||||
"""
|
||||
Converts a single .msg file to an uorb header/source file
|
||||
"""
|
||||
msg_context = genmsg.msg_loader.MsgContext.create_default()
|
||||
full_type_name = genmsg.gentools.compute_full_type_name(package, os.path.basename(filename))
|
||||
|
||||
file_base_name = os.path.basename(filename).replace(".msg", "")
|
||||
|
||||
full_type_name_snake = re.sub(r'(?<!^)(?=[A-Z])', '_', file_base_name).lower()
|
||||
|
||||
spec = genmsg.msg_loader.load_msg_from_file(msg_context, filename, full_type_name)
|
||||
|
||||
field_name_and_type = {}
|
||||
for field in spec.parsed_fields():
|
||||
field_name_and_type.update({field.name: field.type})
|
||||
|
||||
# assert if the timestamp field is of type uint64
|
||||
# try:
|
||||
# assert field_name_and_type.get('timestamp') == 'uint64'
|
||||
# except AssertionError:
|
||||
# print("[ERROR] uORB topic files generator:\n\tgenerate_output_from_file:\t'timestamp' field in " + spec.short_name +
|
||||
# " msg definition is not of type uint64 but rather of type " + field_name_and_type.get('timestamp') + "!")
|
||||
# exit(1)
|
||||
|
||||
topics = get_topics(filename)
|
||||
|
||||
if includepath:
|
||||
search_path = genmsg.command_line.includepath_to_dict(includepath)
|
||||
else:
|
||||
search_path = {}
|
||||
|
||||
genmsg.msg_loader.load_depends(msg_context, spec, search_path)
|
||||
|
||||
em_globals = {
|
||||
"name_snake_case": full_type_name_snake,
|
||||
"file_name_in": filename,
|
||||
"search_path": search_path,
|
||||
"msg_context": msg_context,
|
||||
"spec": spec,
|
||||
"topics": topics,
|
||||
}
|
||||
|
||||
# Make sure output directory exists:
|
||||
if not os.path.isdir(outputdir):
|
||||
os.makedirs(outputdir)
|
||||
|
||||
template_file = os.path.join(templatedir, TEMPLATE_FILE[format_idx])
|
||||
output_file = os.path.join(outputdir, full_type_name_snake + OUTPUT_FILE_EXT[format_idx])
|
||||
|
||||
return generate_by_template(output_file, template_file, em_globals)
|
||||
|
||||
|
||||
def generate_by_template(output_file, template_file, em_globals):
|
||||
"""
|
||||
Invokes empy intepreter to geneate output_file by the
|
||||
given template_file and predefined em_globals dict
|
||||
"""
|
||||
# check if folder exists:
|
||||
folder_name = os.path.dirname(output_file)
|
||||
if not os.path.exists(folder_name):
|
||||
os.makedirs(folder_name)
|
||||
|
||||
ofile = open(output_file, 'w')
|
||||
# todo, reuse interpreter
|
||||
interpreter = em.Interpreter(output=ofile, globals=em_globals, options={
|
||||
em.RAW_OPT: True, em.BUFFERED_OPT: True})
|
||||
try:
|
||||
interpreter.file(open(template_file))
|
||||
except OSError as e:
|
||||
ofile.close()
|
||||
os.remove(output_file)
|
||||
raise
|
||||
interpreter.shutdown()
|
||||
ofile.close()
|
||||
return True
|
||||
|
||||
|
||||
def generate_topics_list_file_from_files(files, outputdir, template_filename, templatedir):
|
||||
# generate cpp file with topics list
|
||||
filenames = []
|
||||
for filename in [os.path.basename(p) for p in files if os.path.basename(p).endswith(".msg")]:
|
||||
filenames.append(re.sub(r'(?<!^)(?=[A-Z])', '_', filename).lower())
|
||||
|
||||
topics = []
|
||||
for msg_filename in files:
|
||||
topics.extend(get_topics(msg_filename))
|
||||
|
||||
tl_globals = {"msgs": filenames, "topics": topics}
|
||||
tl_template_file = os.path.join(templatedir, template_filename)
|
||||
tl_out_file = os.path.join(outputdir, template_filename.replace(".em", ""))
|
||||
|
||||
generate_by_template(tl_out_file, tl_template_file, tl_globals)
|
||||
|
||||
|
||||
def append_to_include_path(path_to_append, curr_include, package):
|
||||
for p in path_to_append:
|
||||
curr_include.append('%s:%s' % (package, p))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='Convert msg files to uorb headers/sources')
|
||||
parser.add_argument('--headers', help='Generate header files', action='store_true')
|
||||
parser.add_argument('--sources', help='Generate source files', action='store_true')
|
||||
parser.add_argument('-f', dest='file',
|
||||
help="files to convert (use only without -d)",
|
||||
nargs="+")
|
||||
parser.add_argument('-i', dest="include_paths",
|
||||
help='Additional Include Paths', nargs="*",
|
||||
default=None)
|
||||
parser.add_argument('-e', dest='templatedir',
|
||||
help='directory with template files',)
|
||||
parser.add_argument('-k', dest='package', default=PACKAGE,
|
||||
help='package name')
|
||||
parser.add_argument('-o', dest='outputdir',
|
||||
help='output directory for header files')
|
||||
parser.add_argument('-p', dest='prefix', default='',
|
||||
help='string added as prefix to the output file '
|
||||
' name when converting directories')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.include_paths:
|
||||
append_to_include_path(args.include_paths, INCL_DEFAULT, args.package)
|
||||
|
||||
if args.headers:
|
||||
generate_idx = 0
|
||||
elif args.sources:
|
||||
generate_idx = 1
|
||||
else:
|
||||
print('Error: either --headers or --sources must be specified')
|
||||
exit(-1)
|
||||
if args.file is not None:
|
||||
for f in args.file:
|
||||
generate_output_from_file(generate_idx, f, args.outputdir, args.package, args.templatedir, INCL_DEFAULT)
|
||||
|
||||
# Generate topics list header and source file
|
||||
if os.path.isfile(os.path.join(args.templatedir, TOPICS_LIST_TEMPLATE_FILE[generate_idx])):
|
||||
generate_topics_list_file_from_files(args.file, args.outputdir, TOPICS_LIST_TEMPLATE_FILE[generate_idx], args.templatedir)
|
||||
@@ -51,9 +51,9 @@ div.frame_variant td, div.frame_variant th {
|
||||
text-align : left;
|
||||
}
|
||||
</style>\n\n"""
|
||||
|
||||
|
||||
type_set = set()
|
||||
|
||||
|
||||
if len(image_path) > 0 and image_path[-1] != '/':
|
||||
image_path = image_path + '/'
|
||||
|
||||
@@ -62,7 +62,7 @@ div.frame_variant td, div.frame_variant th {
|
||||
result += '## %s\n\n' % group.GetClass()
|
||||
type_set.add(group.GetClass())
|
||||
|
||||
result += '### %s\n\n' % group.GetType()
|
||||
result += '### %s\n\n' % group.GetName()
|
||||
|
||||
# Display an image of the frame
|
||||
image_name = group.GetImageName()
|
||||
@@ -73,11 +73,11 @@ div.frame_variant td, div.frame_variant th {
|
||||
# check if all outputs are equal for the group: if so, show them
|
||||
# only once
|
||||
all_outputs = {}
|
||||
num_configs = len(group.GetAirframes())
|
||||
for airframe in group.GetAirframes():
|
||||
if not self.IsExcluded(airframe, board):
|
||||
for output_name in airframe.GetOutputCodes():
|
||||
value = airframe.GetOutputValue(output_name)
|
||||
num_configs = len(group.GetParams())
|
||||
for param in group.GetParams():
|
||||
if not self.IsExcluded(param, board):
|
||||
for output_name in param.GetOutputCodes():
|
||||
value = param.GetOutputValue(output_name)
|
||||
key_value_pair = (output_name, value)
|
||||
if key_value_pair not in all_outputs:
|
||||
all_outputs[key_value_pair] = 0
|
||||
@@ -104,17 +104,18 @@ div.frame_variant td, div.frame_variant th {
|
||||
result += ' </thead>\n'
|
||||
result += '<tbody>\n'
|
||||
|
||||
for airframe in group.GetAirframes():
|
||||
if not self.IsExcluded(airframe, board):
|
||||
name = airframe.GetName()
|
||||
airframe_id = airframe.GetId()
|
||||
for param in group.GetParams():
|
||||
if not self.IsExcluded(param, board):
|
||||
#print("generating: {0} {1}".format(param.GetName(), excluded))
|
||||
name = param.GetName()
|
||||
airframe_id = param.GetId()
|
||||
airframe_id_entry = '<p><code>SYS_AUTOSTART</code> = %s</p>' % (airframe_id)
|
||||
maintainer = airframe.GetMaintainer()
|
||||
maintainer = param.GetMaintainer()
|
||||
maintainer_entry = ''
|
||||
if maintainer != '':
|
||||
maintainer_entry = 'Maintainer: %s' % (html.escape(maintainer))
|
||||
url = airframe.GetFieldValue('url')
|
||||
name_anchor='%s_%s_%s' % (group.GetClass(),group.GetType(),name)
|
||||
url = param.GetFieldValue('url')
|
||||
name_anchor='%s_%s_%s' % (group.GetClass(),group.GetName(),name)
|
||||
name_anchor=name_anchor.replace(' ','_').lower()
|
||||
name_anchor=name_anchor.replace('"','_').lower()
|
||||
name_anchor='id="%s"' % name_anchor
|
||||
@@ -123,8 +124,8 @@ div.frame_variant td, div.frame_variant th {
|
||||
name_entry = '<a href="%s">%s</a>' % (url, name)
|
||||
outputs = '<ul>'
|
||||
has_outputs = False
|
||||
for output_name in airframe.GetOutputCodes():
|
||||
value = airframe.GetOutputValue(output_name)
|
||||
for output_name in param.GetOutputCodes():
|
||||
value = param.GetOutputValue(output_name)
|
||||
valstrs = value.split(";")
|
||||
key_value_pair = (output_name, value)
|
||||
if all_outputs[key_value_pair] < num_configs:
|
||||
@@ -151,9 +152,9 @@ div.frame_variant td, div.frame_variant th {
|
||||
|
||||
self.output = result
|
||||
|
||||
def IsExcluded(self, airframe, board):
|
||||
for code in airframe.GetArchCodes():
|
||||
if "CONFIG_ARCH_BOARD_{0}".format(code) == board and airframe.GetArchValue(code) == "exclude":
|
||||
def IsExcluded(self, param, board):
|
||||
for code in param.GetArchCodes():
|
||||
if "CONFIG_ARCH_BOARD_{0}".format(code) == board and param.GetArchValue(code) == "exclude":
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ import codecs
|
||||
import os
|
||||
|
||||
class RCOutput():
|
||||
"""
|
||||
Generates RC scripts for the airframes
|
||||
"""
|
||||
def __init__(self, groups, board, post_start=False):
|
||||
|
||||
result = ( "#\n"
|
||||
@@ -37,33 +34,33 @@ class RCOutput():
|
||||
result += "set AIRFRAME none\n"
|
||||
result += "\n"
|
||||
for group in groups:
|
||||
result += "# GROUP: %s\n\n" % group.GetType()
|
||||
for airframe in group.GetAirframes():
|
||||
result += "# GROUP: %s\n\n" % group.GetName()
|
||||
for param in group.GetParams():
|
||||
excluded = False
|
||||
for code in airframe.GetArchCodes():
|
||||
if "{0}".format(code) == board and airframe.GetArchValue(code) == "exclude":
|
||||
for code in param.GetArchCodes():
|
||||
if "{0}".format(code) == board and param.GetArchValue(code) == "exclude":
|
||||
excluded = True
|
||||
if excluded:
|
||||
continue
|
||||
|
||||
if post_start:
|
||||
# Path to post-start sript
|
||||
path = airframe.GetPostPath()
|
||||
path = param.GetPostPath()
|
||||
else:
|
||||
# Path to start script
|
||||
path = airframe.GetPath()
|
||||
path = param.GetPath()
|
||||
|
||||
if not path:
|
||||
continue
|
||||
|
||||
path = os.path.split(path)[1]
|
||||
|
||||
id_val = airframe.GetId()
|
||||
name = airframe.GetFieldValue("short_desc")
|
||||
long_desc = airframe.GetFieldValue("long_desc")
|
||||
id_val = param.GetId()
|
||||
name = param.GetFieldValue("short_desc")
|
||||
long_desc = param.GetFieldValue("long_desc")
|
||||
|
||||
result += "#\n"
|
||||
result += "# %s\n" % airframe.GetName()
|
||||
result += "# %s\n" % param.GetName()
|
||||
result += "if param compare SYS_AUTOSTART %s\n" % id_val
|
||||
result += "then\n"
|
||||
result += "\tset AIRFRAME %s\n" % path
|
||||
|
||||
@@ -2,38 +2,31 @@ import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
class AirframeGroup(object):
|
||||
class ParameterGroup(object):
|
||||
"""
|
||||
Airframe group
|
||||
|
||||
type: specific vehicle type (e.g. VTOL Tiltrotor, VTOL Quadrotor, etc.)
|
||||
class: vehicle class (e.g. Multicopter, Fixed Wing, etc.)
|
||||
Single parameter group
|
||||
"""
|
||||
def __init__(self, type, af_class):
|
||||
self.type = type
|
||||
def __init__(self, name, af_class):
|
||||
self.name = name
|
||||
self.af_class = af_class
|
||||
self.airframes = []
|
||||
self.params = []
|
||||
|
||||
|
||||
def AddAirframe(self, airframe):
|
||||
def AddParameter(self, param):
|
||||
"""
|
||||
Add airframe to the airframe group
|
||||
Add parameter to the group
|
||||
"""
|
||||
self.airframes.append(airframe)
|
||||
self.params.append(param)
|
||||
|
||||
def GetType(self):
|
||||
def GetName(self):
|
||||
"""
|
||||
Get airframe group's vehicle type
|
||||
|
||||
e.g. VTOL Tiltrotor, VTOL Quadrotor, etc.
|
||||
Get parameter group name
|
||||
"""
|
||||
return self.type
|
||||
return self.name
|
||||
|
||||
def GetClass(self):
|
||||
"""
|
||||
Get airframe group's vehicle class
|
||||
|
||||
e.g. Multicopter, Fixed Wing, etc.
|
||||
Get parameter group vehicle type.
|
||||
"""
|
||||
return self.af_class
|
||||
|
||||
@@ -41,84 +34,86 @@ class AirframeGroup(object):
|
||||
"""
|
||||
Get parameter group image base name (w/o extension)
|
||||
"""
|
||||
if (self.type == "Standard Plane"):
|
||||
if (self.name == "Standard Plane"):
|
||||
return "Plane"
|
||||
elif (self.type == "Flying Wing"):
|
||||
elif (self.name == "Flying Wing"):
|
||||
return "FlyingWing"
|
||||
elif (self.type == "Quadrotor x"):
|
||||
elif (self.name == "Quadrotor x"):
|
||||
return "QuadRotorX"
|
||||
elif (self.type == "Quadrotor +"):
|
||||
elif (self.name == "Quadrotor +"):
|
||||
return "QuadRotorPlus"
|
||||
elif (self.type == "Hexarotor x"):
|
||||
elif (self.name == "Hexarotor x"):
|
||||
return "HexaRotorX"
|
||||
elif (self.type == "Hexarotor +"):
|
||||
elif (self.name == "Hexarotor +"):
|
||||
return "HexaRotorPlus"
|
||||
elif (self.type == "Octorotor +"):
|
||||
elif (self.name == "Octorotor +"):
|
||||
return "OctoRotorPlus"
|
||||
elif (self.type == "Octorotor x"):
|
||||
elif (self.name == "Octorotor x"):
|
||||
return "OctoRotorX"
|
||||
elif (self.type == "Octorotor Coaxial"):
|
||||
elif (self.name == "Octorotor Coaxial"):
|
||||
return "OctoRotorXCoaxial"
|
||||
elif (self.type == "Octo Coax Wide"):
|
||||
elif (self.name == "Octo Coax Wide"):
|
||||
return "OctoRotorXCoaxial"
|
||||
elif (self.type == "Quadrotor Wide"):
|
||||
elif (self.name == "Quadrotor Wide"):
|
||||
return "QuadRotorWide"
|
||||
elif (self.type == "Quadrotor H"):
|
||||
elif (self.name == "Quadrotor H"):
|
||||
return "QuadRotorH"
|
||||
elif (self.type == "Dodecarotor cox"):
|
||||
elif (self.name == "Dodecarotor cox"):
|
||||
return "DodecaRotorXCoaxial"
|
||||
elif (self.type == "Simulation"):
|
||||
elif (self.name == "Simulation"):
|
||||
return "AirframeSimulation"
|
||||
elif (self.type == "Plane A-Tail"):
|
||||
elif (self.name == "Plane A-Tail"):
|
||||
return "PlaneATail"
|
||||
elif (self.type == "Plane V-Tail"):
|
||||
elif (self.name == "Plane V-Tail"):
|
||||
return "PlaneVTail"
|
||||
elif (self.type == "VTOL Duo Tailsitter"):
|
||||
elif (self.name == "VTOL Duo Tailsitter"):
|
||||
return "VTOLDuoRotorTailSitter"
|
||||
elif (self.type == "Standard VTOL"):
|
||||
elif (self.name == "Standard VTOL"):
|
||||
return "VTOLPlane"
|
||||
elif (self.type == "VTOL Quad Tailsitter"):
|
||||
elif (self.name == "VTOL Quad Tailsitter"):
|
||||
return "VTOLQuadRotorTailSitter"
|
||||
elif (self.type == "VTOL Tiltrotor"):
|
||||
elif (self.name == "VTOL Tiltrotor"):
|
||||
return "VTOLTiltRotor"
|
||||
elif (self.type == "VTOL Octoplane"):
|
||||
elif (self.name == "VTOL Octoplane"):
|
||||
return "VTOLPlaneOcto"
|
||||
elif (self.type == "Coaxial Helicopter"):
|
||||
elif (self.name == "Coaxial Helicopter"):
|
||||
return "HelicopterCoaxial"
|
||||
elif (self.type == "Helicopter"):
|
||||
elif (self.name == "Helicopter"):
|
||||
return "Helicopter"
|
||||
elif (self.type == "Hexarotor Coaxial"):
|
||||
elif (self.name == "Hexarotor Coaxial"):
|
||||
return "Y6B"
|
||||
elif (self.type == "Y6A"):
|
||||
elif (self.name == "Y6A"):
|
||||
return "Y6A"
|
||||
elif (self.type == "Tricopter Y-"):
|
||||
elif (self.name == "Tricopter Y-"):
|
||||
return "YMinus"
|
||||
elif (self.type == "Tricopter Y+"):
|
||||
elif (self.name == "Tricopter Y+"):
|
||||
return "YPlus"
|
||||
elif (self.type == "Autogyro"):
|
||||
elif (self.name == "Autogyro"):
|
||||
return "Autogyro"
|
||||
elif (self.type == "Airship"):
|
||||
elif (self.name == "Airship"):
|
||||
return "Airship"
|
||||
elif (self.type == "Rover"):
|
||||
elif (self.name == "Rover"):
|
||||
return "Rover"
|
||||
elif (self.type == "Boat"):
|
||||
elif (self.name == "Boat"):
|
||||
return "Boat"
|
||||
elif (self.type == "Balloon"):
|
||||
elif (self.name == "Balloon"):
|
||||
return "Balloon"
|
||||
elif (self.type == "Vectored 6 DOF UUV"):
|
||||
elif (self.name == "Vectored 6 DOF UUV"):
|
||||
return "Vectored6DofUUV"
|
||||
return "AirframeUnknown"
|
||||
|
||||
def GetAirframes(self):
|
||||
def GetParams(self):
|
||||
"""
|
||||
Returns the parsed list of airframes objects. Note that returned
|
||||
object is not a copy. Modifications affect state of the parser.
|
||||
Returns the parsed list of parameters. Every parameter is a Parameter
|
||||
object. Note that returned object is not a copy. Modifications affect
|
||||
state of the parser.
|
||||
"""
|
||||
return sorted(self.airframes, key=lambda x: x.GetId())
|
||||
|
||||
class Airframe(object):
|
||||
return sorted(self.params, key=lambda x: x.GetId())
|
||||
|
||||
class Parameter(object):
|
||||
"""
|
||||
Single Airframe definition
|
||||
Single parameter
|
||||
"""
|
||||
|
||||
# Define sorting order of the fields
|
||||
@@ -293,7 +288,7 @@ class SourceParser(object):
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.airframe_groups = {}
|
||||
self.param_groups = {}
|
||||
|
||||
def GetSupportedExtensions(self):
|
||||
"""
|
||||
@@ -352,10 +347,10 @@ class SourceParser(object):
|
||||
tag, desc = m.group(1, 2)
|
||||
if (tag == "output"):
|
||||
key, text = desc.split(' ', 1)
|
||||
outputs[key] = text
|
||||
outputs[key] = text;
|
||||
elif (tag == "board"):
|
||||
key, text = desc.split(' ', 1)
|
||||
archs[key] = text
|
||||
archs[key] = text;
|
||||
else:
|
||||
tags[tag] = desc
|
||||
current_tag = tag
|
||||
@@ -432,7 +427,7 @@ class SourceParser(object):
|
||||
post_path = None
|
||||
|
||||
# We already know this is an airframe config, so add it
|
||||
airframe = Airframe(path, post_path, airframe_name, airframe_type, airframe_class, airframe_id, maintainer)
|
||||
param = Parameter(path, post_path, airframe_name, airframe_type, airframe_class, airframe_id, maintainer)
|
||||
|
||||
# Done with file, store
|
||||
for tag in tags:
|
||||
@@ -445,24 +440,24 @@ class SourceParser(object):
|
||||
if tag == "name":
|
||||
airframe_name = tags[tag]
|
||||
else:
|
||||
airframe.SetField(tag, tags[tag])
|
||||
param.SetField(tag, tags[tag])
|
||||
|
||||
# Store outputs
|
||||
for output in outputs:
|
||||
airframe.SetOutput(output, outputs[output])
|
||||
param.SetOutput(output, outputs[output])
|
||||
|
||||
# Store outputs
|
||||
for arch in archs:
|
||||
airframe.SetArch(arch, archs[arch])
|
||||
param.SetArch(arch, archs[arch])
|
||||
|
||||
# Store the parameter
|
||||
|
||||
# Create a class-specific airframe group. This is needed to catch cases where an airframe type might cross classes (e.g. simulation)
|
||||
class_group_identifier=airframe_type + airframe_class
|
||||
if class_group_identifier not in self.airframe_groups:
|
||||
#self.airframe_groups[airframe_type] = ParameterGroup(airframe_type) #HW TEST REMOVE
|
||||
self.airframe_groups[class_group_identifier] = AirframeGroup(airframe_type, airframe_class)
|
||||
self.airframe_groups[class_group_identifier].AddAirframe(airframe)
|
||||
class_group_identifier=airframe_type+airframe_class
|
||||
if class_group_identifier not in self.param_groups:
|
||||
#self.param_groups[airframe_type] = ParameterGroup(airframe_type) #HW TEST REMOVE
|
||||
self.param_groups[class_group_identifier] = ParameterGroup(airframe_type, airframe_class)
|
||||
self.param_groups[class_group_identifier].AddParameter(param)
|
||||
|
||||
return True
|
||||
|
||||
@@ -478,8 +473,8 @@ class SourceParser(object):
|
||||
Validates the airframe meta data.
|
||||
"""
|
||||
seenParamNames = []
|
||||
for group in self.GetAirframeGroups():
|
||||
for param in group.GetAirframes():
|
||||
for group in self.GetParamGroups():
|
||||
for param in group.GetParams():
|
||||
name = param.GetName()
|
||||
board = param.GetFieldValue("board")
|
||||
# Check for duplicates
|
||||
@@ -492,27 +487,27 @@ class SourceParser(object):
|
||||
|
||||
return True
|
||||
|
||||
def GetAirframeGroups(self):
|
||||
def GetParamGroups(self):
|
||||
"""
|
||||
Returns the parsed list of Airframe groups. Every Airframe is an Airframe
|
||||
Returns the parsed list of parameters. Every parameter is a Parameter
|
||||
object. Note that returned object is not a copy. Modifications affect
|
||||
state of the parser.
|
||||
"""
|
||||
groups = self.airframe_groups.values()
|
||||
groups = sorted(groups, key=lambda x: x.GetType())
|
||||
groups = self.param_groups.values()
|
||||
groups = sorted(groups, key=lambda x: x.GetName())
|
||||
groups = sorted(groups, key=lambda x: x.GetClass())
|
||||
groups = sorted(groups, key=lambda x: self.priority.get(x.GetType(), 0), reverse=True)
|
||||
groups = sorted(groups, key=lambda x: self.priority.get(x.GetName(), 0), reverse=True)
|
||||
|
||||
#Rename duplicate groups to include the class (creating unique headings in page TOC)
|
||||
duplicate_test=set()
|
||||
duplicate_set=set()
|
||||
for group in groups:
|
||||
if group.GetType() in duplicate_test:
|
||||
duplicate_set.add(group.GetType())
|
||||
if group.GetName() in duplicate_test:
|
||||
duplicate_set.add(group.GetName())
|
||||
else:
|
||||
duplicate_test.add(group.GetType() )
|
||||
duplicate_test.add(group.GetName() )
|
||||
for group in groups:
|
||||
if group.GetType() in duplicate_set:
|
||||
group.name=group.GetType()+' (%s)' % group.GetClass()
|
||||
if group.GetName() in duplicate_set:
|
||||
group.name=group.GetName()+' (%s)' % group.GetClass()
|
||||
|
||||
return groups
|
||||
|
||||
@@ -28,28 +28,28 @@ class XMLOutput():
|
||||
xml_version.text = "1"
|
||||
for group in groups:
|
||||
xml_group = ET.SubElement(xml_parameters, "airframe_group")
|
||||
xml_group.attrib["name"] = group.GetType()
|
||||
xml_group.attrib["name"] = group.GetName()
|
||||
xml_group.attrib["image"] = group.GetImageName()
|
||||
for airframe in group.GetAirframes():
|
||||
for param in group.GetParams():
|
||||
|
||||
# check if there is an exclude tag for this airframe
|
||||
excluded = False
|
||||
for code in airframe.GetArchCodes():
|
||||
if "CONFIG_ARCH_BOARD_{0}".format(code) == board and airframe.GetArchValue(code) == "exclude":
|
||||
for code in param.GetArchCodes():
|
||||
if "CONFIG_ARCH_BOARD_{0}".format(code) == board and param.GetArchValue(code) == "exclude":
|
||||
excluded = True
|
||||
|
||||
if not excluded:
|
||||
#print("generating: {0} {1}".format(airframe.GetName(), excluded))
|
||||
#print("generating: {0} {1}".format(param.GetName(), excluded))
|
||||
xml_param = ET.SubElement(xml_group, "airframe")
|
||||
xml_param.attrib["name"] = airframe.GetName()
|
||||
xml_param.attrib["id"] = airframe.GetId()
|
||||
xml_param.attrib["maintainer"] = airframe.GetMaintainer()
|
||||
for code in airframe.GetFieldCodes():
|
||||
value = airframe.GetFieldValue(code)
|
||||
xml_param.attrib["name"] = param.GetName()
|
||||
xml_param.attrib["id"] = param.GetId()
|
||||
xml_param.attrib["maintainer"] = param.GetMaintainer()
|
||||
for code in param.GetFieldCodes():
|
||||
value = param.GetFieldValue(code)
|
||||
xml_field = ET.SubElement(xml_param, code)
|
||||
xml_field.text = value
|
||||
for code in airframe.GetOutputCodes():
|
||||
value = airframe.GetOutputValue(code)
|
||||
for code in param.GetOutputCodes():
|
||||
value = param.GetOutputValue(code)
|
||||
valstrs = value.split(";")
|
||||
xml_field = ET.SubElement(xml_param, "output")
|
||||
xml_field.attrib["name"] = code
|
||||
|
||||
@@ -92,7 +92,7 @@ class SourceParser(object):
|
||||
re_comment_start = re.compile(r'^\/\*\s*EVENT$')
|
||||
re_events_send = re.compile(r'^events::send[<\(]')
|
||||
re_comment_content = re.compile(r'^\*\s*(.*)')
|
||||
re_comment_tag = re.compile(r'^@([a-zA-Z][a-zA-Z0-9_-]*):?\s*(.*)')
|
||||
re_comment_tag = re.compile(r'^@([a-zA-Z][a-zA-Z0-9_]*):?\s*(.*)')
|
||||
re_comment_end = re.compile(r'(.*?)\s*\*\/$')
|
||||
re_code_end = re.compile(r'(.*?)\s*;$')
|
||||
re_template_args = re.compile(r'([a-zA-Z0-9_:\.]+)\s*<([a-zA-Z0-9_,\s:]+)\s*>\s*\((.*)\);$')
|
||||
@@ -107,7 +107,7 @@ class SourceParser(object):
|
||||
""" dict of 'group': [Event] list """
|
||||
return self._events
|
||||
|
||||
def Parse(self, contents, path):
|
||||
def Parse(self, contents):
|
||||
"""
|
||||
Incrementally parse program contents and append all found events
|
||||
to the list.
|
||||
@@ -117,7 +117,7 @@ class SourceParser(object):
|
||||
# names.
|
||||
state = None
|
||||
def finalize_current_tag(event, tag, value):
|
||||
if tag is None: return True
|
||||
if tag is None: return
|
||||
if tag == "description":
|
||||
descr = value.strip()
|
||||
# merge continued lines (but not e.g. enumerations)
|
||||
@@ -133,9 +133,6 @@ class SourceParser(object):
|
||||
"If this is not a typo, add the new group to the script".format(event.group, known_groups))
|
||||
elif tag == "type":
|
||||
event.type = value.strip()
|
||||
elif tag == "skip-file":
|
||||
print("Skipping file: {:}".format(path))
|
||||
return False
|
||||
elif tag.startswith("arg"):
|
||||
arg_index = int(tag[3:])-1
|
||||
arg_name = value.strip()
|
||||
@@ -143,7 +140,6 @@ class SourceParser(object):
|
||||
event.add_argument(None, arg_name)
|
||||
else:
|
||||
raise Exception("Invalid tag: {}\nvalue: {}".format(tag, value))
|
||||
return True
|
||||
|
||||
for line in self.re_split_lines.split(contents):
|
||||
line = line.strip()
|
||||
@@ -211,11 +207,6 @@ class SourceParser(object):
|
||||
|
||||
ignore_event = False
|
||||
|
||||
def parse_message(s):
|
||||
assert s[0] == '"', "Argument must be a string literal: {:}".format(s)
|
||||
# unescape \x, to treat the string the same as the C++ compiler
|
||||
return s[1:-1].encode("utf-8").decode('unicode_escape')
|
||||
|
||||
# extract function arguments
|
||||
args_split = self._parse_arguments(args)
|
||||
if call == "events::send" or call == "send":
|
||||
@@ -233,7 +224,8 @@ class SourceParser(object):
|
||||
else:
|
||||
raise Exception("Could not extract event ID from {:}".format(args_split[0]))
|
||||
event.name = event_name
|
||||
event.message = parse_message(args_split[2])
|
||||
# unescape \x, to treat the string the same as the C++ compiler
|
||||
event.message = args_split[2][1:-1].encode("utf-8").decode('unicode_escape')
|
||||
elif call in ['reporter.healthFailure', 'reporter.armingCheckFailure']:
|
||||
assert len(args_split) == num_args + 5, \
|
||||
"Unexpected Number of arguments for: {:}, {:}".format(args_split, num_args)
|
||||
@@ -243,7 +235,7 @@ class SourceParser(object):
|
||||
else:
|
||||
raise Exception("Could not extract event ID from {:}".format(args_split[2]))
|
||||
event.name = event_name
|
||||
event.message = parse_message(args_split[4])
|
||||
event.message = args_split[4][1:-1]
|
||||
if 'health' in call:
|
||||
event.group = "health"
|
||||
else:
|
||||
@@ -275,8 +267,7 @@ class SourceParser(object):
|
||||
comment_content = m.group(1)
|
||||
m = self.re_comment_tag.match(comment_content)
|
||||
if m:
|
||||
if not finalize_current_tag(event, current_tag, current_value):
|
||||
return True # skip file
|
||||
finalize_current_tag(event, current_tag, current_value)
|
||||
current_tag, current_value = m.group(1, 2)
|
||||
elif current_tag is not None:
|
||||
current_value += "\n"+comment_content
|
||||
@@ -286,8 +277,7 @@ class SourceParser(object):
|
||||
# "*" or "*/".
|
||||
raise Exception("Excpected a comment, got '{}'".format(line))
|
||||
if last_comment_line:
|
||||
if not finalize_current_tag(event, current_tag, current_value):
|
||||
return True # skip file
|
||||
finalize_current_tag(event, current_tag, current_value)
|
||||
state = "parse-command"
|
||||
return True
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class SourceScanner(object):
|
||||
print('Failed reading file: %s, skipping content.' % path)
|
||||
pass
|
||||
try:
|
||||
return parser.Parse(contents, path)
|
||||
return parser.Parse(contents)
|
||||
except Exception as e:
|
||||
print("Exception while parsing file {}".format(path))
|
||||
raise
|
||||
|
||||
@@ -35,11 +35,12 @@
|
||||
#
|
||||
# PX4 airframe config processor (main executable file)
|
||||
#
|
||||
# This tool scans the PX4 ROMFS directory for declarations of airframes
|
||||
# This tool scans the PX4 ROMFS code for declarations of airframes
|
||||
#
|
||||
# Currently supported formats are:
|
||||
# * XML for the parametric UI generator
|
||||
# * Markdown for the PX4 dev guide (https://github.com/PX4/Devguide)
|
||||
#
|
||||
# Currently supported output formats are:
|
||||
# * XML for the parametric UI generator (Used in QGC)
|
||||
# * Markdown for the PX4 User guide (https://github.com/PX4/PX4-user_guide)
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
@@ -103,31 +104,31 @@ def main():
|
||||
# We can't validate yet
|
||||
# if not parser.Validate():
|
||||
# sys.exit(1)
|
||||
airframe_groups = parser.GetAirframeGroups()
|
||||
param_groups = parser.GetParamGroups()
|
||||
|
||||
# Output to XML file
|
||||
if args.xml:
|
||||
if args.verbose: print("Creating XML file " + args.xml)
|
||||
out = xmlout.XMLOutput(airframe_groups, args.board)
|
||||
out = xmlout.XMLOutput(param_groups, args.board)
|
||||
out.Save(args.xml)
|
||||
|
||||
# Output to markdown file
|
||||
if args.markdown:
|
||||
if args.verbose: print("Creating markdown file " + args.markdown)
|
||||
out = markdownout.MarkdownTablesOutput(airframe_groups, args.board, args.image_path)
|
||||
out = markdownout.MarkdownTablesOutput(param_groups, args.board, args.image_path)
|
||||
out.Save(args.markdown)
|
||||
|
||||
# Output to start scripts
|
||||
if args.start_script:
|
||||
# Airframe start script
|
||||
if args.verbose: print("Creating start script " + args.start_script)
|
||||
out = rcout.RCOutput(airframe_groups, args.board)
|
||||
out = rcout.RCOutput(param_groups, args.board)
|
||||
out.Save(args.start_script)
|
||||
|
||||
# Airframe post-start script
|
||||
post_start_script = args.start_script + '.post'
|
||||
if args.verbose: print("Creating post-start script " + post_start_script)
|
||||
out_post = rcout.RCOutput(airframe_groups, args.board, post_start=True)
|
||||
out_post = rcout.RCOutput(param_groups, args.board, post_start=True)
|
||||
out_post.Save(post_start_script)
|
||||
|
||||
if (args.verbose): print("All done!")
|
||||
|
||||
@@ -77,23 +77,11 @@ except ImportError as e:
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Define time to use time.time() by default
|
||||
def _time():
|
||||
return time.time()
|
||||
|
||||
# Detect python version
|
||||
if sys.version_info[0] < 3:
|
||||
runningPython3 = False
|
||||
else:
|
||||
runningPython3 = True
|
||||
if sys.version_info[1] >=3:
|
||||
# redefine to use monotonic time when available
|
||||
def _time():
|
||||
try:
|
||||
return time.monotonic()
|
||||
except Exception:
|
||||
return time.time()
|
||||
|
||||
class FirmwareNotSuitableException(Exception):
|
||||
def __init__(self, message):
|
||||
@@ -242,7 +230,7 @@ class uploader(object):
|
||||
|
||||
def open(self):
|
||||
# upload timeout
|
||||
timeout = _time() + 0.2
|
||||
timeout = time.time() + 0.2
|
||||
|
||||
# attempt to open the port while it exists and until timeout occurs
|
||||
while self.port is not None:
|
||||
@@ -252,7 +240,7 @@ class uploader(object):
|
||||
except AttributeError:
|
||||
portopen = self.port.isOpen()
|
||||
|
||||
if not portopen and _time() < timeout:
|
||||
if not portopen and time.time() < timeout:
|
||||
try:
|
||||
self.port.open()
|
||||
except OSError:
|
||||
@@ -427,16 +415,16 @@ class uploader(object):
|
||||
uploader.EOC)
|
||||
|
||||
# erase is very slow, give it 30s
|
||||
deadline = _time() + 30.0
|
||||
while _time() < deadline:
|
||||
deadline = time.time() + 30.0
|
||||
while time.time() < deadline:
|
||||
|
||||
usualEraseDuration = 15.0
|
||||
estimatedTimeRemaining = deadline-_time()
|
||||
estimatedTimeRemaining = deadline-time.time()
|
||||
if estimatedTimeRemaining >= usualEraseDuration:
|
||||
self.__drawProgressBar(label, 30.0-estimatedTimeRemaining, usualEraseDuration)
|
||||
else:
|
||||
self.__drawProgressBar(label, 10.0, 10.0)
|
||||
sys.stdout.write(" (timeout: %d seconds) " % int(deadline-_time()))
|
||||
sys.stdout.write(" (timeout: %d seconds) " % int(deadline-time.time()))
|
||||
sys.stdout.flush()
|
||||
|
||||
if self.__trySync():
|
||||
@@ -582,37 +570,9 @@ class uploader(object):
|
||||
self.fw_maxsize = self.__getInfo(uploader.INFO_FLASH_SIZE)
|
||||
|
||||
# upload the firmware
|
||||
def upload(self, fw_list, force=False, boot_delay=None, boot_check=False):
|
||||
# select correct binary
|
||||
found_suitable_firmware = False
|
||||
for file in fw_list:
|
||||
fw = firmware(file)
|
||||
if self.board_type == fw.property('board_id'):
|
||||
if len(fw_list) > 1: print("using firmware binary {}".format(file))
|
||||
found_suitable_firmware = True
|
||||
break
|
||||
|
||||
if not found_suitable_firmware:
|
||||
msg = "Firmware not suitable for this board (Firmware board_type=%u board_id=%u)" % (
|
||||
self.board_type, fw.property('board_id'))
|
||||
print("WARNING: %s" % msg)
|
||||
if force:
|
||||
if len(fw_list) > 1:
|
||||
raise FirmwareNotSuitableException("force flashing failed, more than one file provided, none suitable")
|
||||
print("FORCED WRITE, FLASHING ANYWAY!")
|
||||
else:
|
||||
raise FirmwareNotSuitableException(msg)
|
||||
|
||||
percent = fw.property('image_size') / fw.property('image_maxsize')
|
||||
binary_size = float(fw.property('image_size'))
|
||||
binary_max_size = float(fw.property('image_maxsize'))
|
||||
percent = (binary_size / binary_max_size) * 100
|
||||
|
||||
print("Loaded firmware for board id: %s,%s size: %d bytes (%.2f%%) " % (fw.property('board_id'), fw.property('board_revision'), fw.property('image_size'), percent))
|
||||
print()
|
||||
|
||||
def upload(self, fw, force=False, boot_delay=None):
|
||||
# Make sure we are doing the right thing
|
||||
start = _time()
|
||||
start = time.time()
|
||||
if self.board_type != fw.property('board_id'):
|
||||
msg = "Firmware not suitable for this board (Firmware board_type=%u board_id=%u)" % (
|
||||
self.board_type, fw.property('board_id'))
|
||||
@@ -708,7 +668,7 @@ class uploader(object):
|
||||
print("\nRebooting.", end='')
|
||||
self.__reboot()
|
||||
self.port.close()
|
||||
print(" Elapsed Time %3.3f\n" % (_time() - start))
|
||||
print(" Elapsed Time %3.3f\n" % (time.time() - start))
|
||||
|
||||
def __next_baud_flightstack(self):
|
||||
if self.baudrate_flightstack_idx + 1 >= len(self.baudrate_flightstack):
|
||||
@@ -792,7 +752,7 @@ def main():
|
||||
parser.add_argument('--force', action='store_true', default=False, help='Override board type check, or silicon errata checks and continue loading')
|
||||
parser.add_argument('--boot-delay', type=int, default=None, help='minimum boot delay to store in flash')
|
||||
parser.add_argument('--use-protocol-splitter-format', action='store_true', help='use protocol splitter format for reboot')
|
||||
parser.add_argument('firmware', action="store", nargs='+', help="Firmware file(s)")
|
||||
parser.add_argument('firmware', action="store", help="Firmware file to be uploaded")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.use_protocol_splitter_format:
|
||||
@@ -804,7 +764,17 @@ def main():
|
||||
print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)")
|
||||
print("==========================================================================================================")
|
||||
|
||||
print("Waiting for bootloader...")
|
||||
# Load the firmware file
|
||||
fw = firmware(args.firmware)
|
||||
|
||||
percent = fw.property('image_size') / fw.property('image_maxsize')
|
||||
binary_size = float(fw.property('image_size'))
|
||||
binary_max_size = float(fw.property('image_maxsize'))
|
||||
percent = (binary_size / binary_max_size) * 100
|
||||
|
||||
print("Loaded firmware for board id: %s,%s size: %d bytes (%.2f%%), waiting for the bootloader..." % (fw.property('board_id'), fw.property('board_revision'), fw.property('image_size'), percent))
|
||||
print()
|
||||
|
||||
# tell any GCS that might be connected to the autopilot to give up
|
||||
# control of the serial port
|
||||
|
||||
@@ -907,7 +877,7 @@ def main():
|
||||
|
||||
try:
|
||||
# ok, we have a bootloader, try flashing it
|
||||
up.upload(args.firmware, force=args.force, boot_delay=args.boot_delay)
|
||||
up.upload(fw, force=args.force, boot_delay=args.boot_delay)
|
||||
|
||||
# if we made this far without raising exceptions, the upload was successful
|
||||
successful = True
|
||||
|
||||
@@ -136,9 +136,9 @@ serial_ports = {
|
||||
"default_baudrate": 1, # set default to an unusable value to detect that this serial port has not been configured
|
||||
},
|
||||
|
||||
# EXT2
|
||||
"EXT2": {
|
||||
"label": "EXT2",
|
||||
# Pixhawk Payload Bus
|
||||
"PPB": {
|
||||
"label": "Pixhawk Payload Bus",
|
||||
"index": 401,
|
||||
"default_baudrate": 57600,
|
||||
},
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
## - jMAVSim simulator (omit with arg: --no-sim-tools)
|
||||
## - Gazebo simulator (not by default, use --gazebo)
|
||||
##
|
||||
## Not Installs:
|
||||
## - FastRTPS and FastCDR
|
||||
|
||||
INSTALL_NUTTX="true"
|
||||
INSTALL_SIM="true"
|
||||
@@ -120,7 +122,7 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
echo
|
||||
echo "Installing PX4 simulation dependencies"
|
||||
|
||||
# java (jmavsim)
|
||||
# java (jmavsim or fastrtps)
|
||||
sudo pacman -S --noconfirm --needed \
|
||||
ant \
|
||||
jdk-openjdk \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
## Bash script to setup PX4 development environment on Ubuntu LTS (22.04, 20.04, 18.04).
|
||||
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04, 16.04).
|
||||
## Can also be used in docker.
|
||||
##
|
||||
## Installs:
|
||||
@@ -10,11 +10,12 @@ set -e
|
||||
## - NuttX toolchain (omit with arg: --no-nuttx)
|
||||
## - jMAVSim and Gazebo9 simulator (omit with arg: --no-sim-tools)
|
||||
##
|
||||
## Not Installs:
|
||||
## - FastRTPS and FastCDR
|
||||
|
||||
INSTALL_NUTTX="true"
|
||||
INSTALL_SIM="true"
|
||||
INSTALL_ARCH=`uname -m`
|
||||
INSTALL_SIM_JAMMY="false"
|
||||
|
||||
# Parse arguments
|
||||
for arg in "$@"
|
||||
@@ -27,10 +28,6 @@ do
|
||||
INSTALL_SIM="false"
|
||||
fi
|
||||
|
||||
if [[ $arg == "--sim_jammy" ]]; then
|
||||
INSTALL_SIM_JAMMY="true"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# detect if running in docker
|
||||
@@ -70,10 +67,6 @@ elif [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
||||
echo "Ubuntu 18.04"
|
||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
echo "Ubuntu 20.04"
|
||||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
||||
echo "Ubuntu 22.04, simulation build off by default."
|
||||
echo "Use --sim_jammy to enable simulation build."
|
||||
INSTALL_SIM=$INSTALL_SIM_JAMMY
|
||||
fi
|
||||
|
||||
|
||||
@@ -153,7 +146,7 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
util-linux \
|
||||
vim-common \
|
||||
;
|
||||
if [[ "${UBUNTU_RELEASE}" == "20.04" || "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
||||
if [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
kconfig-frontends \
|
||||
;
|
||||
@@ -214,7 +207,7 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
else
|
||||
java_version=14
|
||||
fi
|
||||
# Java (jmavsim)
|
||||
# Java (jmavsim or fastrtps)
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
ant \
|
||||
openjdk-$java_version-jre \
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdf version='1.9'>
|
||||
<model name='x500-Depth'>
|
||||
<include merge='true'>
|
||||
<uri>https://fuel.gazebosim.org/1.0/RudisLaboratories/models/x500-Base</uri>
|
||||
</include>
|
||||
<include merge='true'>
|
||||
<uri>https://fuel.gazebosim.org/1.0/RudisLaboratories/models/OakD-Lite</uri>
|
||||
<pose>.12 .03 .242 0 0 0</pose>
|
||||
</include>
|
||||
<joint name="CameraJoint" type="fixed">
|
||||
<parent>base_link</parent>
|
||||
<child>OakD-Lite/base_link</child>
|
||||
<pose relative_to="base_link">.12 .03 .242 0 0 0</pose>
|
||||
</joint>
|
||||
</model>
|
||||
</sdf>
|
||||
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<model>
|
||||
<name>x500-NoPlugin</name>
|
||||
<name>x500-Base</name>
|
||||
<version>1.0</version>
|
||||
<sdf version="1.9">model.sdf</sdf>
|
||||
<author>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdf version='1.9'>
|
||||
<model name='x500-NoPlugin'>
|
||||
<model name='x500-Base'>
|
||||
<pose>0 0 .24 0 0 0</pose>
|
||||
<self_collide>false</self_collide>
|
||||
<static>false</static>
|
||||
@@ -23,7 +23,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/NXP-HGD-CF.dae</uri>
|
||||
<uri>model://x500-Base/meshes/NXP-HGD-CF.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -32,7 +32,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -41,7 +41,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -50,7 +50,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -59,7 +59,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -77,7 +77,7 @@
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/nxp.png</albedo_map>
|
||||
<albedo_map>model://x500-Base/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
@@ -96,7 +96,7 @@
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/nxp.png</albedo_map>
|
||||
<albedo_map>model://x500-Base/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
@@ -115,7 +115,7 @@
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/rd.png</albedo_map>
|
||||
<albedo_map>model://x500-Base/materials/textures/rd.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
@@ -238,7 +238,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_ccw.stl</uri>
|
||||
<uri>model://x500-Base/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
@@ -253,7 +253,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -311,7 +311,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_ccw.stl</uri>
|
||||
<uri>model://x500-Base/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
@@ -326,7 +326,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -384,7 +384,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_cw.stl</uri>
|
||||
<uri>model://x500-Base/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
@@ -399,7 +399,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
@@ -457,7 +457,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_cw.stl</uri>
|
||||
<uri>model://x500-Base/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
@@ -472,7 +472,7 @@
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
<uri>model://x500-Base/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |