Skip to content

Commit

Permalink
Fix python modules and command_astrobee arguments (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoltin committed Jan 26, 2024
1 parent f3e5df1 commit 8b42ef1
Show file tree
Hide file tree
Showing 15 changed files with 300 additions and 73 deletions.
7 changes: 5 additions & 2 deletions astrobee/survey_manager/survey_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ catkin_python_setup()
catkin_package()

catkin_install_python(PROGRAMS
tools/survey_planner/command_astrobee
tools/survey_planner/monitor_astrobee
tools/command_astrobee
tools/monitor_astrobee
tools/plan_interpreter
tools/plan_survey
tools/problem_generator
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

# Mark executables and/or libraries for installation
Expand Down
2 changes: 1 addition & 1 deletion astrobee/survey_manager/survey_planner/setup.py
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={"": "tools"})
d = generate_distutils_setup(packages=["survey_planner"], package_dir={"": "src"})

setup(**d)
10 changes: 6 additions & 4 deletions astrobee/survey_manager/survey_planner/src/isaac_action_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <algorithm>
#include <string>
#include <vector>
#include <iostream>

#include "survey_planner/isaac_action_node.h"
Expand All @@ -43,7 +44,8 @@ IsaacAction::IsaacAction(ros::NodeHandle nh, const std::string& action, const st
void IsaacAction::do_work() {
std::string from, towards;

if (get_arguments().size() < 3) {
const std::vector<std::string>& command_args = get_arguments();
if (command_args.size() < 3) {
finish(false, 1.0, "Not enough arguments for [MOVE] command");
}

Expand All @@ -58,10 +60,10 @@ void IsaacAction::do_work() {
args[0] = "sh";
args[1] = "-c";
command_ = "rosrun survey_planner command_astrobee ";
for (const auto& arg : get_arguments()) {
command_ += arg + " ";
command_ += action_name_ + " ";
for (unsigned int i = 0; i < command_args.size(); i++) {
command_ += command_args[i] + " ";
}
command_ += "run1";
args[2] = command_.c_str();
args[3] = NULL;
printf("%s\n", args[2]);
Expand Down
Loading

0 comments on commit 8b42ef1

Please sign in to comment.