From 954dc76b0b978b1287c9c82f2d3a3ba2da2ed570 Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Fri, 27 Oct 2023 13:05:25 +0200 Subject: [PATCH] Remove toMessage() in favor of static_cast --- .../planning_interface/planning_request.h | 2 -- .../src/planning_request.cpp | 21 ------------------- .../src/planning_pipeline.cpp | 2 +- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/moveit_core/planning_interface/include/moveit/planning_interface/planning_request.h b/moveit_core/planning_interface/include/moveit/planning_interface/planning_request.h index b288811c6db..0c9dd8c420c 100644 --- a/moveit_core/planning_interface/include/moveit/planning_interface/planning_request.h +++ b/moveit_core/planning_interface/include/moveit/planning_interface/planning_request.h @@ -50,8 +50,6 @@ struct MotionPlanRequest : moveit_msgs::msg::MotionPlanRequest MotionPlanRequest(moveit_msgs::msg::MotionPlanRequest request_msg = moveit_msgs::msg::MotionPlanRequest(), planning_interface::StateCostFn state_cost_function = nullptr); planning_interface::StateCostFn state_cost_function = nullptr; - - [[nodiscard]] moveit_msgs::msg::MotionPlanRequest toMessage() const; }; } // namespace planning_interface diff --git a/moveit_core/planning_interface/src/planning_request.cpp b/moveit_core/planning_interface/src/planning_request.cpp index 5cb4263a790..71ab7c5ae71 100644 --- a/moveit_core/planning_interface/src/planning_request.cpp +++ b/moveit_core/planning_interface/src/planning_request.cpp @@ -43,25 +43,4 @@ MotionPlanRequest::MotionPlanRequest(moveit_msgs::msg::MotionPlanRequest request : moveit_msgs::msg::MotionPlanRequest{ std::move(request_msg) }, state_cost_function{ std::move(state_cost_function) } { } - -moveit_msgs::msg::MotionPlanRequest MotionPlanRequest::toMessage() const -{ - moveit_msgs::msg::MotionPlanRequest request_msg; - request_msg.workspace_parameters = workspace_parameters; - request_msg.start_state = start_state; - request_msg.goal_constraints = goal_constraints; - request_msg.path_constraints = path_constraints; - request_msg.trajectory_constraints = trajectory_constraints; - request_msg.reference_trajectories = reference_trajectories; - request_msg.pipeline_id = pipeline_id; - request_msg.planner_id = planner_id; - request_msg.group_name = group_name; - request_msg.num_planning_attempts = num_planning_attempts; - request_msg.allowed_planning_time = allowed_planning_time; - request_msg.max_velocity_scaling_factor = max_velocity_scaling_factor; - request_msg.max_acceleration_scaling_factor = max_acceleration_scaling_factor; - request_msg.cartesian_speed_limited_link = cartesian_speed_limited_link; - request_msg.max_cartesian_speed = max_cartesian_speed; - return request_msg; -} } // namespace planning_interface diff --git a/moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp b/moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp index 232a2699e17..1f5ca98a8f4 100644 --- a/moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp +++ b/moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp @@ -203,7 +203,7 @@ bool planning_pipeline::PlanningPipeline::generatePlan(const planning_scene::Pla // broadcast the request we are about to work on, if needed if (publish_received_requests) { - received_request_publisher_->publish(req.toMessage()); + received_request_publisher_->publish(static_cast(req)); } // ---------------------------------