修复了rosbag录制服务崩溃的bug
This commit is contained in:
+10
-10
@@ -66,19 +66,19 @@ start_bag_recorder() {
|
||||
echo "Rosbag log: ${BAG_LOG_FILE}"
|
||||
|
||||
: > "${BAG_LOG_FILE}"
|
||||
setsid bash -lc "
|
||||
setsid env WS_DIR="${WS_DIR}" bash -lc '
|
||||
set -euo pipefail
|
||||
set +u
|
||||
source '${WS_DIR}/install/setup.bash'
|
||||
source "${WS_DIR}/install/setup.bash"
|
||||
set -u
|
||||
while true; do
|
||||
start_time=\\\$(date +%Y%m%d_%H%M%S)
|
||||
output=/tmp/lbot_arm_\\${start_time}.mcap
|
||||
echo \"Starting rosbag: \\${output}\"
|
||||
start_time=$(date +%Y%m%d_%H%M%S)
|
||||
output=/tmp/lbot_arm_${start_time}.mcap
|
||||
echo "Starting rosbag: ${output}"
|
||||
set +e
|
||||
timeout 3600 ros2 bag record \
|
||||
--storage mcap \
|
||||
--output \"\\${output}\" \
|
||||
--output "${output}" \
|
||||
--polling-interval 2 \
|
||||
--include-unpublished-topics \
|
||||
--disable-keyboard-controls \
|
||||
@@ -92,13 +92,13 @@ start_bag_recorder() {
|
||||
--services \
|
||||
/robot1/left_arm/move_joint \
|
||||
/robot1/right_arm/move_joint
|
||||
rc=\\$?
|
||||
rc=$?
|
||||
set -e
|
||||
if [[ \\${rc} -ne 124 ]]; then
|
||||
exit \\${rc}
|
||||
if [[ ${rc} -ne 124 ]]; then
|
||||
exit ${rc}
|
||||
fi
|
||||
done
|
||||
" >> "${BAG_LOG_FILE}" 2>&1 &
|
||||
' >> "${BAG_LOG_FILE}" 2>&1 &
|
||||
|
||||
local pid=$!
|
||||
local pgid
|
||||
|
||||
Reference in New Issue
Block a user