melodic 下的moveit逆运动学迁移到noetic下 竟然报错

在将使用MoveIt的ROSMelodic项目迁移到Noetic时,遇到了一个关于逆运动学计划的错误。问题在于代码中处理traj的方式。通过参考相关博客,发现需要更新计划和执行的代码段。修改后的代码成功地进行了机器人臂的运动规划和执行,解决了tuple对象没有serialize属性的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

melodic 下的moveit逆运动学迁移到noetic下 竟然报错了,明明代码没有改动

报错如下 tuple no header

源代码如下:

        target_pose = PoseStamped()
        target_pose.header.frame_id = reference_frame
        target_pose.header.stamp = rospy.Time.now() 

        target_pose.pose.position.x = 0.2
        target_pose.pose.position.y = 0.25
        target_pose.pose.position.z = 0.36
        target_pose.pose.orientation.x = 1
        target_pose.pose.orientation.y = 0
        target_pose.pose.orientation.z = 0
        target_pose.pose.orientation.w = 0

        arm.set_start_state_to_current_state()
        arm.set_pose_target(target_pose, end_effector_link)


        traj = arm.plan()
        arm.execute(traj)
        rospy.sleep(2)

因为melodic默认是py2.7所以我新建conda py2.7的环境

还是报错:

在这个文章获得灵感:

moveit 逆运动学报错 ‘tuple‘ has no attribute ‘serialize‘_module 'pyarrow' has no attribute 'serialize_General 5219的博客-优快云博客

修改的代码如下:

        target_pose.pose.position.x = 0.2
        target_pose.pose.position.y = 0.25
        target_pose.pose.position.z = 0.36
        target_pose.pose.orientation.x = 1
        target_pose.pose.orientation.y = 0
        target_pose.pose.orientation.z = 0
        target_pose.pose.orientation.w = 0
  
        arm.set_start_state_to_current_state()
        arm.set_pose_target(target_pose, end_effector_link)

        plan_success,traj,planning_time,error_code = arm.plan()
        # traj = arm.plan()
        arm.execute(traj)
        rospy.sleep(2)

最终成功了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值