老师你好,我现在又碰到了一个问题,moveit进行了一段轨迹运动后,我用arm.stop将机械臂停下,然后代码如下所示
if cartesian:
fraction = 0.0 #路径规划覆盖率
maxtries = 100 #最大尝试规划次数
attempts = 0 #已经尝试规划次数
# 设置机器臂当前的状态作为运动初始状态
arm.set_start_state_to_current_state()
# 尝试规划一条笛卡尔空间下的路径,依次通过所有路点
while fraction < 1.0 and attempts < maxtries:
#规划路径 ,fraction返回1代表规划成功
(plan, fraction) = arm.compute_cartesian_path (
waypoints, # waypoint poses,路点列表,这里是5个点
0.001, # eef_step,终端步进值,每隔0.01m计算一次逆解判断能否可达
0.0, # jump_threshold,跳跃阈值,设置为0代表不允许跳跃
True) # avoid_collisions,避障规划
可终端显示Invalid Trajectory: start point deviates from current robot state more than 0.01 joint 'joint_3',这是为什么呀?不是在代码中已经arm.set_start_state_to_current_state()了嘛?为什么还会有起始点与机械臂位置差距大的原因啊?我现在只是在moveit里进行仿真,并没有用到真实机器人。
展示全文
第三方账号登入
QQ 微博 微信