forked from Archive/PX4-Autopilot
fixes for integration and unit tests
Move ros logs dir so that .ulg files are not in the same directory (mission_test.py:: get_last_log() fails otherwise)
This commit is contained in:
parent
0edd7c93e1
commit
5363aff879
|
@ -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
|
|
@ -117,6 +117,8 @@ if [[ ($rcS_path == posix-configs/SITL/init/ekf2 || $rcS_path == posix-configs/S
|
||||||
&& ($model == "iris" || $model == "typhoon_h480") ]]; then
|
&& ($model == "iris" || $model == "typhoon_h480") ]]; then
|
||||||
echo "Using new unified rcS for $model"
|
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"
|
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
|
else
|
||||||
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data"
|
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -60,8 +60,10 @@ def get_last_log():
|
||||||
try:
|
try:
|
||||||
log_path = os.environ['PX4_LOG_DIR']
|
log_path = os.environ['PX4_LOG_DIR']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
log_path = os.path.join(os.environ['HOME'],
|
try:
|
||||||
'.ros/rootfs/fs/microsd/log')
|
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_dir = sorted(glob.glob(os.path.join(log_path, '*')))[-1]
|
||||||
last_log = sorted(glob.glob(os.path.join(last_log_dir, '*.ulg')))[-1]
|
last_log = sorted(glob.glob(os.path.join(last_log_dir, '*.ulg')))[-1]
|
||||||
return last_log
|
return last_log
|
||||||
|
|
|
@ -321,8 +321,17 @@ int create_symlinks_if_needed(std::string &data_path)
|
||||||
std::string src_path = data_path;
|
std::string src_path = data_path;
|
||||||
std::string dest_path = current_path + "/" + path_sym_link;
|
std::string dest_path = current_path + "/" + path_sym_link;
|
||||||
|
|
||||||
if (dir_exists(dest_path)) {
|
struct stat info;
|
||||||
return PX4_OK;
|
|
||||||
|
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());
|
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) {
|
} else if (info.st_mode & S_IFDIR) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string pwd()
|
std::string pwd()
|
||||||
|
|
|
@ -21,11 +21,6 @@ pwm_out_sim start
|
||||||
|
|
||||||
ver all
|
ver all
|
||||||
|
|
||||||
list_tasks
|
|
||||||
list_devices
|
|
||||||
list_topics
|
|
||||||
list_files
|
|
||||||
|
|
||||||
mavlink start -x -u 14556 -r 2000000
|
mavlink start -x -u 14556 -r 2000000
|
||||||
mavlink boot_complete
|
mavlink boot_complete
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,6 @@ pwm_out_sim start
|
||||||
|
|
||||||
ver all
|
ver all
|
||||||
|
|
||||||
list_tasks
|
|
||||||
list_devices
|
|
||||||
list_topics
|
|
||||||
list_files
|
|
||||||
|
|
||||||
mavlink start -x -u 14556 -r 2000000
|
mavlink start -x -u 14556 -r 2000000
|
||||||
mavlink boot_complete
|
mavlink boot_complete
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#ifdef __PX4_NUTTX
|
#ifdef __PX4_NUTTX
|
||||||
#define PX4_MAVLINK_TEST_DATA_DIR "/etc"
|
#define PX4_MAVLINK_TEST_DATA_DIR "/etc"
|
||||||
#else
|
#else
|
||||||
#define PX4_MAVLINK_TEST_DATA_DIR "ROMFS/px4fmu_test"
|
#define PX4_MAVLINK_TEST_DATA_DIR "etc"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// @brief Test case file name for Read command. File are generated using mavlink_ftp_test_data.py
|
/// @brief Test case file name for Read command. File are generated using mavlink_ftp_test_data.py
|
||||||
|
|
|
@ -79,8 +79,8 @@ static bool should_prearm = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_BOARD_SITL)
|
#if defined(CONFIG_ARCH_BOARD_SITL)
|
||||||
#define MIXER_PATH(_file) "ROMFS/px4fmu_test/mixers/"#_file
|
#define MIXER_PATH(_file) "etc/mixers/"#_file
|
||||||
#define MIXER_ONBOARD_PATH "ROMFS/px4fmu_common/mixers"
|
#define MIXER_ONBOARD_PATH "etc/mixers"
|
||||||
#else
|
#else
|
||||||
#define MIXER_ONBOARD_PATH "/etc/mixers"
|
#define MIXER_ONBOARD_PATH "/etc/mixers"
|
||||||
#define MIXER_PATH(_file) MIXER_ONBOARD_PATH"/"#_file
|
#define MIXER_PATH(_file) MIXER_ONBOARD_PATH"/"#_file
|
||||||
|
|
|
@ -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_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 "$@"
|
rostest px4 "$@"
|
||||||
|
|
Loading…
Reference in New Issue