From b2cda90f1604e0e83ef4bf117330161a545706c2 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 17 Oct 2023 21:08:16 -0700 Subject: [PATCH] Fix move bug Signed-off-by: methylDragon --- nexus_motion_planner/src/motion_plan_cache.cpp | 4 ++-- nexus_motion_planner/src/motion_planner_server.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nexus_motion_planner/src/motion_plan_cache.cpp b/nexus_motion_planner/src/motion_plan_cache.cpp index e412812..3541f9c 100644 --- a/nexus_motion_planner/src/motion_plan_cache.cpp +++ b/nexus_motion_planner/src/motion_plan_cache.cpp @@ -945,8 +945,8 @@ MotionPlanCache::construct_get_cartesian_plan_request( moveit_msgs::msg::MotionPlanRequest tmp; move_group.constructMotionPlanRequest(tmp); - out.start_state = tmp.start_state; - out.group_name = tmp.group_name; + out.start_state = std::move(tmp.start_state); + out.group_name = std::move(tmp.group_name); out.max_velocity_scaling_factor = tmp.max_velocity_scaling_factor; out.max_acceleration_scaling_factor = tmp.max_acceleration_scaling_factor; diff --git a/nexus_motion_planner/src/motion_planner_server.cpp b/nexus_motion_planner/src/motion_planner_server.cpp index 055aae3..58d9208 100644 --- a/nexus_motion_planner/src/motion_planner_server.cpp +++ b/nexus_motion_planner/src/motion_planner_server.cpp @@ -695,8 +695,8 @@ void MotionPlannerServer::plan_with_move_group( } } - res->result.trajectory_start = - std::move(cartesian_plan_req_msg.start_state); + // Do NOT move this. We use the cartesian_plan_req_msg later. + res->result.trajectory_start = cartesian_plan_req_msg.start_state; res->result.trajectory = std::move(cartesian_plan); if (res->result.error_code.val !=