forked from Archive/PX4-Autopilot
posix: enable ROMFSROOT
This will copy the ROMFS into the build directory under etc/, and thus needs a change of the PX4 startup parameters and mixer paths.
This commit is contained in:
parent
d3362f38d1
commit
055fa768d8
|
@ -30,7 +30,7 @@ function spawn_model() {
|
|||
|
||||
pushd "$working_dir" &>/dev/null
|
||||
echo "starting instance $n in $(pwd)"
|
||||
../bin/px4 -i $n -d "$src_path/ROMFS/px4fmu_common" -w sitl_${MODEL}_${n} -s etc/init.d-posix/rcS >out.log 2>err.log &
|
||||
../bin/px4 -i $n -d "$build_path/etc" -w sitl_${MODEL}_${n} -s etc/init.d-posix/rcS >out.log 2>err.log &
|
||||
python3 ${src_path}/Tools/sitl_gazebo/scripts/xacro.py ${src_path}/Tools/sitl_gazebo/models/rotors_description/urdf/${MODEL}_base.xacro \
|
||||
rotors_description_dir:=${src_path}/Tools/sitl_gazebo/models/rotors_description mavlink_udp_port:=$(($mavlink_udp_port+$N)) \
|
||||
mavlink_tcp_port:=$(($mavlink_tcp_port+$N)) -o /tmp/${MODEL}_${N}.urdf
|
||||
|
|
|
@ -28,7 +28,7 @@ while [ $n -lt $sitl_num ]; do
|
|||
|
||||
pushd "$working_dir" &>/dev/null
|
||||
echo "starting instance $n in $(pwd)"
|
||||
../bin/px4 -i $n -d "$src_path/ROMFS/px4fmu_common" -s etc/init.d-posix/rcS >out.log 2>err.log &
|
||||
../bin/px4 -i $n -d "$build_path/etc" -s etc/init.d-posix/rcS >out.log 2>err.log &
|
||||
popd &>/dev/null
|
||||
|
||||
n=$(($n + 1))
|
||||
|
|
|
@ -156,7 +156,7 @@ set +e
|
|||
if [[ ${model} == test_* ]] || [[ ${model} == *_generated ]]; then
|
||||
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_test -s \"${src_path}\"/posix-configs/SITL/init/test/${model} -t \"$src_path\"/test_data"
|
||||
else
|
||||
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t \"$src_path\"/test_data"
|
||||
sitl_command="\"$sitl_bin\" $no_pxh \"$build_path\"/etc -s etc/init.d-posix/rcS -t \"$src_path\"/test_data"
|
||||
fi
|
||||
|
||||
echo SITL COMMAND: $sitl_command
|
||||
|
|
|
@ -46,7 +46,7 @@ else()
|
|||
|
||||
add_custom_target(upload
|
||||
COMMAND ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config ${PX4_SOURCE_DIR}/ROMFS # source
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config ${PX4_BINARY_DIR}/etc # source
|
||||
/home/linaro # destination
|
||||
DEPENDS px4 ${PX4_BOARD_DIR}/scripts/adb_upload.sh
|
||||
COMMENT "uploading px4"
|
||||
|
|
|
@ -41,6 +41,7 @@ px4_add_board(
|
|||
LABEL default
|
||||
#TESTING
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
ROMFSROOT px4fmu_common
|
||||
DRIVERS
|
||||
#barometer # all available barometer drivers
|
||||
batt_smbus
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
add_custom_target(upload
|
||||
COMMAND rsync -arh --progress
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_SOURCE_DIR}/ROMFS # source
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_BINARY_DIR}/etc # source
|
||||
debian@beaglebone.lan:/home/debian/px4 # destination
|
||||
DEPENDS px4
|
||||
COMMENT "uploading px4"
|
||||
|
|
|
@ -10,6 +10,7 @@ px4_add_board(
|
|||
LABEL default
|
||||
PLATFORM posix
|
||||
ARCHITECTURE cortex-a8
|
||||
ROMFSROOT px4fmu_common
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -39,7 +39,7 @@ endif()
|
|||
|
||||
add_custom_target(upload
|
||||
COMMAND rsync -arh --progress
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS # source
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_BINARY_DIR}/etc # source
|
||||
pi@${AUTOPILOT_HOST}:/home/pi/px4 # destination
|
||||
DEPENDS px4
|
||||
COMMENT "uploading px4"
|
||||
|
|
|
@ -8,6 +8,7 @@ px4_add_board(
|
|||
LABEL default
|
||||
PLATFORM posix
|
||||
ARCHITECTURE cortex-a53
|
||||
ROMFSROOT px4fmu_common
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -39,7 +39,7 @@ endif()
|
|||
|
||||
add_custom_target(upload
|
||||
COMMAND rsync -arh --progress
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS # source
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_BINARY_DIR}/etc # source
|
||||
pi@${AUTOPILOT_HOST}:/home/pi/px4 # destination
|
||||
DEPENDS px4
|
||||
COMMENT "uploading px4"
|
||||
|
|
|
@ -8,6 +8,7 @@ px4_add_board(
|
|||
LABEL default
|
||||
PLATFORM posix
|
||||
ARCHITECTURE cortex-a53
|
||||
ROMFSROOT px4fmu_common
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -3,6 +3,7 @@ px4_add_board(
|
|||
PLATFORM posix
|
||||
VENDOR px4
|
||||
MODEL sitl
|
||||
ROMFSROOT px4fmu_common
|
||||
LABEL default
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -3,6 +3,7 @@ px4_add_board(
|
|||
PLATFORM posix
|
||||
VENDOR px4
|
||||
MODEL sitl
|
||||
ROMFSROOT px4fmu_common
|
||||
LABEL nolockstep
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -3,6 +3,7 @@ px4_add_board(
|
|||
PLATFORM posix
|
||||
VENDOR px4
|
||||
MODEL sitl
|
||||
ROMFSROOT px4fmu_common
|
||||
LABEL replay
|
||||
MODULES
|
||||
ekf2
|
||||
|
|
|
@ -3,6 +3,7 @@ px4_add_board(
|
|||
PLATFORM posix
|
||||
VENDOR px4
|
||||
MODEL sitl
|
||||
ROMFSROOT px4fmu_common
|
||||
LABEL rtps
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -3,6 +3,7 @@ px4_add_board(
|
|||
PLATFORM posix
|
||||
VENDOR px4
|
||||
MODEL sitl
|
||||
ROMFSROOT px4fmu_common
|
||||
LABEL test
|
||||
TESTING
|
||||
DRIVERS
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<arg unless="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
||||
<arg if="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
<node name="sitl" pkg="px4" type="px4" output="screen"
|
||||
args="$(find px4)/ROMFS/px4fmu_common -s etc/init.d-posix/rcS $(arg px4_command_arg1)" required="true"/>
|
||||
args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS $(arg px4_command_arg1)" required="true"/>
|
||||
|
||||
<!-- Gazebo sim -->
|
||||
<include file="$(find gazebo_ros)/launch/empty_world.launch">
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
<env name="PX4_ESTIMATOR" value="$(arg est)" />
|
||||
<arg unless="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
||||
<arg if="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -i $(arg ID) $(arg px4_command_arg1)">
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) $(arg px4_command_arg1)">
|
||||
</node>
|
||||
</launch>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<!-- PX4 SITL -->
|
||||
<arg unless="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
<arg if="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
|
||||
</node>
|
||||
<!-- spawn vehicle -->
|
||||
<node name="$(arg vehicle)_$(arg ID)_spawn" output="screen" pkg="gazebo_ros" type="spawn_model" args="-urdf -param rotors_description -model $(arg vehicle)_$(arg ID) -package_to_model -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<!-- PX4 SITL -->
|
||||
<arg unless="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
<arg if="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
|
||||
</node>
|
||||
<!-- spawn vehicle -->
|
||||
<node name="$(arg vehicle)_$(arg ID)_spawn" output="screen" pkg="gazebo_ros" type="spawn_model" args="-sdf -param model_description -model $(arg vehicle)_$(arg ID) -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>
|
||||
|
|
|
@ -82,9 +82,9 @@ sleep 1
|
|||
# RC port is mapped to /dev/ttyS4 (auto-detected)
|
||||
#rc_input start -d /dev/ttyS4
|
||||
|
||||
# default: ROMFS/px4fmu_common/mixers/quad_x.main.mix, 8 output channels
|
||||
linux_pwm_out start -p bbblue_rc -m ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||
#linux_pwm_out start -p bbblue_rc -m ROMFS/px4fmu_common/mixers/AETRFG.main.mix
|
||||
# default: etc/mixers/quad_x.main.mix, 8 output channels
|
||||
linux_pwm_out start -p bbblue_rc -m etc/mixers/quad_x.main.mix
|
||||
#linux_pwm_out start -p bbblue_rc -m etc/mixers/AETRFG.main.mix
|
||||
|
||||
logger start -t -b 200
|
||||
|
||||
|
|
|
@ -78,9 +78,9 @@ sleep 1
|
|||
# RC port is mapped to /dev/ttyS4 (auto-detected)
|
||||
rc_input start -d /dev/ttyS4
|
||||
|
||||
# default: ROMFS/px4fmu_common/mixers/quad_x.main.mix, 8 output channels
|
||||
#linux_pwm_out start -p bbblue_rc -m ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||
linux_pwm_out start -p bbblue_rc -m ROMFS/px4fmu_common/mixers/AETRFG.main.mix
|
||||
# default: etc/mixers/quad_x.main.mix, 8 output channels
|
||||
#linux_pwm_out start -p bbblue_rc -m etc/mixers/quad_x.main.mix
|
||||
linux_pwm_out start -p bbblue_rc -m etc/mixers/AETRFG.main.mix
|
||||
|
||||
logger start -t -b 200
|
||||
|
||||
|
|
|
@ -46,6 +46,6 @@ mavlink stream -d /dev/ttyPS1 -s ATTITUDE -r 50
|
|||
|
||||
rc_input start -d /dev/ttyS2
|
||||
|
||||
linux_pwm_out start -p ocpoc_mmap -m ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||
linux_pwm_out start -p ocpoc_mmap -m etc/mixers/quad_x.main.mix
|
||||
logger start -t -b 200
|
||||
mavlink boot_complete
|
||||
|
|
|
@ -50,7 +50,7 @@ then
|
|||
fi
|
||||
|
||||
navio_sysfs_rc_in start
|
||||
linux_pwm_out start -m ROMFS/px4fmu_common/mixers/AETRFG.main.mix
|
||||
linux_pwm_out start -m etc/mixers/AETRFG.main.mix
|
||||
|
||||
logger start -t -b 200
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ mc_rate_control start
|
|||
mavlink start -x -u 14577 -r 1000000
|
||||
navio_sysfs_rc_in start
|
||||
pwm_out_sim start
|
||||
mixer load /dev/pwm_output0 ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||
mixer load /dev/pwm_output0 etc/mixers/quad_x.main.mix
|
||||
|
||||
logger start -t -b 200
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ static bool _is_running = false;
|
|||
static char _device[64] = "/sys/class/pwm/pwmchip0";
|
||||
static char _protocol[64] = "navio";
|
||||
static int _max_num_outputs = 8; ///< maximum number of outputs the driver should use
|
||||
static char _mixer_filename[64] = "ROMFS/px4fmu_common/mixers/quad_x.main.mix";
|
||||
static char _mixer_filename[64] = "etc/mixers/quad_x.main.mix";
|
||||
|
||||
// subscriptions
|
||||
int _controls_subs[actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS];
|
||||
|
@ -495,7 +495,7 @@ void usage()
|
|||
PX4_INFO(" -d pwmdevice : sysfs device for pwm generation (only for Navio)");
|
||||
PX4_INFO(" (default /sys/class/pwm/pwmchip0)");
|
||||
PX4_INFO(" -m mixerfile : path to mixerfile");
|
||||
PX4_INFO(" (default ROMFS/px4fmu_common/mixers/quad_x.main.mix)");
|
||||
PX4_INFO(" (default etc/mixers/quad_x.main.mix)");
|
||||
PX4_INFO(" -p protocol : driver output protocol (navio|pca9685|ocpoc_mmap|bbblue_rc)");
|
||||
PX4_INFO(" (default is navio)");
|
||||
PX4_INFO(" -n num_outputs : maximum number of outputs the driver should use");
|
||||
|
|
|
@ -516,7 +516,7 @@ It is typically started with:
|
|||
$ pca9685_pwm_out start -a 64 -b 1
|
||||
|
||||
Use the `mixer` command to load mixer files.
|
||||
`mixer load /dev/pca9685 ROMFS/px4fmu_common/mixers/quad_x.main.mix`
|
||||
`mixer load /dev/pca9685 etc/mixers/quad_x.main.mix`
|
||||
)DESCR_STR");
|
||||
|
||||
PRINT_MODULE_USAGE_NAME("pca9685_pwm_out", "driver");
|
||||
|
|
|
@ -145,7 +145,7 @@ class Px4Runner(Runner):
|
|||
self.cmd = workspace_dir + "/build/px4_sitl_default/bin/px4"
|
||||
self.cwd = workspace_dir + "/build/px4_sitl_default/tmp/rootfs"
|
||||
self.args = [
|
||||
workspace_dir + "/ROMFS/px4fmu_common",
|
||||
workspace_dir + "/build/px4_sitl_default/etc",
|
||||
"-s",
|
||||
"etc/init.d-posix/rcS",
|
||||
"-t",
|
||||
|
|
Loading…
Reference in New Issue