Skip to content

Commit

Permalink
Merge branch 'master' into wip-python-api
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Jun 11, 2021
2 parents 244c999 + 4aeab27 commit ced362f
Show file tree
Hide file tree
Showing 54 changed files with 397 additions and 236 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,24 @@ jobs:
NAME: ccov
TARGET_CMAKE_ARGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="--coverage"
- IMAGE: master-source
NAME: clang
CXX: clang++
CXXFLAGS: >-
-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function -Wno-deprecated-copy -Wno-unused-but-set-parameter
- IMAGE: noetic-source
CXX: clang++
CLANG_TIDY: true
CXXFLAGS: >-
-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function -Wno-deprecated-copy
- IMAGE: noetic-source
NAME: asan
DOCKER_RUN_OPTS: >-
-e PRELOAD=libasan.so.5
-e LSAN_OPTIONS="suppressions=$PWD/.github/workflows/lsan.suppressions"
TARGET_CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O1"

env:
CATKIN_LINT: true
CXXFLAGS: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls -Wno-deprecated-copy"
UNDERLAY: /root/ws_moveit/install
DOWNSTREAM_WORKSPACE: "github:ubi-agni/mtc_demos#master github:TAMS-Group/mtc_pour#master"
CCACHE_DIR: ${{ github.workspace }}/.ccache
Expand Down Expand Up @@ -58,7 +69,7 @@ jobs:
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
name: test-results-${{ matrix.env.IMAGE }}${{ matrix.env.NAME && '-' || ''}}${{ matrix.env.NAME }}
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
- name: Collect coverage information
uses: rhaschke/lcov-action@master
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lsan.suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leak:class_loader
1 change: 1 addition & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ catkin_package(
LIBRARIES
${PROJECT_NAME}
${PROJECT_NAME}_stages
${PROJECT_NAME}_stage_plugins
INCLUDE_DIRS
include
CATKIN_DEPENDS
Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/container_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(JointModelGroup)
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(JointModelGroup);
MOVEIT_CLASS_FORWARD(RobotState);
} // namespace core
} // namespace moveit

Expand Down
6 changes: 5 additions & 1 deletion core/include/moveit/task_constructor/cost_terms.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CostTerm
public:
CostTerm() = default;
CostTerm(std::nullptr_t) : CostTerm{} {}
virtual ~CostTerm() = default;

virtual double operator()(const SubTrajectory& s, std::string& comment) const;
virtual double operator()(const SolutionSequence& s, std::string& comment) const;
Expand Down Expand Up @@ -115,9 +116,12 @@ class Constant : public CostTerm
/// trajectory length (interpolated between waypoints)
class PathLength : public TrajectoryCostTerm
{
// TODO(v4hn): allow to consider specific joints only
public:
PathLength() = default;
PathLength(std::vector<std::string> j) : joints{ std::move(j) } {};
double operator()(const SubTrajectory& s, std::string& comment) const override;

std::vector<std::string> joints;
};

