geometry_msgs/PoseStamped Message
Raw Message Definition
# A Pose with reference coordinate frame and timestamp
Header header
Pose pose
Compact Message Definition
std_msgs/Header header
geometry_msgs/Pose pose
geometry_msgs/Pose Message
Raw Message Definition
# A representation of pose in free space, composed of position and orientation.
Point position
Quaternion orientation
Compact Message Definition
geometry_msgs/Point position
geometry_msgs/Quaternion orientation
geometry_msgs/Point Message
Raw Message Definition
# This contains the position of a point in free space
float64 x
float64 y
float64 z
Compact Message Definition
float64 x
float64 y
float64 z
geometry_msgs/Quaternion Message
Raw Message Definition
# This represents an orientation in free space in quaternion form.
float64 x
float64 y
float64 z
float64 w
Compact Message Definition
float64 x
float64 y
float64 z
float64 w
使用
// Create the MoveIt MoveGroup Interface
using moveit::planning_interface::MoveGroupInterface;
auto move_group_interface = MoveGroupInterface(node, "ur_manipulator"); //change
// Set a target Pose
auto const target_pose = []{
geometry_msgs::msg::Pose msg;
msg.orientation.w = 1.0;
msg.position.x = 0.28;
msg.position.y = -0.2;
msg.position.z = 0.5;
return msg;
}();
move_group_interface.setPoseTarget(target_pose);
// Create a plan to that target pose
auto const [success, plan] = [&move_group_interface]{
moveit::planning_interface::MoveGroupInterface::Plan msg;
auto const ok = static_cast<bool>(move_group_interface.plan(msg));
return std::make_pair(ok, msg);
}();
// Execute the plan
if(success) {
move_group_interface.execute(plan);
} else {
RCLCPP_ERROR(logger, "Planing failed!");
}
setPoseTarget
bool moveit::planning_interface::MoveGroupInterface::setPoseTarget( const Eigen::Isometry3d & end_effector_pose,
const std::string & end_effector_link = ""
)
bool moveit::planning_interface::MoveGroupInterface::setPoseTarget( const geometry_msgs::Pose & target,
const std::string & end_effector_link = ""
)
bool moveit::planning_interface::MoveGroupInterface::setPoseTarget( const geometry_msgs::PoseStamped & target,
const std::string & end_effector_link = ""
)
Set the goal pose of the end-effector end_effector_link.
If end_effector_link is empty then getEndEffectorLink()
is used.
This new orientation target replaces any pre-existing JointValueTarget or pre-existing Position, Orientation, or Pose target for this end_effector_link.