Skip to content

Commit

Permalink
changing package name from survey_planner to survey_manager (#155)
Browse files Browse the repository at this point in the history
* changing package name from survey_planner to survey_manager

* fix typo
  • Loading branch information
marinagmoreira committed Mar 4, 2024
1 parent 1897f0c commit cf120eb
Show file tree
Hide file tree
Showing 78 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Test CI for Pull Requests

on:
pull_request:
branches: [ 'master', 'develop', 'survey_manager' ]
branches: [ 'master', 'develop' ]
workflow_dispatch:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Run black
run: |
black . --diff --extend-exclude=cmake --extend-exclude=submodules --extend-exclude=astrobee/survey_manager/survey_dependencies --check
black . --diff --extend-exclude=cmake --extend-exclude=submodules --extend-exclude=astrobee/survey/survey_dependencies --check
- name: Run isort
run: |
isort . --diff --extend-skip=cmake --extend-skip=submodules --extend-skip=astrobee/survey_manager/survey_dependencies --profile=black --check-only
isort . --diff --extend-skip=cmake --extend-skip=submodules --extend-skip=astrobee/survey/survey_dependencies --profile=black --check-only
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
path = communications/isaac_msgs
url = https://github.com/nasa/isaac_msgs.git
[submodule "ros2_planning_system"]
path = astrobee/survey_manager/survey_dependencies/ros2_planning_system
path = astrobee/survey/survey_dependencies/ros2_planning_system
url = https://github.com/bckempa/ros2_planning_system
branch = noetic-devel
[submodule "ros1_lifecycle"]
path = astrobee/survey_manager/survey_dependencies/ros1_lifecycle
path = astrobee/survey/survey_dependencies/ros1_lifecycle
url = https://github.com/bckempa/ros1_lifecycle.git
branch = noetic-devel
[submodule "popf"]
path = astrobee/survey_manager/survey_dependencies/popf
path = astrobee/survey/survey_dependencies/popf
url = https://github.com/Bckempa/popf.git
branch = noetic-devel
[submodule "optic_planner"]
path = astrobee/survey_manager/survey_dependencies/optic_planner
path = astrobee/survey/survey_dependencies/optic_planner
url = https://github.com/Bckempa/optic_planner.git
branch = noetic-devel
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# folder, you can auto-update it by running
# scripts/git/configure_isort_paths.sh.

src_paths = analyst/workspace/scripts,anomaly/gmm-change-detection,anomaly/gmm-change-detection/scripts/gmm,anomaly/image/scripts,astrobee/behaviors/inspection/scripts,astrobee/simulation/acoustics_cam/src,astrobee/survey_manager/survey_planner,astrobee/survey_manager/survey_planner/scripts,astrobee/survey_manager/survey_planner/src/survey_planner,astrobee/survey_manager/survey_planner/tools/bak,communications/isaac_msgs/isaac_msgs/test,dense_map/geometry_mapper/tools,dense_map/volumetric_mapper/scripts,pano/pano_stitch/scripts,pano/pano_view/scripts,scripts/git
src_paths = analyst/workspace/scripts,anomaly/gmm-change-detection,anomaly/gmm-change-detection/scripts/gmm,anomaly/image/scripts,astrobee/behaviors/inspection/scripts,astrobee/simulation/acoustics_cam/src,astrobee/survey/survey_manager,astrobee/survey/survey_manager/scripts,astrobee/survey/survey_manager/src/survey_manager,astrobee/survey/survey_manager/tools/bak,communications/isaac_msgs/isaac_msgs/test,dense_map/geometry_mapper/tools,dense_map/volumetric_mapper/scripts,pano/pano_stitch/scripts,pano/pano_view/scripts,scripts/git
5 changes: 5 additions & 0 deletions astrobee/survey/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
\page survey Survey

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

\subpage survey_manager : Planning and scheduling of queued survey actions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.

cmake_minimum_required(VERSION 3.5)
project(survey_planner)
project(survey_manager)

set(CMAKE_CXX_STANDARD 17)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ set -eu -o pipefail
THIS_FILE=$(readlink -f "$0")
THIS_DIR=$(dirname "${THIS_FILE}")

SURVEY_PLANNER_DIR=$(readlink -f "${THIS_DIR}/../..")
PDDL_DIR="${SURVEY_PLANNER_DIR}/pddl"
DATA_DIR="${SURVEY_PLANNER_DIR}/data"
SURVEY_MANAGER_DIR=$(readlink -f "${THIS_DIR}/../..")
PDDL_DIR="${SURVEY_MANAGER_DIR}/pddl"
DATA_DIR="${SURVEY_MANAGER_DIR}/data"
CASES_DIR="${DATA_DIR}/test_cases"
DOMAIN="${PDDL_DIR}/domain_survey.pddl"
cd "${THIS_DIR}"
Expand All @@ -40,11 +40,11 @@ for i in "${TEST_CASES[@]}"; do
{ echo -e "\n=== $i ==="; } 2> /dev/null
PROBLEM="${CASES_DIR}/${i}_problem.pddl"
PLAN="${CASES_DIR}/${i}_plan.pddl"
rosrun survey_planner problem_generator.py "--config=${DATA_DIR}/survey_static.yaml,${CASES_DIR}/${i}_config.yaml" "--output=${PROBLEM}"
rosrun survey_manager problem_generator.py "--config=${DATA_DIR}/survey_static.yaml,${CASES_DIR}/${i}_config.yaml" "--output=${PROBLEM}"
# Try to eliminate variation in problem.pddl due to embedding different local install paths in the output.
perl -i -ple "s:${SURVEY_PLANNER_DIR}/::g;" "${PROBLEM}"
rosrun survey_planner plan_survey.py "${DOMAIN}" "${PROBLEM}" > "${PLAN}"
perl -i -ple "s:${SURVEY_MANAGER_DIR}/::g;" "${PROBLEM}"
rosrun survey_manager plan_survey.py "${DOMAIN}" "${PROBLEM}" > "${PLAN}"
{ echo "[plan_survey.py stdout redirected to ${PLAN}]"; } 2> /dev/null
rosrun popf validate -t 0.0001 -e "${DOMAIN}" "${PROBLEM}" "${PLAN}"
rosrun survey_planner plan_interpreter.py "--plan=${PLAN}" "--plot=${CASES_DIR}/${i}_plot.png" "--output=${CASES_DIR}/${i}_plan.yaml"
rosrun survey_manager plan_interpreter.py "--plan=${PLAN}" "--plot=${CASES_DIR}/${i}_plot.png" "--output=${CASES_DIR}/${i}_plan.yaml"
done
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

#ifndef SURVEY_PLANNER_ISAAC_ACTION_NODE_H_
#define SURVEY_PLANNER_ISAAC_ACTION_NODE_H_
#ifndef SURVEY_MANAGER_ISAAC_ACTION_NODE_H_
#define SURVEY_MANAGER_ISAAC_ACTION_NODE_H_

#include <plansys2_executor/ActionExecutorClient.hpp>

Expand Down Expand Up @@ -48,4 +48,4 @@ class IsaacAction : public plansys2::ActionExecutorClient {
// Main entry point for application
int isaac_action_main(int argc, char *argv[], const char* action_name);

#endif // SURVEY_PLANNER_ISAAC_ACTION_NODE_H_
#endif // SURVEY_MANAGER_ISAAC_ACTION_NODE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<arg name="quick" default="false" /> <!-- abbreviate longer actions for faster testing -->


<arg name="model_file" default="$(find survey_planner)/pddl/domain_survey.pddl"/>
<arg name="model_file" default="$(find survey_manager)/pddl/domain_survey.pddl"/>
<arg name="namespace" default="" />
<arg name="params_file" default="$(find survey_planner)/params/plansys2_$(arg planner)_params.yaml" />
<arg name="params_file" default="$(find survey_manager)/params/plansys2_$(arg planner)_params.yaml" />

<!-- true: There is a lifecycle management node for the Lifecycles nodes. If false, the nodes start on their own -->
<param name="lifecycle_enabled" value="$(arg lifecycle)"/>
Expand Down Expand Up @@ -49,29 +49,29 @@
</group>

<!-- Actions -->
<node name="move_action_node1" pkg="survey_planner" type="move_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="move_action_node1" pkg="survey_manager" type="move_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
<node name="move_action_node2" pkg="survey_planner" type="move_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="move_action_node2" pkg="survey_manager" type="move_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>

<node name="dock_action_node1" pkg="survey_planner" type="dock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="dock_action_node1" pkg="survey_manager" type="dock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
<node name="dock_action_node2" pkg="survey_planner" type="dock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="dock_action_node2" pkg="survey_manager" type="dock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>

<node name="undock_action_node1" pkg="survey_planner" type="undock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="undock_action_node1" pkg="survey_manager" type="undock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
<node name="undock_action_node2" pkg="survey_planner" type="undock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="undock_action_node2" pkg="survey_manager" type="undock_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>

<node name="panorama_action_node1" pkg="survey_planner" type="panorama_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="panorama_action_node1" pkg="survey_manager" type="panorama_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
<node name="panorama_action_node2" pkg="survey_planner" type="panorama_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="panorama_action_node2" pkg="survey_manager" type="panorama_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>

<node name="stereo_action_node1" pkg="survey_planner" type="stereo_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="stereo_action_node1" pkg="survey_manager" type="stereo_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
<node name="stereo_action_node2" pkg="survey_planner" type="stereo_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
<node name="stereo_action_node2" pkg="survey_manager" type="stereo_action_node" output="screen" args="$(eval '--quick' if arg('quick') else '')">
</node>
</launch>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<package format="2">
<name>survey_planner</name>
<name>survey_manager</name>
<version>0.1.0</version>
<description>PDDL Planning via Plansys2 on ROS1 Noetic for Astrobee</description>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ planner:
arguments: "-N"
TREY:
plugin: "plansys2/OPTICPlanSolver"
command: "rosrun survey_planner plan_survey"
command: "rosrun survey_manager plan_survey"
POPF:
plugin: "plansys2/POPFPlanSolver"
TFD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ planner:
arguments: "-N"
TREY:
plugin: "plansys2/OPTICPlanSolver"
command: "rosrun survey_planner plan_survey"
command: "rosrun survey_manager plan_survey"
POPF:
plugin: "plansys2/POPFPlanSolver"
TFD:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
\page survey_planner Survey Planner
\page survey_manager Survey Planner

Planning and scheduling of queued survey actions using Playsys2 for PDDL solutions and behavior trees for execution.

Based on [preliminary work](https://github.com/traclabs/astrobee_task_planning_ws) by [Ana](https://github.com/ana-GT) at [Traclabs](https://traclabs.com).

## Starting survey planner

The survey_planner as of now starts separately from the isaac fsw. This is necessary because the planner crashes very easily, so having the ability to easily restart this component is necessary.
The survey_manager as of now starts separately from the isaac fsw. This is necessary because the planner crashes very easily, so having the ability to easily restart this component is necessary.

To start the planner and the terminal interface (in the robot, add the prefix `/opt/isaac/env_wrapper.sh`):

roslaunch survey_planner survey_domain.launch
roslaunch survey_manager survey_domain.launch
rosrun plansys2_terminal plansys2_terminal

To monitor an execution and to input commands to the execution:

rosrun survey_planner monitor_astrobee $ROBOTNAME
rosrun survey_manager monitor_astrobee $ROBOTNAME

## Running actions manually

There are 5 different actions at the moment 'move', 'dock', 'undock', 'panorama', 'stereo'.
To run each action individually through the survey_planner you must add the correct predicates before sending the action command or else the plansys2 executor will crash. Also, if you want to re-send the action you'll want to re-send the predicates too.
To run each action individually through the survey_manager you must add the correct predicates before sending the action command or else the plansys2 executor will crash. Also, if you want to re-send the action you'll want to re-send the predicates too.

Don't forget to change the commands to use the target robot's name (bumble is what is used in simulation)

If the survey_planner crashes sometimes the simulation has to be restarted for it to restart in a good state.
If the survey_manager crashes sometimes the simulation has to be restarted for it to restart in a good state.

\subpage action_testing

Expand Down Expand Up @@ -115,7 +115,7 @@ source "${ISAAC_WS}/devel/setup.bash"
4. Start the survey manager:
```bash
# === In terminal 2 ===
roslaunch survey_planner survey.launch quick:=true
roslaunch survey_manager survey.launch quick:=true
# roslaunch will run indefinitely. Press Ctrl-C to shut down the system.
# The quick:=true flag speeds up longer actions (for sim use only).
Expand All @@ -137,8 +137,8 @@ source "${ISAAC_WS}/devel/setup.bash"
EOF
cat <<EOF >/tmp/plan_and_run.bash
data="${ISAAC_WS}/src/astrobee/survey_manager/survey_planner/data"
rosrun survey_planner problem_generator --terminal "--config=\${data}/jem_survey_static.yaml,\${data}/jem_survey_dynamic.yaml" --output=/tmp/problem.ps2.pddl
data="${ISAAC_WS}/src/astrobee/survey_manager/survey_manager/data"
rosrun survey_manager problem_generator --terminal "--config=\${data}/jem_survey_static.yaml,\${data}/jem_survey_dynamic.yaml" --output=/tmp/problem.ps2.pddl
cat /tmp/term_commands.txt | rosrun plansys2_terminal plansys2_terminal
EOF
Expand Down Expand Up @@ -170,5 +170,5 @@ source "${ISAAC_WS}/devel/setup.bash"
frames. To connect to the action running on a robot, choose the
robot and run like this:
```bash
rosrun survey_planner monitor_astrobee bumble # or honey
rosrun survey_manager monitor_astrobee bumble # or honey
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(packages=["survey_planner"], package_dir={"": "src"})
d = generate_distutils_setup(packages=["survey_manager"], package_dir={"": "src"})

setup(**d)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#include <survey_planner/isaac_action_node.h>
#include <survey_manager/isaac_action_node.h>

int main(int argc, char *argv[]) {
return isaac_action_main(argc, argv, "dock");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <string>
#include <vector>

#include "survey_planner/isaac_action_node.h"
#include "survey_manager/isaac_action_node.h"

namespace plansys2_actions {

Expand Down Expand Up @@ -122,7 +122,7 @@ class PopenReader {
// Return the estimated duration (seconds) of action `action_name`. Queried from PDDL model. On
// query error, return a default value of one minute.
double get_action_duration(const std::string& action_name) {
std::string cmd = std::string("rosrun survey_planner pddl_query action_duration ") + action_name;
std::string cmd = std::string("rosrun survey_manager pddl_query action_duration ") + action_name;
printf("get_action_duration %s: running query: %s\n", action_name.c_str(), cmd.c_str());

const double default_duration = 60.0; // one minute
Expand Down Expand Up @@ -176,7 +176,7 @@ void IsaacAction::do_work() {
}
command_ = std::string("(") + args_str + ")";
std::string quick_str = quick_ ? "--quick " : "";
std::string command_astrobee_call = std::string("rosrun survey_planner command_astrobee ") + quick_str + args_str;
std::string command_astrobee_call = std::string("rosrun survey_manager command_astrobee ") + quick_str + args_str;

start_time_ = ros::Time::now();
pid_ = fork();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#include <survey_planner/isaac_action_node.h>
#include <survey_manager/isaac_action_node.h>

int main(int argc, char *argv[]) {
return isaac_action_main(argc, argv, "move");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#include <survey_planner/isaac_action_node.h>
#include <survey_manager/isaac_action_node.h>

int main(int argc, char *argv[]) {
return isaac_action_main(argc, argv, "panorama");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#include <survey_planner/isaac_action_node.h>
#include <survey_manager/isaac_action_node.h>

int main(int argc, char *argv[]) {
return isaac_action_main(argc, argv, "stereo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
)
from std_msgs.msg import Header, String

# Imports from survey_planner package
from survey_planner.problem_generator import (
# Imports from survey_manager package
from survey_manager.problem_generator import (
YamlMapping,
load_yaml,
yaml_action_from_pddl,
Expand Down Expand Up @@ -855,10 +855,10 @@ class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter):
def main():
default_config_paths = [
os.path.join(
rospkg.RosPack().get_path("survey_planner"), "data/jem_survey_static.yaml"
rospkg.RosPack().get_path("survey_manager"), "data/jem_survey_static.yaml"
),
os.path.join(
rospkg.RosPack().get_path("survey_planner"),
rospkg.RosPack().get_path("survey_manager"),
"data/granite_survey_static.yaml",
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import pathlib
from typing import List

from survey_planner.plan_survey import get_action_durations, parse_pddl
from survey_planner.problem_generator import PDDL_DIR
from survey_manager.plan_survey import get_action_durations, parse_pddl
from survey_manager.problem_generator import PDDL_DIR


@enum.unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from matplotlib import patches as mp
from matplotlib import pyplot as plt

from survey_planner.problem_generator import (
from survey_manager.problem_generator import (
DATA_DIR,
get_stereo_traj,
load_yaml,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import pyparsing as pp
import yaml

from survey_planner.problem_generator import PDDL_DIR
from survey_manager.problem_generator import PDDL_DIR

LocationName = str # Names PDDL object of type location
LocationIndex = int # Index of location in CONFIG.locations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
CWD = pathlib.Path.cwd()
rospack = rospkg.RosPack()
DATA_DIR = pathlib.Path(
os.path.relpath(pathlib.Path(rospack.get_path("survey_planner")) / "data", CWD)
os.path.relpath(pathlib.Path(rospack.get_path("survey_manager")) / "data", CWD)
)
PDDL_DIR = pathlib.Path(
os.path.relpath(pathlib.Path(rospack.get_path("survey_planner")) / "pddl", CWD)
os.path.relpath(pathlib.Path(rospack.get_path("survey_manager")) / "pddl", CWD)
)
DEFAULT_CONFIGS = [
DATA_DIR / "jem_survey_static.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#include <survey_planner/isaac_action_node.h>
#include <survey_manager/isaac_action_node.h>

int main(int argc, char *argv[]) {
return isaac_action_main(argc, argv, "undock");
Expand Down
Loading

0 comments on commit cf120eb

Please sign in to comment.