Overview
Final round aboard the ISS

- Starting from the dock station, move Astrobee through 4 candidate areas while capturing images of cards with AR tags.
 

- Astrobee must stay within Keep-In-Zone (KIZ)
 

- Once Astrobee reaches the astronaut and gives a report, begin locating the treasure based on their landmark locations in the images.
 

- When each treasure is found, Astrobee must take a picture of the target item and flare the signal lights.
 

- Bonus points can be earned by completing the mission faster and spending more time passing through the Oasis Zones.
 
Game Flow
1) Astrobee undocks
- Astrobee undocks and moves to start point
 

- Create logs to record the status of Astrobee and help visualize program execution (like unexpected movements, robot position)
- See start of this tutorial for adding logs
 
 
public class YourService extends KiboRpcService {
 
    private final String TAG = this.getClass().getSimpleName();
 
    @Override
    protected void runPlan1(){
        // The mission starts- starts timer, returns Success/Failure
        api.startMission();
        Log.i(TAG, "Start mission");
...
 
private void logPose(String description) {
    Kinematics kin = api.getRobotKinematics();
    Point position = kin.getPosition();
    Quaternion orientation = kin.getOrientation();
 
    Log.i(TAG, "Pose [" + description + "]");
    Log.i(TAG, "  Position: x=" + position.getX()
            + ", y=" + position.getY()
            + ", z=" + position.getZ());
    Log.i(TAG, "  Orientation: x=" + orientation.getX()
            + ", y=" + orientation.getY()
            + ", z=" + orientation.getZ()
            + ", w=" + orientation.getW());
}06-17 22:51:42.135 I/KiboRpcApi( 1717): Mission Start: 20250617 105142135
06-17 22:51:42.135 I/KiboRpcApi( 1717): [Finish] startMission
06-17 22:51:42.135 I/KiboRpcApi( 1717): [Start] getRobotKinematics
06-17 22:51:42.135 I/KiboRpcApi( 1717): [getRobotKinematics] Waiting for robot to acquire position.
06-17 22:51:42.135 I/KiboRpcApi( 1717): [Finish] getRobotKinematics
06-17 22:51:42.135 I/YourService( 1717): Pose [Initial pose]
06-17 22:51:42.135 I/YourService( 1717):   Position: x=10.27963567518098, y=-9.814076840187253, z=4.276688122161466
06-17 22:51:42.135 I/YourService( 1717):   Orientation: x=-0.005178778, y=-0.00419882, z=-0.001613201, w=0.99997646
06-17 22:51:42.135 I/KiboRpcApi( 1717): [Start] moveTo
06-17 22:51:42.135 I/KiboRpcApi( 1717): Parameters: goalPoint == gov.nasa.arc.astrobee.types.Point[10.9, -9.923, 5.195], orientation == Mat33f::Quaternion{ x=0; y=0; z=-0.707; w=0.707}, printRobotPosition == true
2) Move to area
- Example, Astrobee moves to area 1 and rotates to take a picture of target item
 
// Move to Area 1
Point point = new Point(10.9d, -9.92284d, 5.195d);
Quaternion quaternion = new Quaternion(0f, 0f, -0.707f, 0.707f);
api.moveTo(point, quaternion, true);
logPose("After first move");
- Take and save a picture of the target item
 
// Get a camera image.
Mat image = api.getMatNavCam();
 
// Save image
Log.i(TAG, "Saving image.");
api.saveMatImage(image, "file_name.png");3) View simulation results
- View image files
- Click 
DOWNLOAD IMAGE FILESand openapp-debug.apk_results/DebugImages 
 - Click 
 

- View log files
- Click 
DOWNLOAD LOG FILESand openapp-debug.apk_results/adb.log 
 - Click 
 
