小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
-
ros版本是melodic
我按照教学视频设置好了moveit setup assistant的base link 和 tip link以及编写了一个python程序让机械臂末端走直线
结果运行的时候报错TF Problem: "base_link" passed to lookupTransform argument target_frame does not exist.
以及
Got a callback on a goalHandle that we're not tracking. This is an internal SimpleActionClient/ActionClient bug. This could also be a GoalID collision
请教大佬具体是哪里没有设置好
urdf模型是店家自己提供的!
python代码如下(未注释)
#!/usr/bin/env python* coding: utf-8 *
from base64 import standard_b64decode
import rospy, sys
import moveit_commander
from moveit_commander import MoveGroupCommander
from geometry_msgs.msg import Pose
from copy import deepcopyclass MoveItcartesianDemo:
def init(self):
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('moveit_cartesian_demo',anonymous=True)
cartesian = rospy.get_param('~cartesian',True)
arm = MoveGroupCommander('arm')
arm.allow_replanning(True)
arm.set_pose_reference_frame('base_link')
arm.set_goal_position_tolerance(0.01)
arm.set_goal_orientation_tolerance(0.1)
end_effector_link = arm.get_end_effector_link()
arm.set_named_target('work')
arm.go()
start_pose = arm.get_current_pose(end_effector_link).pose
waypoints = []
if cartesian:
waypoints.append(start_pose)
wpose = deepcopy(start_pose)
wpose.position.x -= 0.03
wpose.position.y -= 0.03
if cartesian:
waypoints.append(deepcopy(wpose))
else:
arm.set_pose_target(wpose)
arm.go()
rospy.sleep(1)
wpose.position.y += 0.05
if cartesian:
waypoints.append(deepcopy(wpose))
else:
arm.set_pose_target(wpose)
arm.go()
rospy.sleep(1)
if cartesian:
waypoints.append(deepcopy(start_pose))
else:
arm.set_pose_target(start_pose)
arm.go()
rospy.sleep(1)
if cartesian:
fraction = 0.0
maxtries = 100
attempts = 0
arm.set_start_state_to_current_state()
while fraction < 1.0 and attempts <maxtries:
(plan,fraction) = arm.compute_cartesian_path (waypoints,0.01,0,True)
attempts += 1
if attempts % 10 == 0:
rospy.loginfo("Still trying after " + str(attempts) + " attempts...")
if fraction == 1.0:
rospy.loginfo("Path computed successfully. Moving the arm.")
arm.execute(plan)
rospy.loginfo("Path execution complete")
else:
rospy.loginfo("Path planning failed with only " + str(fraction) + " success after " + str(maxtries) + " attempts.")
arm.set_named_target('home')
arm.go()
rospy.sleep(1)
moveit_commander.roscpp_shutdown()
moveit_commander.os._exit(0)if name == "main":
try:
MoveItcartesianDemo()
except rospy.ROSInterruptException:
pass
附上截图
20220621171413.png -
@小小禅师 在 Moveit运动规划 笛卡尔路径规划 TF problem 中说:
TF Problem: "base_link" passed to lookupTransform argument target_frame does not exist
看这个错误先检查下tf先,用tf工具看一下tf树。
另外记得修改下代码格式哦
-
@小鱼 查了一下我的tf树,是单向传递的,没有断和闭环
-
@小小禅师 好像没有看到报错的base_linkp哦
-
@小鱼 所以可能是啥原因呢,崩溃中QAQ
-
@小小禅师 在 Moveit运动规划 笛卡尔路径规划 TF problem 中说:
我按照教学视频设置好了moveit setup assistant的base link 和 tip link
所以这个设置base_link是干嘛用的
-
@小鱼 设置planning groups的时候教程里面说要选择一个kinematic solver,之后点add kin. chain设置base link和tip link
-
@小小禅师 可能是他的机械臂底座叫base_link,你的应该是没有的,可能要换一个
-
@小鱼 解决了,我没注意这个机械臂是arm_base,不是base_link,谢谢了
-
-
-