From 6827a9dbfaf8e12146065a4954521d31fb2198e4 Mon Sep 17 00:00:00 2001 From: M1chaelM Date: Wed, 28 Jun 2023 18:26:56 -0400 Subject: [PATCH] adding a config file for use with playback --- replay_trial.bash | 19 +------------------ vrx_server/vrx-server/Dockerfile | 3 ++- vrx_server/vrx-server/gui.config | 4 ++++ vrx_server/vrx-server/play_vrx_log.sh | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/replay_trial.bash b/replay_trial.bash index 653e51e..eec2545 100755 --- a/replay_trial.bash +++ b/replay_trial.bash @@ -112,6 +112,7 @@ else fi # Output directory +# TODO: We don't seem to be doing anything with this. HOST_OUTPUT_DIR=${HOST_LOG_BASE}/video OUTPUT_DIR=${LOG_BASE}/video if [ -d "$HOST_OUTPUT_DIR" ]; then @@ -137,23 +138,6 @@ width=1000 height=750 BLACK_WINDOW_TIME=2 -HOST_GZ_GUI_CONFIG_DIR=${DIR}/generated/logs/playback_gazebo -GZ_GUI_CONFIG_DIR=/home/$USER/.gazebo -if [ -d "$HOST_GZ_GUI_CONFIG_DIR" ]; then - echo "Overwriting directory: ${HOST_GZ_GUI_CONFIG_DIR}" - rm -R $HOST_GZ_GUI_CONFIG_DIR -else - echo "Creating directory: ${HOST_GZ_GUI_CONFIG_DIR}" -fi -mkdir -p $HOST_GZ_GUI_CONFIG_DIR - -# Tell gazebo client what size and place it should be -echo "[geometry] -width=$width -height=$height -x=$x -y=$y" > ${HOST_GZ_GUI_CONFIG_DIR}/gui.ini - # Run Gazebo simulation server container SERVER_CMD="/play_vrx_log.sh ${GZ_LOG_PATH} ${OUTPUT_FILE} ${manual_play} ${keep_gz}" SERVER_IMG="vrx-server-${ROS_DISTRO}:latest" @@ -162,7 +146,6 @@ ${DIR}/vrx_server/run_container.bash ${SERVER_CONTAINER_NAME} $SERVER_IMG \ --ip ${SERVER_ROS_IP} \ -v ${HOST_LOG_BASE}:${LOG_BASE} \ -v ${HOST_OUTPUT_DIR}:${OUTPUT_DIR} \ - -v ${HOST_GZ_GUI_CONFIG_DIR}:${GZ_GUI_CONFIG_DIR} \ -e ROS_MASTER_URI=${ROS_MASTER_URI} \ -e ROS_IP=${SERVER_ROS_IP} \ -e VRX_DEBUG=false" \ diff --git a/vrx_server/vrx-server/Dockerfile b/vrx_server/vrx-server/Dockerfile index 4ccce99..fbb705a 100644 --- a/vrx_server/vrx-server/Dockerfile +++ b/vrx_server/vrx-server/Dockerfile @@ -8,7 +8,7 @@ ARG ROSDIST=humble RUN mkdir -p ~/vrx_ws/src # TODO: restore version tag -RUN git clone https://github.com/osrf/vrx.git \ +RUN git clone -b M1chaelM/gz_recording_args https://github.com/osrf/vrx.git \ && mv ./vrx ~/vrx_ws/src # Compile the VRX project. @@ -43,5 +43,6 @@ COPY ./vrx_entrypoint.sh / COPY ./run_vrx_trial.sh / COPY ./play_vrx_log.sh / COPY ./gz_utils.sh / +COPY ./gui.config / ENTRYPOINT ["/vrx_entrypoint.sh"] diff --git a/vrx_server/vrx-server/gui.config b/vrx_server/vrx-server/gui.config index fb36975..31d3d7e 100644 --- a/vrx_server/vrx-server/gui.config +++ b/vrx_server/vrx-server/gui.config @@ -1,4 +1,8 @@ + + + + 100 100 diff --git a/vrx_server/vrx-server/play_vrx_log.sh b/vrx_server/vrx-server/play_vrx_log.sh index 9f94d6a..2562283 100755 --- a/vrx_server/vrx-server/play_vrx_log.sh +++ b/vrx_server/vrx-server/play_vrx_log.sh @@ -72,7 +72,7 @@ echo "Starting Gazebo..." echo "Check any possible errors after the run in $OUTPUT.playback_output.txt..." # Start Gazebo in playback mode -gz sim -v 4 --playback $LOG_FILE > $OUTPUT.playback_output.txt 2>&1 & +gz sim -v 4 --gui-config /gui.config --playback $LOG_FILE > $OUTPUT.playback_output.txt 2>&1 & gz_playback_pid=$! wait_until_gzserver_is_up echo -e "${GREEN}OK${NOCOLOR}\n"