06-17 22:51:59.157 I/KiboRpcApi( 1717): [Finish] moveTo
06-17 22:51:59.157 I/KiboRpcApi( 1717): [Start] getRobotKinematics
06-17 22:51:59.157 I/KiboRpcApi( 1717): [getRobotKinematics] Waiting for robot to acquire position.
06-17 22:51:59.157 I/KiboRpcApi( 1717): [Finish] getRobotKinematics
06-17 22:51:59.157 I/YourService( 1717): Pose [After first move]
06-17 22:51:59.157 I/YourService( 1717):   Position: x=10.894839774608288, y=-9.91495874957633, z=5.212407057308163
06-17 22:51:59.157 I/YourService( 1717):   Orientation: x=-0.009562017, y=-0.0010459396, z=-0.6966343, w=0.7173619
06-17 22:51:59.157 I/KiboRpcApi( 1717): [Start] getMatNavCam
06-17 22:51:59.158 I/KiboRpcApi( 1717): [Finish] getMatNavCam
06-17 22:51:59.158 I/YourService( 1717): Saving image.
06-17 22:51:59.158 I/KiboRpcApi( 1717): [Start] saveMatImage
06-17 22:51:59.158 I/KiboRpcApi( 1717): Parameters: image, imageName == file_name.png
06-17 22:51:59.407 I/KiboRpcApi( 1717): [Finish] saveMatImage
4) Do image processing
5) Report rounding completion

Game API Overview
- See Game API details in the KiboRPC Programming Manual for full API
 
Game API
Method Description api.startMission() Starts timer and undocks Astrobee; returns boolean result (Success/Failure). ex) boolean result = api.startMission(); api.laserControl() Astrobee shoots a laser. ex) Result result = api.laserControl(true); api.moveTo() Executes Astrobee’s movement and rotation (both in absolute coordinates). point: specifies movement coordinates. quaternion: specifies rotation in quaternions. api.relativeMoveTo() Moves Astrobee relative to its current position and orientation. point: relative movement coordinates. quaternion: relative rotation in quaternions. api.reportPoint1Arrival() Call this function when you want to declare Astrobee’s arrival at Point1. api.reportRoundingCompletion() Reports rounding completion and blinks the lights. api.notifyRecognitionItem() Notify that Astrobee has recognized the TargetItem held by the astronaut. api.takeTargetItemSnapshot() Retrieves snapshot of Target1 to determine where Target1 was hit by the laser; marks mission completion. api.reportMissionCompletion() Sends mission completion communication to astronauts. Plays prepared audio in final on-orbit round. api.setAreaInfo() Sets matching of an area and an item. ex) api.setAreaInfo(1, “item_name”); api.setAreaInfo() Sets matching of an area, item name, and the number of that item. ex) api.setAreaInfo(1, “item_name”, 1); api.getMatNavCam() Gets an OpenCV Mat image from the NavCam. Will need image processing (e.g., OpenCV ArUco) to recognize AR tags. api.getBitmapNavCam() Gets a Bitmap image from the NavCam. api.getNavCamIntrinsics() Gets camera matrix and distortion coefficients of NavCam. api.getMatDockCam() Gets an OpenCV Mat image from the DockCam. api.getBitmapDockCam() Gets a Bitmap image from the DockCam. api.getDockCamIntrinsics() Gets camera matrix and distortion coefficients of DockCam. api.getRobotKinematics() Gets current data related to positioning and orientation for Astrobee. api.flashlightControlFront() Set the brightness of the front flashlight. ex) Result result = api.flashlightControlFront(0.5f); api.flashlightControlBack() Set the brightness of the back flashlight. ex) Result result = api.flashlightControlBack(0.5f); api.saveMatImage() Save a Mat (OpenCV) image for debugging. ex) api.saveMatImage(matImage, “debug.png”); api.saveBitmapImage() Save a Bitmap image for debugging. ex) api.saveBitmapImage(bitmapImage, “debug.png”); api.shutdownFactory() Shuts down the robot factory to allow Java to close correctly. 





