From 32921b9746ce8947deabaacb4fe53a817bdfaf94 Mon Sep 17 00:00:00 2001 From: hollydinkel Date: Fri, 22 Mar 2024 10:28:15 -0700 Subject: [PATCH] [TEST] testing run instructions and run.sh, WIP --- docs/data_processing.md | 8 ++++---- run.sh | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) mode change 100755 => 100644 run.sh diff --git a/docs/data_processing.md b/docs/data_processing.md index 7bcec5c..e51a9ba 100644 --- a/docs/data_processing.md +++ b/docs/data_processing.md @@ -5,8 +5,7 @@ The files documents the steps for creating a dataset to use with Fast Change Det First, install the [Astrobee flight software](https://github.com/nasa/astrobee). Additional instructions for using the Astrobee flight software with Docker are [here](https://docs.google.com/document/d/1Wx54si5_24rz0kJie31X54PIk_k_owT6qzlziGnAWYc/edit?usp=sharing). Clone this repository into the astrobee flight software repository: ```bash -export ASTROBEE_LOCAL_WS=$HOME/astrobee -cd $ASTROBEE_WS && git clone https://github.com/hollydinkel/astrobee_change_detection --recurse-submodules +cd $HOME && git clone https://github.com/hollydinkel/astrobee_change_detection --recurse-submodules ``` Download a dated raw dataset of `.bag` files from [here](https://docs.google.com/document/d/1Wx54si5_24rz0kJie31X54PIk_k_owT6qzlziGnAWYc/edit?usp=sharing). Unzip the dataset into a `astrobee_change_detection/data` directory (**HD 20231113: This is not the correct link, and the data on GDrive is no longer in the format to support this step anyway. Needs re-testing**). Note that the survey number (e.g., 1, 2, 3), the date (e.g., 20230419), and the robot name (e.g., bsharp) must be specified in each step. The first four steps can be performed in a docker container where the running container is mounted to a local directory. The provided `run.sh` script runs these four steps. The last step should be performed locally if the FastCD workspace is built outside of the container. @@ -14,7 +13,8 @@ Download a dated raw dataset of `.bag` files from [here](https://docs.google.com 1. The first step of data processing is extraction of images and poses from bag data to folder, processing of sequential images to remove images where frames did not move much between images, and processing of sequential poses so that final poses are close in time (timestamps are close) to the image timestamps. First, start a running Astrobee docker container with ```bash -cd $ASTROBEE_LOCAL_WS && sudo ./scripts/docker/run.sh -m bash +export ASTROBEE_WS=$HOME/astrobee +cd $ASTROBEE_WS && sudo ./scripts/docker/run.sh -m bash ``` Inside the docker container, run @@ -30,7 +30,7 @@ After processing the data in the the docker container, return to a local termina export SURVEY=1 export DATE=20230419 export ROBOT=bsharp -cd $HOME/astrobee/astrobee_change_detection +cd $HOME/astrobee_change_detection python3 scripts/create_cameras_xml.py $SURVEY $DATE $ROBOT ``` diff --git a/run.sh b/run.sh old mode 100755 new mode 100644 index 5a80ddb..bb5dd8e --- a/run.sh +++ b/run.sh @@ -1,10 +1,12 @@ #!/bin/bash -export ASTROBEE_WS=/src/astrobee/src -export DEVEL=/src/astrobee/devel -export DATA=$ASTROBEE_WS/astrobee_data_processing +export HOME=/home/hdinkel +export ASTROBEE_WS=$HOME/astrobee/src/ +export ASTROBEE_DEVEL=$HOME/astrobee/devel +export ASTROBEE_CHANGE_DETECTION=$HOME/astrobee_change_detection +export DATA=$ASTROBEE_CHANGE_DETECTION/data export DATE=20230419 export ROBOT=bsharp -source $DEVEL/setup.bash +source $ASTROBEE_DEVEL/setup.bash # Install dependencies apt-get update @@ -20,9 +22,9 @@ rm data.zip for SURVEY_NUMBER in 1 2 3 4 do export SURVEY=$SURVEY_NUMBER - cd $DATA && python3 astrobee_data_processing_scripts/poses_to_file.py $SURVEY $DATE $ROBOT + cd $DATA && python3 $ASTROBEE_CHANGE_DETECTION/astrobee_data_processing_scripts/poses_to_file.py $SURVEY $DATE $ROBOT rosrun sparse_mapping process_sequential_images.py $DATA/data/$DATE/$ROBOT/bayer/survey$SURVEY $ASTROBEE_WS/src/astrobee/config - cd $DATA && python3 astrobee_data_processing_scripts/process_sequential_poses.py $SURVEY $DATE $ROBOT + cd $DATA && python3 $ASTROBEE_CHANGE_DETECTION/astrobee_data_processing_scripts/process_sequential_poses.py $SURVEY $DATE $ROBOT cd $DATA/data/$DATE/$ROBOT/bayer/survey$SURVEY - ls -v | nl -v 0 | while read n f; do mv -n "$f" "Image$n.JPG"; done + # ls -v | nl -v 0 | while read n f; do mv -n "$f" "Image$n.JPG"; done done \ No newline at end of file