This readme assumes you have followed the
Guest Science Developer Guide and the
astrobee/simulation/readme.md
.
It also assumes that astrobee_android
is checked out in $ANDROID_PATH
, and
astrobee
source is checked out in $SOURCE_PATH
.
This readme teaches you how to run a Guest Science Application by running one of the Guest Science examples. Once you have your own Guest Science Application, it should be trival to use these instructions and replace the example name with your project's name. Please follow all four sections. However, if you are doing Java only development, please use the Java only subsections and if you are using the emulator or HLP board, please use the Android subsections.
In every terminal you use, be sure to set up your environment. If you forgot how
to do this, follow the Setting up your Environment section of the
astrobee/simulation/running_the_sim.md
.
Coming soon!!!
Please start your emulator or HLP board and make sure you can communicate with it (adb and network i.e. ping). Please refer to the emulator or the HLP board instructions if you forget how to do this.
sudo apt install openjdk-8-jdk
# Check the location of where Java is installed
whereis java
export JAVA_PATH="insert here the path obtained from the previous command"
cd $ANDROID_PATH/core_apks/guest_science_manager
ANDROID_HOME=$HOME/Android/Sdk ./gradlew assembleDebug
adb install -g -r activity/build/outputs/apk/activity-debug.apk
Important Please make sure to type the g
before r
. If you don't, Android
will not grant the APK the right permissions and the APK will fail to excute.
You will be running the test simple trajectory example. This example undocks the Astrobee and then moves it in a rectangular shape.
cd $ANDROID_PATH/gs_examples/test_simple_trajectory
ANDROID_HOME=$HOME/Android/Sdk ./gradlew assembleDebug
adb install -g -r app/build/outputs/apk/app-debug.apk
Important Please make sure to type the g
before r
. If you don't, Android
will not grant the APK the right permissions and the APK will fail to excute.
Please open two terminals and do the following in both terminals:
export ROS_IP=$(getent hosts llp | awk '{ print $1 }')
export ROS_MASTER_URI=http://${ROS_IP}:11311
echo $ROS_IP
Ensure you can ping/connect to the ip echoed.
When you get to section 2 (Run the Simulator), use terminal 1. When you get to section 4 (Guest Science Commanding), use terminal 2.
Please start the simulator. If you forgot how to do this, follow the Running
the Simulator section of the
astrobee/simulation/running_the_sim.md
.
Coming soon!!!
# Once you use 'hard_stop' to close the gs_manager, you will have to use 'restart' afterwards
# instead of 'start' if you want to use the gs_manger again. And so, for convenience,
# it's easier to use 'restart'.
$ANDROID_PATH/scripts/gs_manager.sh restart
cd $SOURCE_PATH/tools/gds_helper/src
python gds_simulator.py
If you encounter an issue running the GDS simulator, then you
may need to update the file. Depending on your environment
you may use the following command git checkout develop -- gds_simulator.py
.
The GDS simulator is interactive. It will prompt you for the next step.
- Press any key to grab control
- Select the Guest Science Application (GSA) you are trying to run
- Type
b
and pressEnter
to start the GSA - Press
Enter
to stop listening for data - Press any key to get back to the application menu
If you want to see the robot move, command it to do so:
- Type
d
and pressEnter
to send a custom guest science command - Type
1
and pressEnter
to run the trajectory
Now Astrobee will undock and move in a rectangle.
In the terminal running the GDS simulator, please do the following:
- If needed, press
Enter
to stop listening for data - If needed, press any key to get back to the application menu
- Type
c
and pressEnter
to stop the GSA - Press
Enter
to stop listening for data - Press any key to get back to the application menu
- Type
f
and pressEnter
to exit the GDS simulator
In the terminal running the simulator, enter Ctrl+c
Coming soon!!!
$ANDROID_PATH/scripts/gs_manager.sh hard_stop
To close the emulator, click on the x
symbol.