鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    使用getCurrentJointValues()出错。error:Failed to fetch current robot state

    已定时 已固定 已锁定 已移动
    机械臂运动规划
    moveit2 获取关节弧度失败
    1
    1
    724
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • T
      Tree
      最后由 编辑

      我看到moveit2有getCurrentJointValues()这个函数就想尝试用这个函数而不是从/joint_states订阅获取关节弧度。我之前使用moveit::planning_interface::MoveGroupInterface下的轨迹规划,执行的函数都没有问题,但是使用的getCurrentJointValues()就会报错。
      我的操作方法是创建完规划组之后直接调用:

      std::shared_ptr<moveit::planning_interface::MoveGroupInterface> move_group;  //创建规划组
      move_group = std::make_shared<moveit::planning_interface::MoveGroupInterface>(
          node, "arm");
      auto request = std::make_shared<ArmposeToTrajectory::Request>() ; 
      

      这样有问题吗。日志是这样的:

      tree@Ubuntu22:~/robot2_arm_grasp$ ros2 run arm_grasp_cpp arm_trajectory_execute --ros-args --params-file arm_params.yaml
      [INFO] [1761873928.650758440] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0 seconds
      [INFO] [1761873928.650817331] [moveit_robot_model.robot_model]: Loading robot model 'ar3'...
      [INFO] [1761873928.871226505] [move_group_interface]: Ready to take commands for planning group arm.
      [INFO] [1761873929.871342341] [arm_test1]: 等待服务端上线中
      [INFO] [1761873930.871580393] [arm_test1]: 等待服务端上线中
      [INFO] [1761873931.872255316] [arm_test1]: 等待服务端上线中
      [INFO] [1761873932.872432526] [arm_test1]: 等待服务端上线中
      [INFO] [1761873933.872572785] [arm_test1]: 等待服务端上线中
      [INFO] [1761873933.900059538] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
      [WARN] [1761873935.001136501] [moveit_ros.current_state_monitor]: No state update received within 100ms of system clock. Have been waiting for 1.000000s, timeout is 1.000000s
      [INFO] [1761873935.001214462] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 300.600000, but latest received state has time 0.000000.
      Check clock synchronization if your are running ROS across multiple machines!
      [ERROR] [1761873935.001258905] [move_group_interface]: Failed to fetch current robot state
      [ros2run]: Segmentation fault
      

      我的rviz2和gazebo和ros2control都设置{use_sim_time: True}了,/joint_states和/clock都在正常发布。日志可以看到MoveGroupInterface 已经成功初始化了

      1 条回复 最后回复 回复 引用 0
      • 第一个帖子
        最后一个帖子
      皖ICP备16016415号-7
      Powered by NodeBB | 鱼香ROS