Skip to content

Commit

Permalink
Plansys2 on Astrobee Noetic (#107)
Browse files Browse the repository at this point in the history
* Add `survey_manager` subdirectory without layout for survey nodes

Includes placeholder directories with hyperlinked `readme.md` files in
the documentation hierarchy for the manger, planner, and bridge.

Per discussion with @marinagmoreira `survey_manager` lives under
`astrobee` to signify the code is intended for cross-compilation.

* Improve linking to survey manager docs

* Add files via upload

Adding planning domain, problem, and xml of the atomic actions of the robotic agents

* added  files to the correct directory

* adding soft constraints problem files

* Attempt at a complete MVP domain model

* Oops, remove redundant effect

* Simplified collision checking predicate

* In a working state

* Add sample_output_plan.txt

* Oops, remove obsolete commented-out code

* Fixed stereo survey part of the model based on analysis of old stereo surveys by Marina - unfortunately causes additional planner flakiness

* Update sample_output_plan.txt to reflect latest domain/problem

* Now generate PDDL problem from higher-level problem specification

* Tune panorama estimated duration

* Add plan_interpreter.py. Minor cleanup in problem_generator.py

* Simplify dynamic config just a bit

* Add `survey_manager` subdirectory without layout for survey nodes

Includes placeholder directories with hyperlinked `readme.md` files in
the documentation hierarchy for the manger, planner, and bridge.

Per discussion with @marinagmoreira `survey_manager` lives under
`astrobee` to signify the code is intended for cross-compilation.

* Improve linking to survey manager docs

* Remove `survey_bridge` capability will be added to `astrobee`

* Add traclabs plansys2 backport via submodule, thanks @ana-GT

* Move sub-modules to `survey_manager` path

* Upgrade behaviortree to V4

NOTE: If already installed, remove V3 before installing V4

* Cleanup unused, misplaced sub-modules, again.

* Remove `survey_manager` package and organize `survey_planner`

* Deprecate Ubuntu-16.04 (xenial) builds of Isaac to support Plansys2

- Remove Ubuntu-16.04 (xenial) CI builds
- Update dockerfile ubuntu version defaults to Ubuntu-20.04 (focal)
- Update apk build environment to Ubuntu-20.04 (focal)

* Fix python formatting

* Update to forks of traclabs backports

* Add readline development files to setup for plansys2 terminal interface

If you have already built your VM, run `sudo apt install libreadline-dev`

* Removed outdated PDDL files per @trey0

#107 (comment)

* Revert CI upgrades for APK builds

---------

Co-authored-by: Abiola Akanni <Aoakanni@smcm.edu>
Co-authored-by: Trey Smith <trey.smith@nasa.gov>
  • Loading branch information
3 people authored Dec 12, 2023
1 parent 9292616 commit c84eff2
Show file tree
Hide file tree
Showing 29 changed files with 1,648 additions and 157 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/apk.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Check for lint error and auto correct them

name: Compile APK

on: ['push', 'pull_request', 'workflow_dispatch']
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/ci_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ on:

jobs:

build-xenial:

runs-on: ubuntu-20.04

steps:

- name: Checkout Astrobee
uses: actions/checkout@v3
with:
repository: nasa/astrobee
path: astrobee/

- name: Checkout ISAAC
uses: actions/checkout@v3
with:
submodules: recursive
path: isaac/

- name: Build code for isaac:astrobee Ubuntu 16
run: isaac/scripts/docker/build.sh --remote --xenial --astrobee-source-path astrobee/

build-focal:

runs-on: ubuntu-20.04
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/ci_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,6 @@ on:

jobs:

build-xenial:

runs-on: ubuntu-20.04

steps:

- name: Checkout Astrobee
uses: actions/checkout@v3
with:
repository: nasa/astrobee
path: astrobee/

- name: Checkout ISAAC
uses: actions/checkout@v3
with:
submodules: recursive
path: isaac/

- name: Build code for isaac:astrobee Ubuntu 16
run: docker build isaac -f isaac/scripts/docker/isaac_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/nasa
-t ghcr.io/${{ github.repository_owner }}/isaac:latest-astrobee-ubuntu16.04

- name: Build code for isaac:latest Ubuntu 16
run: docker build isaac -f isaac/scripts/docker/isaac.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/nasa
-t ghcr.io/${{ github.repository_owner }}/isaac:latest-ubuntu16.04

- name: Build messages dockers for Ubuntu 16 (astrobee)
run: docker build astrobee -f isaac/scripts/docker/astrobee_msgs.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
-t ghcr.io/${{ github.repository_owner }}/isaac:astrobee-msgs-ubuntu16.04

- name: Build messages dockers for Ubuntu 16 (isaac)
run: docker build isaac -f isaac/scripts/docker/isaac_msgs.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/nasa
-t ghcr.io/${{ github.repository_owner }}/isaac:msgs-ubuntu16.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:latest-astrobee-ubuntu16.04; fi;
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:latest-ubuntu16.04; fi;
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:astrobee-msgs-ubuntu16.04; fi;
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:msgs-ubuntu16.04; fi;
build-focal:

runs-on: ubuntu-20.04
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,6 @@ on:

jobs:

build-xenial:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Checkout Astrobee
uses: actions/checkout@v3
with:
repository: nasa/astrobee
path: astrobee/

- name: Checkout ISAAC
uses: actions/checkout@v3
with:
submodules: recursive
path: isaac/

- name: Build code for isaac:astrobee Ubuntu 16
run: docker build isaac -f isaac/scripts/docker/isaac_astrobee.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=ghcr.io/nasa
-t isaac/isaac:latest-astrobee-ubuntu16.04

- name: Build code for isaac:latest Ubuntu 16
run: docker build isaac -f isaac/scripts/docker/isaac.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=isaac
-t isaac/isaac:latest-ubuntu16.04

- name: Build messages dockers for Ubuntu 16 (astrobee)
run: docker build astrobee -f isaac/scripts/docker/astrobee_msgs.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
-t isaac/isaac:astrobee-msgs-ubuntu16.04

- name: Build messages dockers for Ubuntu 16 (isaac)
run: docker build isaac -f isaac/scripts/docker/isaac_msgs.Dockerfile
--build-arg UBUNTU_VERSION=16.04
--build-arg ROS_VERSION=kinetic
--build-arg PYTHON=''
--build-arg REMOTE=isaac
-t isaac/isaac:msgs-ubuntu16.04

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker image
run: |
cd isaac
export VERSION=`grep -w -m 1 "Release" RELEASE.md | awk '{print $3}'`
docker tag isaac/isaac:latest-astrobee-ubuntu16.04 ghcr.io/${{ github.repository_owner }}/isaac:v${VERSION}-astrobee-ubuntu16.04
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:v${VERSION}-astrobee-ubuntu16.04; fi;
docker tag isaac/isaac:latest-ubuntu16.04 ghcr.io/${{ github.repository_owner }}/isaac:v${VERSION}-ubuntu16.04
if [ "${{ github.repository_owner }}" = "nasa" ]; then docker push ghcr.io/${{ github.repository_owner }}/isaac:v${VERSION}-ubuntu16.04; fi;
build-focal:

runs-on: ubuntu-20.04
Expand Down
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[submodule "isaac_msgs"]
path = communications/isaac_msgs
url = https://github.com/nasa/isaac_msgs.git
[submodule "astrobee/survey_manager/survey_planner/src/ros2_planning_system"]
path = astrobee/survey_manager/survey_planner/src/ros2_planning_system
url = https://github.com/bckempa/ros2_planning_system
branch = noetic-devel
[submodule "astrobee/survey_manager/survey_planner/src/ros1_lifecycle"]
path = astrobee/survey_manager/survey_planner/src/ros1_lifecycle
url = https://github.com/bckempa/ros1_lifecycle
branch = noetic-devel
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ the [Astrobee robot](https://github.com/nasa/astrobee). This repository includes
- [Dense mapping](https://nasa.github.io/isaac/html/geometric_streaming_mapper.html) to create a textured 3D map
- [Volumetric mapping](https://nasa.github.io/isaac/html/volumetric_mapper.html) to map volumetric signals, such as WiFi.
- [Image analysis](https://nasa.github.io/isaac/html/ano.html) module to train a neural network to detect anomalies
- [Survey Manager](https://nasa.github.io/isaac/html/survey.html) semi-autonomous planning and execution of imaging tasks.

You may also be interested in the separate repository for the [ISAAC User Interface](https://github.com/nasa/isaac_user_interface),
which enables monitoring of multiple robots through a web browser.
Expand Down
4 changes: 3 additions & 1 deletion astrobee/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ The Astrobeemodule contains the ISAAC additions to the Astrobee FSW

\subpage sim : Gazebo plugins for simulation including acoustic and heat camera, RFID reader and emmiter, as well as WiFi reader and emmiters.

\subpage gs_action_helper : Guest science action helper used to communicate with the ground through DDS messages
\subpage gs_action_helper : Guest science action helper used to communicate with the ground through DDS messages

\subpage survey : Semi-autonomous survey tasking of Astrobees.
5 changes: 5 additions & 0 deletions astrobee/survey_manager/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
\page survey Survey Manager

The ISAAC Survey Manager provides semi-autonomous planning and execution of panorama and stereophotography tasks to reduce operator loading and improve activity utilization.

\subpage survey_planner : Planning and scheduling of queued survey actions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<root BTCPP_format="4" main_tree_to_execute = "MainTree" >
<BehaviorTree ID="MainTree">
<Sequence name="root_sequence">
<Move name="collecting_panoramas" goal="${arg2}"/>
</Sequence>
</BehaviorTree>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<root BTCPP_format="4" main_tree_to_execute = "MainTree" >
<BehaviorTree ID="MainTree">
<Sequence name="root_sequence">
<Move name="move" goal="${arg2}"/>
</Sequence>
</BehaviorTree>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<root BTCPP_format="4" main_tree_to_execute = "MainTree" >
<BehaviorTree ID="MainTree">
<Sequence name="root_sequence">
<NavigateNode name="move_to_inspect" robot="${arg0}" pose_id="${arg2}" />
<!--<TakePictureNavCam robot="${arg0}" waypoint="${arg2}"/>-->
</Sequence>
</BehaviorTree>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (c) 2023, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The "ISAAC - Integrated System for Autonomous and Adaptive Caretaking
# platform" software is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# Example dynamic configuration info used when generating a PDDL problem. For now, this is goal
# conditions and initial state. A likely conops is that the initial version of this file for a
# specific activity would be hand-generated, but it might later be automatically regenerated by the
# survey manager when a replan is needed (remove completed/failed goals, add retry goals, update
# initial state to match actual current state, etc.) See also jem_survey_static.yaml.

goals:

- {type: panorama, robot: bumble, order: 0, location: jem_bay4, run: 1}
- {type: panorama, robot: bumble, order: 1, location: jem_bay3, run: 1}
- {type: panorama, robot: bumble, order: 2, location: jem_bay2, run: 1}
- {type: panorama, robot: bumble, order: 3, location: jem_bay1, run: 1}
- {type: stereo, robot: bumble, order: 4, trajectory: jem_bay1_to_bay3, run: 1}

# We want Bumble to return to its berth at the end of the run, but adding this goal causes POPF to
# get confused and greatly increase the total run time. For some reason, it doesn't notice it can
# use the same plan as without this goal and then add some motion actions at the end to achieve this
# goal. Instead, it falls back to only undocking one robot at a time, which slows things down by
# about 2x.
# - {type: robot_at, robot: bumble, location: berth1}

- {type: panorama, robot: honey, order: 0, location: jem_bay7, run: 1}
- {type: panorama, robot: honey, order: 1, location: jem_bay6, run: 1}
- {type: panorama, robot: honey, order: 2, location: jem_bay5, run: 1}

# This is another objective we want to include that for some reason causes POPF to fail to generate
# a plan (hang indefinitely). No obvious reason why it should cause a problem.
# - {type: stereo, robot: honey, order: 3, trajectory: jem_bay4_to_bay7, run: 1}

- {type: robot_at, robot: honey, location: berth2}

init:
bumble:
location: berth1
honey:
location: berth2
59 changes: 59 additions & 0 deletions astrobee/survey_manager/survey_planner/data/jem_survey_static.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (c) 2023, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The "ISAAC - Integrated System for Autonomous and Adaptive Caretaking
# platform" software is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# Static configuration info used when generating a PDDL problem and also when executing actions in a
# PDDL plan. This info should be static in the sense that it nominally doesn't change during an ISS
# activity, so the survey manager doesn't have to modify it. However, an edge case is that an
# operator might want to manually edit something in here (like add a new symbolic location or nudge
# the position of a named bay away from an obstacle) and restart the survey manager. On the other
# hand, info that is *expected* to change as part of the survey manager conops belongs in
# jem_survey_dynamic.yaml.

# Useful reference for positions and stereo survey trajectories:
# https://babelfish.arc.nasa.gov/confluence/display/FFOPS/ISAAC+Phase+1X+Activity+9+Ground+Procedure

bays:
# 3D coordinates for symbolic bays in ISS Analysis Coordinate System used by Astrobee
jem_bay1: [11.0, -4.0, 4.8]
jem_bay2: [11.0, -5.0, 4.8]
jem_bay3: [11.0, -6.0, 4.8]
jem_bay4: [11.0, -7.0, 4.8]
jem_bay5: [11.0, -8.0, 4.8]
jem_bay6: [11.0, -9.0, 4.8]
jem_bay7: [11.0, -9.7, 4.8]

bogus_bays: [jem_bay0, jem_bay8]
berths: [berth1, berth2]
robots: [bumble, honey]
num_orders: 10

stereo:
# Meta-data about stereo survey options
jem_bay1_to_bay3:
# fplan: Name of external fplan specification of trajectory in astrobee_ops/gds/plans/ISAAC/
fplan: "jem_stereo_mapping_bay1_to_bay3.fplan"
# base_location: Where trajectory starts and ends for planning purposes (rough location, not exact)
base_location: jem_bay1
# bound_location: The other end of the interval covered by the trajectory, for planner collision
# check purposes. (Note a trajectory may fly a bit into a bay that it doesn't claim to cover.
# The two surveys that cover the module purposefully overlap.)
bound_location: jem_bay4
jem_bay4_to_bay7:
fplan: "jem_stereo_mapping_bay4_to_bay7.fplan"
base_location: jem_bay7
bound_location: jem_bay4
31 changes: 31 additions & 0 deletions astrobee/survey_manager/survey_planner/data/sample_output_plan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$ time popf domain_survey.pddl problem_jem_survey.pddl
Constructing lookup tables: [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
Post filtering unreachable actions: [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
3% of the ground temporal actions in this problem are compression-safe
b (25.000 | 30.000)b (24.000 | 50.001)b (23.000 | 70.002)b (22.000 | 90.003)b (21.000 | 990.004)b (20.000 | 990.004)b (19.000 | 1010.005)b (18.000 | 1910.006)b (17.000 | 1910.006)b (16.000 | 1930.007)b (15.000 | 2830.008)b (14.000 | 2830.008)b (13.000 | 2850.009)b (12.000 | 3750.010)b (11.000 | 3750.010)b (10.000 | 4350.011)b (9.000 | 4350.011)b (8.000 | 4350.011)b (7.000 | 4350.011)b (6.000 | 4350.011)b (5.000 | 4350.011)b (4.000 | 5270.013)b (3.000 | 5270.013)b (2.000 | 5290.014)b (1.000 | 5310.015);;;; Solution Found
; Time 0.56
0.000: (undock bumble berth1 jem_bay7 jem_bay8 jem_bay6) [30.000]
30.001: (move bumble jem_bay7 jem_bay6 jem_bay5) [20.000]
50.002: (move bumble jem_bay6 jem_bay5 jem_bay4) [20.000]
70.003: (move bumble jem_bay5 jem_bay4 jem_bay3) [20.000]
70.003: (undock honey berth2 jem_bay7 jem_bay8 jem_bay6) [30.000]
90.004: (panorama bumble o0 jem_bay4 run1) [900.000]
100.004: (panorama honey o0 jem_bay7 run1) [900.000]
990.005: (move bumble jem_bay4 jem_bay3 jem_bay2) [20.000]
1000.005: (move honey jem_bay7 jem_bay6 jem_bay5) [20.000]
1010.006: (panorama bumble o1 jem_bay3 run1) [900.000]
1020.006: (panorama honey o1 jem_bay6 run1) [900.000]
1910.007: (move bumble jem_bay3 jem_bay2 jem_bay1) [20.000]
1930.008: (panorama bumble o2 jem_bay2 run1) [900.000]
2830.009: (move bumble jem_bay2 jem_bay1 jem_bay0) [20.000]
2850.010: (panorama bumble o3 jem_bay1 run1) [900.000]
3750.011: (stereo bumble o4 jem_bay1 jem_bay4 jem_bay5 jem_bay3 run1) [600.000]
4350.012: (move honey jem_bay6 jem_bay5 jem_bay4) [20.000]
4370.013: (panorama honey o2 jem_bay5 run1) [900.000]
5270.014: (move honey jem_bay5 jem_bay6 jem_bay7) [20.000]
5290.015: (move honey jem_bay6 jem_bay7 jem_bay8) [20.000]
5310.016: (dock honey jem_bay7 berth2) [30.000]

real 0m0.585s
user 0m0.553s
sys 0m0.032s
Loading

0 comments on commit c84eff2

Please sign in to comment.