Skip to content

Commit

Permalink
Remove toMessage() in favor of static_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
sjahr committed Oct 27, 2023
1 parent 591bfa1 commit 954dc76
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 0 additions & 21 deletions moveit_core/planning_interface/src/planning_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<moveit_msgs::msg::MotionPlanRequest>(req));
}

// ---------------------------------
Expand Down

0 comments on commit 954dc76

Please sign in to comment.