/// execution duration of the whole trajectory
Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/introspection.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
namespace moveit {
namespace task_constructor {

MOVEIT_CLASS_FORWARD(Stage)
MOVEIT_CLASS_FORWARD(SolutionBase)
MOVEIT_CLASS_FORWARD(Stage);
MOVEIT_CLASS_FORWARD(SolutionBase);

class TaskPrivate;
class IntrospectionPrivate;
Expand Down
6 changes: 3 additions & 3 deletions core/include/moveit/task_constructor/marker_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include <functional>

namespace planning_scene {
MOVEIT_CLASS_FORWARD(PlanningScene)
MOVEIT_CLASS_FORWARD(PlanningScene);
}
namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(LinkModel)
MOVEIT_CLASS_FORWARD(RobotState);
MOVEIT_CLASS_FORWARD(LinkModel);
} // namespace core
} // namespace moveit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace moveit {
namespace task_constructor {
namespace solvers {

MOVEIT_CLASS_FORWARD(CartesianPath)
MOVEIT_CLASS_FORWARD(CartesianPath);

/** Use MoveIt's computeCartesianPath() to generate a straigh-line path between to scenes */
class CartesianPath : public PlannerInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace moveit {
namespace task_constructor {
namespace solvers {

MOVEIT_CLASS_FORWARD(JointInterpolationPlanner)
MOVEIT_CLASS_FORWARD(JointInterpolationPlanner);

/** Interpolate a trajectory between states in joint space
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
#include <moveit/macros/class_forward.h>

namespace planning_pipeline {
MOVEIT_CLASS_FORWARD(PlanningPipeline)
MOVEIT_CLASS_FORWARD(PlanningPipeline);
}

namespace moveit {
namespace task_constructor {
namespace solvers {

MOVEIT_CLASS_FORWARD(PipelinePlanner)
MOVEIT_CLASS_FORWARD(PipelinePlanner);

/** Use MoveIt's PlanningPipeline to plan a trajectory between to scenes */
class PipelinePlanner : public PlannerInterface
Expand Down
12 changes: 6 additions & 6 deletions core/include/moveit/task_constructor/solvers/planner_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@
#include <Eigen/Geometry>

namespace planning_scene {
MOVEIT_CLASS_FORWARD(PlanningScene)
MOVEIT_CLASS_FORWARD(PlanningScene);
}
namespace robot_trajectory {
MOVEIT_CLASS_FORWARD(RobotTrajectory)
MOVEIT_CLASS_FORWARD(RobotTrajectory);
}
namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(LinkModel)
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(JointModelGroup)
MOVEIT_CLASS_FORWARD(LinkModel);
MOVEIT_CLASS_FORWARD(RobotModel);
MOVEIT_CLASS_FORWARD(JointModelGroup);
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
namespace solvers {

MOVEIT_CLASS_FORWARD(PlannerInterface)
MOVEIT_CLASS_FORWARD(PlannerInterface);
class PlannerInterface
{
// these properties take precedence over stage properties
Expand Down
12 changes: 6 additions & 6 deletions core/include/moveit/task_constructor/stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(RobotModel);
}
} // namespace moveit

namespace planning_scene {
MOVEIT_CLASS_FORWARD(PlanningScene)
MOVEIT_CLASS_FORWARD(PlanningScene);
}

namespace planning_pipeline {
MOVEIT_CLASS_FORWARD(PlanningPipeline)
MOVEIT_CLASS_FORWARD(PlanningPipeline);
}

namespace robot_trajectory {
MOVEIT_CLASS_FORWARD(RobotTrajectory)
MOVEIT_CLASS_FORWARD(RobotTrajectory);
}

namespace moveit {
Expand Down Expand Up @@ -108,8 +108,8 @@ constexpr InterfaceFlags UNKNOWN;
constexpr InterfaceFlags START_IF_MASK({ READS_START, WRITES_PREV_END });
constexpr InterfaceFlags END_IF_MASK({ READS_END, WRITES_NEXT_START });

MOVEIT_CLASS_FORWARD(Interface)
MOVEIT_CLASS_FORWARD(Stage)
MOVEIT_CLASS_FORWARD(Interface);
MOVEIT_CLASS_FORWARD(Stage);
class InterfaceState;
using InterfaceStatePair = std::pair<const InterfaceState&, const InterfaceState&>;

Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/stages/compute_ik.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(JointModelGroup)
MOVEIT_CLASS_FORWARD(RobotState);
MOVEIT_CLASS_FORWARD(JointModelGroup);
} // namespace core
} // namespace moveit

Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stages/connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(RobotState);
}
} // namespace moveit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(JointModelGroup)
MOVEIT_CLASS_FORWARD(JointModelGroup);
}
} // namespace moveit

Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stages/pick.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace moveit {
namespace task_constructor {

namespace solvers {
MOVEIT_CLASS_FORWARD(CartesianPath)
MOVEIT_CLASS_FORWARD(CartesianPath);
}

namespace stages {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(RobotState);
}
} // namespace moveit

Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stages/simple_grasp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(RobotModel);
}
} // namespace moveit
namespace moveit {
Expand Down
18 changes: 9 additions & 9 deletions core/include/moveit/task_constructor/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@
#include <functional>

namespace planning_scene {
MOVEIT_CLASS_FORWARD(PlanningScene)
MOVEIT_CLASS_FORWARD(PlanningScene);
}

namespace robot_trajectory {
MOVEIT_CLASS_FORWARD(RobotTrajectory)
MOVEIT_CLASS_FORWARD(RobotTrajectory);
}

namespace moveit {
namespace task_constructor {

class SolutionBase;
MOVEIT_CLASS_FORWARD(InterfaceState)
MOVEIT_CLASS_FORWARD(Interface)
MOVEIT_CLASS_FORWARD(Stage)
MOVEIT_CLASS_FORWARD(Introspection)
MOVEIT_CLASS_FORWARD(InterfaceState);
MOVEIT_CLASS_FORWARD(Interface);
MOVEIT_CLASS_FORWARD(Stage);
MOVEIT_CLASS_FORWARD(Introspection);

/** InterfaceState describes a potential start or goal state for a planning stage.
*
Expand Down Expand Up @@ -296,7 +296,7 @@ class SolutionBase
const InterfaceState* start_ = nullptr;
const InterfaceState* end_ = nullptr;
};
MOVEIT_CLASS_FORWARD(SolutionBase)
MOVEIT_CLASS_FORWARD(SolutionBase);

/// SubTrajectory connects interface states of ComputeStages
class SubTrajectory : public SolutionBase
Expand All @@ -318,7 +318,7 @@ class SubTrajectory : public SolutionBase
// actual trajectory, might be empty
robot_trajectory::RobotTrajectoryConstPtr trajectory_;
};
MOVEIT_CLASS_FORWARD(SubTrajectory)
MOVEIT_CLASS_FORWARD(SubTrajectory);

/** Sequence of individual sub solutions
*
Expand Down Expand Up @@ -350,7 +350,7 @@ class SolutionSequence : public SolutionBase
/// series of sub solutions
container_type subsolutions_;
};
MOVEIT_CLASS_FORWARD(SolutionSequence)
MOVEIT_CLASS_FORWARD(SolutionSequence);

/** Wrap an existing solution
*
Expand Down
11 changes: 6 additions & 5 deletions core/include/moveit/task_constructor/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(RobotModel);
MOVEIT_CLASS_FORWARD(RobotState);
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {

MOVEIT_CLASS_FORWARD(Stage)
MOVEIT_CLASS_FORWARD(ContainerBase)
MOVEIT_CLASS_FORWARD(Task)
MOVEIT_CLASS_FORWARD(Stage);
MOVEIT_CLASS_FORWARD(ContainerBase);
MOVEIT_CLASS_FORWARD(Task);

class TaskPrivate;
/** A Task is the root of a tree of stages.
Expand Down Expand Up @@ -151,6 +151,7 @@ class Task : protected WrapperBase
void onNewSolution(const SolutionBase& s) override;

private:
using WrapperBase::init;
};

inline std::ostream& operator<<(std::ostream& os, const Task& task) {
Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/task_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <moveit/task_constructor/task.h>

namespace robot_model_loader {
MOVEIT_CLASS_FORWARD(RobotModelLoader)
MOVEIT_CLASS_FORWARD(RobotModelLoader);
}

namespace moveit {
Expand Down
2 changes: 1 addition & 1 deletion core/motion_planning_stages_plugin_description.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<library path="libmoveit_task_constructor_core_stages">
<library path="libmoveit_task_constructor_core_stage_plugins">
<class name="moveit_task_constructor/Current State"
type="moveit::task_constructor::stages::CurrentState"
base_class_type="moveit::task_constructor::Stage">
Expand Down
12 changes: 8 additions & 4 deletions core/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

# Add folders to be run by python nosetests
catkin_add_nosetests(test)

# Add rostests
add_rostest(test/rostest_mtc.test)
if(DEFINED ENV{PRELOAD})
message(WARNING "Skipping python tests due to asan")
else()
catkin_add_nosetests(test)

# Add rostests
add_rostest(test/rostest_mtc.test)
endif()
endif()

roslint_python()
2 changes: 1 addition & 1 deletion core/python/bindings/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void export_core(pybind11::module& m) {
return py::make_iterator(children.begin(), children.end());
}, py::keep_alive<0, 1>()) // keep container alive as long as iterator lives
.def("reset", &Task::reset)
.def("init", &Task::init)
.def("init", py::overload_cast<>(&Task::init))
.def("plan", &Task::plan, py::arg("max_solutions") = 0)
.def("preempt", &Task::preempt)
.def("publish", [](Task& self, const SolutionBasePtr& solution) {
Expand Down
Loading

0 comments on commit ced362f

Please sign in to comment.