Skip to content

Commit 98000f3

Browse files
committed
Merge branch 'master' into ros2
2 parents bbc34d2 + 8d2baf2 commit 98000f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+627
-445
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This repository provides the following branches:
2424

2525
## Tutorial
2626

27-
We provide a tutorial for a pick-and-place pipeline without bells & whistles [as part of the MoveIt tutorials](https://ros-planning.github.io/moveit_tutorials/doc/moveit_task_constructor/moveit_task_constructor_tutorial.html).
27+
We provide a tutorial for a pick-and-place pipeline without bells & whistles [as part of the MoveIt tutorials](https://moveit.github.io/moveit_tutorials/doc/moveit_task_constructor/moveit_task_constructor_tutorial.html).
2828

2929
## Roadmap
3030

capabilities/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ project(moveit_task_constructor_capabilities)
33

44
find_package(ament_cmake REQUIRED)
55

6+
find_package(fmt REQUIRED)
67
find_package(Boost REQUIRED)
78
find_package(moveit_common REQUIRED)
89
moveit_package()
@@ -20,6 +21,7 @@ add_library(${PROJECT_NAME} SHARED
2021
)
2122
ament_target_dependencies(${PROJECT_NAME}
2223
Boost
24+
fmt
2325
rclcpp_action
2426
moveit_core
2527
moveit_ros_move_group

capabilities/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<buildtool_depend>ament_cmake</buildtool_depend>
1414

15+
<depend>fmt</depend>
1516
<depend>moveit_core</depend>
1617
<depend>moveit_ros_move_group</depend>
1718
<depend>moveit_ros_planning</depend>

capabilities/src/execute_task_solution_capability.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
#include <moveit/move_group/capability_names.h>
4444
#include <moveit/robot_state/conversions.h>
4545
#include <moveit/utils/message_checks.h>
46-
#include <moveit/moveit_cpp/moveit_cpp.h>
47-
48-
#include <boost/algorithm/string/join.hpp>
46+
#include <fmt/format.h>
4947

5048
namespace {
5149

@@ -164,8 +162,8 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
164162
if (!joint_names.empty()) {
165163
group = findJointModelGroup(*model, joint_names);
166164
if (!group) {
167-
RCLCPP_ERROR_STREAM(LOGGER, "Could not find JointModelGroup that actuates {"
168-
<< boost::algorithm::join(joint_names, ", ") << "}");
165+
RCLCPP_ERROR_STREAM(LOGGER, fmt::format("Could not find JointModelGroup that actuates {{{}}}",
166+
fmt::join(joint_names, ", ")));
169167
return false;
170168
}
171169
RCLCPP_DEBUG(LOGGER, "Using JointModelGroup '%s' for execution", group->getName().c_str());

core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(moveit_task_constructor_core)
44
find_package(ament_cmake REQUIRED)
55

66
find_package(Boost REQUIRED)
7+
find_package(fmt REQUIRED)
78
find_package(geometry_msgs REQUIRED)
89
find_package(moveit_common REQUIRED)
910
moveit_package()

core/doc/tutorials/properties.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ You can obtain a reference to the the PropertyMap of a stage like so
9797
:start-after: [propertyTut10]
9898
:end-before: [propertyTut10]
9999

100-
.. literalinclude:: ../../../demo/scripts/properties.py
101-
:language: python
102-
:start-after: [propertyTut11]
103-
:end-before: [propertyTut11]
104-
105100

106101
As mentioned, each stage contains a PropertyMap.
107102
Stages communicate to each other via their interfaces.

core/include/moveit/task_constructor/container.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class ContainerBase : public Stage
5151
PRIVATE_CLASS(ContainerBase)
5252
using pointer = std::unique_ptr<ContainerBase>;
5353

54+
/// Explicitly enable/disable pruning
55+
void setPruning(bool pruning) { setProperty("pruning", pruning); }
56+
bool pruning() const { return properties().get<bool>("pruning"); }
57+
5458
size_t numChildren() const;
5559
Stage* findChild(const std::string& name) const;
5660
Stage* operator[](int index) const;

core/include/moveit/task_constructor/cost_terms.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class LambdaCostTerm : public TrajectoryCostTerm
9595
LambdaCostTerm(const SubTrajectorySignature& term);
9696
LambdaCostTerm(const SubTrajectoryShortSignature& term);
9797

98+
using TrajectoryCostTerm::operator();
9899
double operator()(const SubTrajectory& s, std::string& comment) const override;
99100

100101
protected:
@@ -132,6 +133,8 @@ class PathLength : public TrajectoryCostTerm
132133
PathLength(std::vector<std::string> joints);
133134
/// Limit measurements to given joints and use given weighting
134135
PathLength(std::map<std::string, double> j) : joints(std::move(j)) {}
136+
137+
using TrajectoryCostTerm::operator();
135138
double operator()(const SubTrajectory& s, std::string& comment) const override;
136139

137140
std::map<std::string, double> joints; //< joint weights
@@ -145,6 +148,8 @@ class DistanceToReference : public TrajectoryCostTerm
145148
std::map<std::string, double> w = std::map<std::string, double>());
146149
DistanceToReference(const std::map<std::string, double>& ref, Mode m = Mode::AUTO,
147150
std::map<std::string, double> w = std::map<std::string, double>());
151+
152+
using TrajectoryCostTerm::operator();
148153
double operator()(const SubTrajectory& s, std::string& comment) const override;
149154

150155
moveit_msgs::msg::RobotState reference;
@@ -156,6 +161,7 @@ class DistanceToReference : public TrajectoryCostTerm
156161
class TrajectoryDuration : public TrajectoryCostTerm
157162
{
158163
public:
164+
using TrajectoryCostTerm::operator();
159165
double operator()(const SubTrajectory& s, std::string& comment) const override;
160166
};
161167

@@ -167,6 +173,7 @@ class LinkMotion : public TrajectoryCostTerm
167173

168174
std::string link_name;
169175

176+
using TrajectoryCostTerm::operator();
170177
double operator()(const SubTrajectory& s, std::string& comment) const override;
171178
};
172179

@@ -191,6 +198,7 @@ class Clearance : public TrajectoryCostTerm
191198

192199
std::function<double(double)> distance_to_cost;
193200

201+
using TrajectoryCostTerm::operator();
194202
double operator()(const SubTrajectory& s, std::string& comment) const override;
195203
};
196204

core/include/moveit/task_constructor/solvers/cartesian_path.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class CartesianPath : public PlannerInterface
5252
public:
5353
CartesianPath();
5454

55+
void setIKFrame(const geometry_msgs::msg::PoseStamped& pose) { setProperty("ik_frame", pose); }
56+
void setIKFrame(const Eigen::Isometry3d& pose, const std::string& link);
57+
void setIKFrame(const std::string& link) { setIKFrame(Eigen::Isometry3d::Identity(), link); }
58+
5559
void setStepSize(double step_size) { setProperty("step_size", step_size); }
5660
void setJumpThreshold(double jump_threshold) { setProperty("jump_threshold", jump_threshold); }
5761
void setMinFraction(double min_fraction) { setProperty("min_fraction", min_fraction); }

core/include/moveit/task_constructor/solvers/multi_planner.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ class MultiPlanner : public PlannerInterface, public std::vector<solvers::Planne
7171
const Eigen::Isometry3d& offset, const Eigen::Isometry3d& target,
7272
const moveit::core::JointModelGroup* jmg, double timeout, robot_trajectory::RobotTrajectoryPtr& result,
7373
const moveit_msgs::msg::Constraints& path_constraints = moveit_msgs::msg::Constraints()) override;
74+
75+
std::string getPlannerId() const override { return "MultiPlanner"; }
7476
};
7577
} // namespace solvers
7678
} // namespace task_constructor

0 commit comments

Comments
 (0)