3 #include <moveit_msgs/MotionPlanRequest.h>
6 #include <ros/console.h>
8 #include <Eigen/Geometry>
16 const moveit::core::RobotModelConstPtr& model)
19 ROS_INFO(
" ======================================= TrajOptPlanningContext is constructed");
20 trajopt_interface_ = std::make_shared<TrajOptInterface>();
25 moveit_msgs::MotionPlanDetailedResponse res_msg;
35 res.
trajectory_[0]->setRobotTrajectoryMsg(start_state, res_msg.trajectory[0]);
53 bool planning_success =
solve(res_detailed);
63 return planning_success;
68 ROS_ERROR_STREAM_NAMED(
"trajopt_planning_context",
"TrajOpt is not interruptible yet");
Representation of a robot's state. This includes position, velocity, acceleration and effort.
planning_scene::PlanningSceneConstPtr planning_scene_
The planning scene for this context.
MotionPlanRequest request_
The planning request for this context.
const std::string & getGroupName() const
Get the name of the group this planning context is for.
void clear() override
Clear the data structures used by the planner.
bool terminate() override
If solve() is running, terminate the computation. Return false if termination not possible....
bool solve(planning_interface::MotionPlanResponse &res) override
Solve the motion planning problem and store the result in res. This function should not clear data st...
TrajOptPlanningContext(const std::string &name, const std::string &group, const moveit::core::RobotModelConstPtr &model)
bool robotStateMsgToRobotState(const Transforms &tf, const moveit_msgs::msg::RobotState &robot_state, RobotState &state, bool copy_attached_bodies=true)
Convert a robot state msg (with accompanying extra transforms) to a MoveIt robot state.
This namespace includes the base class for MoveIt planners.
moveit_msgs::msg::MoveItErrorCodes error_code_
std::vector< robot_trajectory::RobotTrajectoryPtr > trajectory_
std::vector< double > processing_time_
std::vector< std::string > description_
robot_trajectory::RobotTrajectoryPtr trajectory_
moveit_msgs::msg::MoveItErrorCodes error_code_