
export CONVERT_ZIMULATOR_LEFT="bazel run -c opt --config=cuda -- //experimental/dma/traffic_lights:convert_zimulator_main --image_dir=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230 --labels_dir=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230_L --label_color_file=${DATA_DIR}/${EXP_DIR}/segmentation.txt --camera_id=${CAMERA}_wide_left --output=${DATA_DIR}/${EXP_DIR}/${CAMERA}_wide_left_ai.lmdb --timestamp_file=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230.h264-timestamps.txt"


#export CONVERT_ZIMULATOR_RIGHT="bazel run -c opt --config=cuda -- //experimental/dma/traffic_lights:convert_zimulator_main --image_dir=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230 --labels_dir=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230_L --label_color_file=${DATA_DIR}/${EXP_DIR}/segmentation.txt --camera_id=${CAMERA}_wide_left --output=${DATA_DIR}/${EXP_DIR}/${CAMERA}_wide_left_ai.lmdb --timestamp_file=${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__16062230.h264-timestamps.txt"

export SPLIT_FUSION_LMDB="bazel run -c opt --config=cuda -- //experimental/dma/traffic_lights:split_lmdb_by_camera --in_lmdb ${DATA_DIR}/${EXP_DIR}/groundtruth_ai.lmdb --output_dir ${DATA_DIR}/${EXP_DIR}/ --camera_name north_wide_left,north_wide_right"


export TRANSFER_AI_TO_FUSION_LEFT="bazel run -c opt --config=cuda -- //experimental/dma/traffic_lights:transfer_2d_bbox_to_fusion_lmdb --zim_2d_lmdb ${DATA_DIR}/${EXP_DIR}/${CAMERA}_wide_left_ai.lmdb --zim_fusion_lmdb ${DATA_DIR}/${EXP_DIR}/north_wide_left_f.lmdb --output ${DATA_DIR}/${EXP_DIR}/north_wide_left_full.lmdb"

export TRANSFER_AI_TO_FUSION_RIGHT="bazel run -c opt --config=cuda -- //experimental/dma/traffic_lights:transfer_2d_bbox_to_fusion_lmdb --zim_2d_lmdb ${DATA_DIR}/${EXP_DIR}/${CAMERA}_wide_right_ai.lmdb --zim_fusion_lmdb ${DATA_DIR}/${EXP_DIR}/north_wide_right_f.lmdb --output ${DATA_DIR}/${EXP_DIR}/north_wide_right_full.lmdb"

export COMPILE_OFFLINE_FUSION="bazel build -c opt --config=cuda //experimental/dma/traffic_lights:offline_zvision_main"

export GENERATE_TRACKS="rosrun zvision_ros_bridge offline_zvision_main --config s3://zoox-testdata/vision/models/vehicle_config_minim3_s3.pbtxt --output_bag ${DATA_DIR}/${EXP_DIR}${ZIM_VT_BAG_PREFIX} --alsologtostderr=1 --zim_lmdbs ${DATA_DIR}/${EXP_DIR}/north_wide_left_full.lmdb,${DATA_DIR}/${EXP_DIR}/north_wide_right_full.lmdb --camera_names north_wide_left,north_wide_right"

export CREATE_VISION_TRACKS="$COMPILE_OFFLINE_FUSION && $GENERATE_TRACKS"

export RUN_CONDUCTOR="rosrun vision_ros_bridge offline_vision_main --camera_names north_wide_left,north_wide_right --config s3://zoox-testdata/vision/models/vehicle_config_minim3_s3.pbtxt --alsologtostderr=1 --videos ${DATA_DIR}/${EXP_DIR}/${CAM_PREFIX}-${CAMERA}_wide_left__16062230.h264,${DATA_DIR}/${EXP_DIR}/${CAM_PREFIX}-${CAMERA}_wide_right__16062180.h264 --output_bag ${DATA_DIR}/${EXP_DIR}/${CONDUCTOR_VT_BAG_PREFIX}"

export FFMPEG_LEFT="ffmpeg -n -i ${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__${CAMERA_LEFT_SERIAL}/%09d.png -qscale 0 ${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_left__${CAMERA_LEFT_SERIAL}.h264"

export FFMPEG_RIGHT="ffmpeg -n -i ${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_right__${CAMERA_RIGHT_SERIAL}/%09d.png -qscale 0 ${DATA_DIR}/${EXP_DIR}${CAM_PREFIX}-${CAMERA}_wide_right__${CAMERA_RIGHT_SERIAL}.h264"

export SPLICE_LIDAR_BAG="rosbag filter ${DATA_DIR}/${EXP_DIR}${LOGFILE_PREFIX}.bag ${DATA_DIR}/${EXP_DIR}${LOGFILE_PREFIX}.applanix.bag 'topic==\"/driving/ApplanixPose\"'"

# 'topic=="/driving/ApplanixPose"'

export ZIM_BIN_TO_BAG_ALL="ZOOX_ROBOT_NAME=kitt_sim roslaunch zimulator zim_bridge_to_bag.launch calibration_date:=2016-07-14 log_file:=${DATA_DIR}/${EXP_DIR}/zimbridge_roslog.bin out_bag:=${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}.all.bag"

export GET_APPLANIX_BAG="rosbag filter ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}.all.bag ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}-0000.applanix.bag 'topic.startswith(\"/driving/Applanix\")'"

export GET_VELODYNE_BAG="rosbag filter ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}.all.bag ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}-0000.velodyne.bag 'topic.startswith(\"/driving/velodyne\")'"

export GET_MAIN_BAG="rosbag filter ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}.all.bag ${DATA_DIR}/${EXP_DIR}/${LOGFILE_PREFIX}-0000.bag 'not (topic.startswith(\"/driving/Applanix\") or topic.startswith(\"/driving/velodyne\"))'"
