From 3c3bfc66d85631a6bebf7b27e17bd2546d6a62da Mon Sep 17 00:00:00 2001 From: Jiangtao Hu Date: Wed, 20 Dec 2017 20:52:27 -0800 Subject: [PATCH] script: add /apollo/meta topic to record version info. --- scripts/record_bag.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/record_bag.sh b/scripts/record_bag.sh index 5a6dacced5..fc09c22d9a 100755 --- a/scripts/record_bag.sh +++ b/scripts/record_bag.sh @@ -49,6 +49,16 @@ function start() { cd "${BAG_DIR}" echo "Recording bag to: $(pwd)" + # record some meta info into bag + if [ -e /apollo/meta.ini ]; then + META_STR=`cat /apollo/meta.ini | sed 's/\[//g' | sed 's/\]//g' | sed 's/:/ /g' | tr '\n' ' '` + rostopic pub -1 -l /apollo/meta std_msgs/String "$META_STR" & + else + META_STR=`git rev-parse HEAD` + META_STR="git commit $META_STR" + rostopic pub -1 -l /apollo/meta std_msgs/String "$META_STR" & + fi + # Start recording. LOG="/tmp/apollo_record.out" NUM_PROCESSES="$(pgrep -c -f "rosbag record")" @@ -69,6 +79,7 @@ function start() { /apollo/canbus/chassis_detail \ /apollo/control \ /apollo/control/pad \ + /apollo/meta \ /apollo/perception/obstacles \ /apollo/perception/traffic_light \ /apollo/planning \ -- GitLab