Skip to content

Commit

Permalink
[TEST] testing run instructions and run.sh, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hollydinkel committed Mar 22, 2024
1 parent f6590ba commit 32921b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docs/data_processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ 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.

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
Expand All @@ -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
```

Expand Down
16 changes: 9 additions & 7 deletions run.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit 32921b9

Please sign in to comment.