Skip to content

Commit

Permalink
adding a config file for use with playback
Browse files Browse the repository at this point in the history
  • Loading branch information
M1chaelM committed Jun 28, 2023
1 parent 6b3cc8a commit 6827a9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
19 changes: 1 addition & 18 deletions replay_trial.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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" \
Expand Down
3 changes: 2 additions & 1 deletion vrx_server/vrx-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions vrx_server/vrx-server/gui.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0"?>

<!-- Quick start dialog -->
<dialog name="quick_start" show_again="false"/>

<window>
<position_x>100</position_x>
<position_y>100</position_y>
Expand Down
2 changes: 1 addition & 1 deletion vrx_server/vrx-server/play_vrx_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6827a9d

Please sign in to comment.