diff --git a/ROMFS/px4fmu_test/mixers/quad_test.mix b/ROMFS/px4fmu_test/mixers/quad_test.mix new file mode 100644 index 0000000000..a4876bea21 --- /dev/null +++ b/ROMFS/px4fmu_test/mixers/quad_test.mix @@ -0,0 +1,25 @@ +Multirotor mixer for TEST +=========================== + +This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%. + +R: 4w 10000 10000 10000 0 + +Gimbal / payload mixer for last four channels +----------------------------------------------------- + +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 4 10000 10000 0 -10000 10000 + +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 5 10000 10000 0 -10000 10000 + +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 6 10000 10000 0 -10000 10000 + +M: 1 +O: 10000 10000 0 -10000 10000 +S: 0 7 10000 10000 0 -10000 10000 diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh index 1d301fde36..1b84083c97 100755 --- a/Tools/sitl_run.sh +++ b/Tools/sitl_run.sh @@ -117,6 +117,8 @@ if [[ ($rcS_path == posix-configs/SITL/init/ekf2 || $rcS_path == posix-configs/S && ($model == "iris" || $model == "typhoon_h480") ]]; then echo "Using new unified rcS for $model" sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t $src_path/test_data" +elif [[ ${model} == tests* ]]; then + sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_test -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data" else sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data" fi diff --git a/integrationtests/python_src/px4_it/mavros/mission_test.py b/integrationtests/python_src/px4_it/mavros/mission_test.py index 63eaf3cda8..e08968f1a7 100755 --- a/integrationtests/python_src/px4_it/mavros/mission_test.py +++ b/integrationtests/python_src/px4_it/mavros/mission_test.py @@ -60,8 +60,10 @@ def get_last_log(): try: log_path = os.environ['PX4_LOG_DIR'] except KeyError: - log_path = os.path.join(os.environ['HOME'], - '.ros/rootfs/fs/microsd/log') + try: + log_path = os.path.join(os.environ['ROS_HOME'], 'log') + except KeyError: + log_path = os.path.join(os.environ['HOME'], '.ros/log') last_log_dir = sorted(glob.glob(os.path.join(log_path, '*')))[-1] last_log = sorted(glob.glob(os.path.join(last_log_dir, '*.ulg')))[-1] return last_log diff --git a/platforms/posix/src/main.cpp b/platforms/posix/src/main.cpp index 0d54a60abf..753c15da62 100644 --- a/platforms/posix/src/main.cpp +++ b/platforms/posix/src/main.cpp @@ -321,8 +321,17 @@ int create_symlinks_if_needed(std::string &data_path) std::string src_path = data_path; std::string dest_path = current_path + "/" + path_sym_link; - if (dir_exists(dest_path)) { - return PX4_OK; + struct stat info; + + if (lstat(dest_path.c_str(), &info) == 0) { + if (S_ISLNK(info.st_mode)) { + // recreate the symlink, as it might point to some other location than what we want now + unlink(dest_path.c_str()); + + } else if (S_ISDIR(info.st_mode)) { + return PX4_OK; + } + } PX4_INFO("Creating symlink %s -> %s", src_path.c_str(), dest_path.c_str()); @@ -614,9 +623,9 @@ bool dir_exists(const std::string &path) } else if (info.st_mode & S_IFDIR) { return true; - } else { - return false; } + + return false; } std::string pwd() diff --git a/posix-configs/SITL/init/test/cmd_template.in b/posix-configs/SITL/init/test/cmd_template.in index 54531e117e..fd3273f197 100644 --- a/posix-configs/SITL/init/test/cmd_template.in +++ b/posix-configs/SITL/init/test/cmd_template.in @@ -21,11 +21,6 @@ pwm_out_sim start ver all -list_tasks -list_devices -list_topics -list_files - mavlink start -x -u 14556 -r 2000000 mavlink boot_complete diff --git a/posix-configs/SITL/init/test/tests_template.in b/posix-configs/SITL/init/test/tests_template.in index c121b2c061..6ad32a2ce3 100644 --- a/posix-configs/SITL/init/test/tests_template.in +++ b/posix-configs/SITL/init/test/tests_template.in @@ -21,11 +21,6 @@ pwm_out_sim start ver all -list_tasks -list_devices -list_topics -list_files - mavlink start -x -u 14556 -r 2000000 mavlink boot_complete diff --git a/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp b/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp index e6aed86296..87c0eebc64 100644 --- a/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp +++ b/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp @@ -45,7 +45,7 @@ #ifdef __PX4_NUTTX #define PX4_MAVLINK_TEST_DATA_DIR "/etc" #else -#define PX4_MAVLINK_TEST_DATA_DIR "ROMFS/px4fmu_test" +#define PX4_MAVLINK_TEST_DATA_DIR "etc" #endif /// @brief Test case file name for Read command. File are generated using mavlink_ftp_test_data.py diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp index f6ca6f5c03..0e1b270975 100644 --- a/src/systemcmds/tests/test_mixer.cpp +++ b/src/systemcmds/tests/test_mixer.cpp @@ -79,8 +79,8 @@ static bool should_prearm = false; #endif #if defined(CONFIG_ARCH_BOARD_SITL) -#define MIXER_PATH(_file) "ROMFS/px4fmu_test/mixers/"#_file -#define MIXER_ONBOARD_PATH "ROMFS/px4fmu_common/mixers" +#define MIXER_PATH(_file) "etc/mixers/"#_file +#define MIXER_ONBOARD_PATH "etc/mixers" #else #define MIXER_ONBOARD_PATH "/etc/mixers" #define MIXER_PATH(_file) MIXER_ONBOARD_PATH"/"#_file diff --git a/test/rostest_px4_run.sh b/test/rostest_px4_run.sh index 6af134a164..c80c2ab7eb 100755 --- a/test/rostest_px4_run.sh +++ b/test/rostest_px4_run.sh @@ -8,4 +8,7 @@ source ${PX4_SRC_DIR}/Tools/setup_gazebo.bash ${PX4_SRC_DIR} ${PX4_SRC_DIR}/buil export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:${PX4_SRC_DIR}:${PX4_SRC_DIR}/Tools/sitl_gazebo +export ROS_LOG_DIR="$HOME/.ros/ros_logs" +mkdir -p "$ROS_LOG_DIR" + rostest px4 "$@"