40 #include <rclcpp/rclcpp.hpp>
43 #include <geometry_msgs/msg/pose_stamped.hpp>
70 explicit operator bool()
const
86 void load(
const rclcpp::Node::SharedPtr& node)
88 std::string ns =
"plan_request_params.";
89 node->get_parameter_or(ns +
"planner_id",
planner_id, std::string(
""));
90 node->get_parameter_or(ns +
"planning_pipeline",
planning_pipeline, std::string(
""));
91 node->get_parameter_or(ns +
"planning_time",
planning_time, 1.0);
99 PlanningComponent(
const std::string& group_name,
const rclcpp::Node::SharedPtr& node);
129 void setWorkspace(
double minx,
double miny,
double minz,
double maxx,
double maxy,
double maxz);
146 bool setGoal(
const std::vector<moveit_msgs::msg::Constraints>& goal_constraints);
150 bool setGoal(
const geometry_msgs::msg::PoseStamped& goal_pose,
const std::string& link_name);
152 bool setGoal(
const std::string& named_target);
166 bool execute(
bool blocking =
true);
173 rclcpp::Node::SharedPtr node_;
174 MoveItCppPtr moveit_cpp_;
175 const std::string group_name_;
180 std::set<std::string> planning_pipeline_names_;
182 moveit::core::RobotStatePtr considered_start_state_;
183 std::vector<moveit_msgs::msg::Constraints> current_goal_constraints_;
184 moveit_msgs::msg::Constraints current_path_constraints_;
186 moveit_msgs::msg::WorkspaceParameters workspace_parameters_;
187 bool workspace_parameters_set_ =
false;
188 PlanSolutionPtr last_plan_solution_;
a wrapper around moveit_msgs::MoveItErrorCodes to make it easier to return an error code message from...
Representation of a robot's state. This includes position, velocity, acceleration and effort.
void setStartStateToCurrentState()
Set the start state for planning to be the current state of the robot.
bool setStartState(const moveit::core::RobotState &start_state)
Set the robot state that should be considered as start state for planning.
std::map< std::string, double > getNamedTargetStateValues(const std::string &name)
Get the joint values for targets specified by name.
PlanningComponent(PlanningComponent &&other)=delete
void unsetWorkspace()
Remove the workspace bounding box from planning.
PlanningComponent & operator=(PlanningComponent &&other)=delete
bool setGoal(const std::vector< moveit_msgs::msg::Constraints > &goal_constraints)
Set the goal constraints used for planning.
~PlanningComponent()=default
Destructor.
PlanSolution plan()
Run a plan from start or current state to fulfill the last goal constraints provided by setGoal() usi...
PlanningComponent & operator=(const PlanningComponent &)=delete
const std::string & getPlanningGroupName() const
Get the name of the planning group.
PlanningComponent(const PlanningComponent &)=delete
This class owns unique resources (e.g. action clients, threads) and its not very meaningful to copy....
MOVEIT_STRUCT_FORWARD(PlanSolution)
const PlanSolutionPtr getLastPlanSolution()
Return the last plan solution.
PlanningComponent(const std::string &group_name, const rclcpp::Node::SharedPtr &node)
Constructor.
void setWorkspace(double minx, double miny, double minz, double maxx, double maxy, double maxz)
Specify the workspace bounding box. The box is specified in the planning frame (i....
bool setPathConstraints(const moveit_msgs::msg::Constraints &path_constraints)
Set the path constraints generated from a moveit msg Constraints.
const std::vector< std::string > getNamedTargetStates()
Get the names of the named robot states available as targets.
bool execute(bool blocking=true)
Execute the latest computed solution trajectory computed by plan(). By default this function terminat...
moveit::core::RobotStatePtr getStartState()
Get the considered start state if defined, otherwise get the current state.
moveit_cpp::PlanningComponent PlanningComponent
moveit::core::MoveItErrorCode MoveItErrorCode
MOVEIT_DECLARE_PTR(MoveItCpp, moveit_cpp::MoveItCpp)
MOVEIT_CLASS_FORWARD(MoveItCpp)
Main namespace for MoveIt.
This namespace includes the base class for MoveIt planners.
Planner parameters provided with the MotionPlanRequest.
double max_velocity_scaling_factor
void load(const rclcpp::Node::SharedPtr &node)
double max_acceleration_scaling_factor
std::string planning_pipeline
The representation of a plan solution.
robot_trajectory::RobotTrajectoryPtr trajectory
The trajectory of the robot (may not contain joints that are the same as for the start_state_)
moveit::core::MoveItErrorCode error_code
Reason why the plan failed.
moveit_msgs::msg::RobotState start_state
The full starting state used for planning.