Skip to content

Commit 233d63a

Browse files
v4hnrhaschke
authored andcommitted
avoid deprecation warnings of MoveIt master branch
Use new methods - moveit::core::isEmpty - moveit::core::CartesianInterpolator::computeCartesianPath
1 parent e4920ce commit 233d63a

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

capabilities/src/execute_task_solution_capability.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
#include <moveit/kinematic_constraints/utils.h>
4242
#include <moveit/move_group/capability_names.h>
4343
#include <moveit/robot_state/conversions.h>
44+
#if MOVEIT_MASTER
45+
#include <moveit/utils/message_checks.h>
46+
#endif
4447

4548
namespace {
4649

@@ -167,14 +170,22 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
167170

168171
/* TODO add action feedback and markers */
169172
exec_traj.effect_on_success_ = [this, sub_traj, description](const plan_execution::ExecutableMotionPlan*) {
173+
#if MOVEIT_MASTER
174+
if (!moveit::core::isEmpty(sub_traj.scene_diff)) {
175+
#else
170176
if (!planning_scene::PlanningScene::isEmpty(sub_traj.scene_diff)) {
177+
#endif
171178
ROS_DEBUG_STREAM_NAMED("ExecuteTaskSolution", "apply effect of " << description);
172179
return context_->planning_scene_monitor_->newPlanningSceneMessage(sub_traj.scene_diff);
173180
}
174181
return true;
175182
};
176183

184+
#if MOVEIT_MASTER
185+
if (!moveit::core::isEmpty(sub_traj.scene_diff.robot_state) &&
186+
#else
177187
if (!planning_scene::PlanningScene::isEmpty(sub_traj.scene_diff.robot_state) &&
188+
#endif
178189
!moveit::core::robotStateMsgToRobotState(sub_traj.scene_diff.robot_state, state, true)) {
179190
ROS_ERROR_STREAM_NAMED("ExecuteTaskSolution",
180191
"invalid intermediate robot state in scene diff of SubTrajectory " << description);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace solvers {
4646

4747
MOVEIT_CLASS_FORWARD(CartesianPath)
4848

49-
/** Use RobotState's computeCartesianPath() to generate a straigh-line path between to scenes */
49+
/** Use MoveIt's computeCartesianPath() to generate a straigh-line path between to scenes */
5050
class CartesianPath : public PlannerInterface
5151
{
5252
public:

core/src/solvers/cartesian_path.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#include <moveit/task_constructor/solvers/cartesian_path.h>
4040
#include <moveit/planning_scene/planning_scene.h>
4141
#include <moveit/trajectory_processing/iterative_time_parameterization.h>
42+
#if MOVEIT_MASTER
43+
#include <moveit/robot_state/cartesian_interpolator.h>
44+
#endif
4245

4346
namespace moveit {
4447
namespace task_constructor {
@@ -86,9 +89,16 @@ bool CartesianPath::plan(const planning_scene::PlanningSceneConstPtr& from, cons
8689
};
8790

8891
std::vector<moveit::core::RobotStatePtr> trajectory;
92+
#if MOVEIT_MASTER
93+
double achieved_fraction = moveit::core::CartesianInterpolator::computeCartesianPath(
94+
&(sandbox_scene->getCurrentStateNonConst()), jmg, trajectory, &link, target, true,
95+
moveit::core::MaxEEFStep(props.get<double>("step_size")),
96+
moveit::core::JumpThreshold(props.get<double>("jump_threshold")), isValid);
97+
#else
8998
double achieved_fraction = sandbox_scene->getCurrentStateNonConst().computeCartesianPath(
9099
jmg, trajectory, &link, target, true, props.get<double>("step_size"), props.get<double>("jump_threshold"),
91100
isValid);
101+
#endif
92102

93103
if (!trajectory.empty()) {
94104
result.reset(new robot_trajectory::RobotTrajectory(sandbox_scene->getRobotModel(), jmg));

0 commit comments

Comments
 (0)