geometry_msgs

geometry_msgs/PoseStamped Message

geometry_msgs

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.

  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值