moveit_resource中的demo不能进行规划
-
在使用Moveit的例子时,无法进行轨迹规划,每次按下PLAN下面就有failed
平常会有这个警告
[spawner-6] [WARN] [1736499698.648401364] [spawner_joint_state_broadcaster]: Could not contact service /controller_manager/list_controllers [spawner-8] [WARN] [1736499698.648397707] [spawner_panda_hand_controller]: Could not contact service /controller_manager/list_controllers [spawner-6] [INFO] [1736499698.649449243] [spawner_joint_state_broadcaster]: waiting for service /controller_manager/list_controllers to become available... [spawner-8] [INFO] [1736499698.649453611] [spawner_panda_hand_controller]: waiting for service /controller_manager/list_controllers to become available... [spawner-7] [WARN] [1736499698.669175409] [spawner_panda_arm_controller]: Could not contact service /controller_manager/list_controllers [spawner-7] [INFO] [1736499698.670119341] [spawner_panda_arm_controller]: waiting for service /controller_manager/list_controllers to become available...
按下规划后有这个警告
[rviz2-1] [INFO] [1736499753.723379124] [move_group_interface]: MoveGroup action client/server ready [move_group-4] [INFO] [1736499753.723834043] [moveit_move_group_default_capabilities.move_action_capability]: Received request [move_group-4] [INFO] [1736499753.724030384] [moveit_move_group_default_capabilities.move_action_capability]: executing.. [rviz2-1] [INFO] [1736499753.724211867] [move_group_interface]: Planning request accepted [move_group-4] [INFO] [1736499754.724214096] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 1736499753.724090, but latest received state has time 0.000000. [move_group-4] Check clock synchronization if your are running ROS across multiple machines! [move_group-4] [WARN] [1736499754.724283417] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Failed to fetch current robot state. [move_group-4] [INFO] [1736499754.724334333] [moveit_move_group_default_capabilities.move_action_capability]: Planning request received for MoveGroup action. Forwarding to planning pipeline. [move_group-4] [INFO] [1736499754.724443699] [moveit_move_group_capabilities_base.move_group_capability]: Using planning pipeline 'ompl' [move_group-4] [INFO] [1736499754.724632736] [moveit_collision_detection_fcl.collision_common]: Found a contact between 'panda_link5' (type 'Robot link') and 'panda_link7' (type 'Robot link'), which constitutes a collision. Contact information is not stored. [move_group-4] [INFO] [1736499754.724646883] [moveit_collision_detection_fcl.collision_common]: Collision checking is considered complete (collision was found and 0 contacts are stored) [move_group-4] [INFO] [1736499754.724662112] [moveit_ros.fix_start_state_collision]: Start state appears to be in collision with respect to group panda_arm [move_group-4] [WARN] [1736499754.744791666] [moveit_ros.fix_start_state_collision]: Unable to find a valid state nearby the start state (using jiggle fraction of 0.020000 and 100 sampling attempts). Passing the original planning request to the planner. [move_group-4] [INFO] [1736499754.745165542] [moveit.ompl_planning.model_based_planning_context]: Planner configuration 'panda_arm' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. [move_group-4] [WARN] [1736499754.745566338] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.745668471] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.745750245] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [WARN] [1736499754.745886112] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.745956415] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [ERROR] [1736499754.746003283] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.746035444] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.746129972] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.746202179] [ompl]: ./src/ompl/tools/multiplan/src/ParallelPlan.cpp:138 - ParallelPlan::solve(): Unable to find solution by any of the threads in 0.000850 seconds [move_group-4] [WARN] [1736499754.746419168] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [WARN] [1736499754.746451850] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.746501103] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.746551839] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.746619687] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.746644734] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.746710118] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [ERROR] [1736499754.746737549] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.746802863] [ompl]: ./src/ompl/tools/multiplan/src/ParallelPlan.cpp:138 - ParallelPlan::solve(): Unable to find solution by any of the threads in 0.000509 seconds [move_group-4] [WARN] [1736499754.746960200] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.747041002] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.747077351] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [move_group-4] [ERROR] [1736499754.747142724] [ompl]: ./src/ompl/geometric/planners/rrt/src/RRTConnect.cpp:207 - panda_arm/panda_arm: Motion planning start tree could not be initialized! [move_group-4] [WARN] [1736499754.747203980] [ompl]: ./src/ompl/tools/multiplan/src/ParallelPlan.cpp:138 - ParallelPlan::solve(): Unable to find solution by any of the threads in 0.000338 seconds [move_group-4] [WARN] [1736499754.755236415] [ompl]: ./src/ompl/base/goals/src/GoalLazySamples.cpp:129 - Goal sampling thread never did any work. [move_group-4] [INFO] [1736499754.755429520] [moveit.ompl_planning.model_based_planning_context]: Unable to solve the planning problem [move_group-4] [INFO] [1736499754.755512306] [moveit_move_group_default_capabilities.move_action_capability]: Catastrophic failure [rviz2-1] [INFO] [1736499754.756038539] [move_group_interface]: Planning request aborted [rviz2-1] [ERROR] [1736499754.756072634] [move_group_interface]: MoveGroupInterface::plan() failed or timeout reached [spawner-8] [WARN] [1736499758.748974171] [spawner_panda_hand_controller]: Could not contact service /controller_manager/list_controllers [spawner-6] [WARN] [1736499758.749265551] [spawner_joint_state_broadcaster]: Could not contact service /controller_manager/list_controllers [spawner-8] [INFO] [1736499758.749915027] [spawner_panda_hand_controller]: waiting for service /controller_manager/list_controllers to become available... [spawner-6] [INFO] [1736499758.750192892] [spawner_joint_state_broadcaster]: waiting for service /controller_manager/list_controllers to become available... [spawner-7] [WARN] [1736499758.774093676] [spawner_panda_arm_controller]: Could not contact service /controller_manager/list_controllers [spawner-7] [INFO] [1736499758.775088234] [spawner_panda_arm_controller]: waiting for service /controller_manager/list_controllers to become available...
-
从您提供的日志信息来看,有几个关键的问题导致了MoveIt无法进行轨迹规划:
-
无法连接到控制器管理器服务:
[WARN] Could not contact service /controller_manager/list_controllers
这表明您的系统中,MoveIt试图与机器人控制器管理器通信以获取当前的控制器状态,但未能成功。这通常意味着
ros_control
框架中的controller_manager
服务没有正确运行或未正确配置。 -
机器人状态未更新:
[INFO] [move_group-4] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds.
这表示MoveIt在等待机器人当前的关节角度信息时超时了。这可能是因为关节状态发布者(通常是
robot_state_publisher
)没有运行,或者与controller_manager
类似,存在通信问题。 -
初始状态无效或碰撞:
[WARN] [move_group-4] [ompl]: ./src/ompl/base/src/Planner.cpp:248 - panda_arm/panda_arm: Skipping invalid start state (invalid state) [INFO] [move_group-4] [moveit_collision_detection_fcl.collision_common]: Found a contact between 'panda_link5' and 'panda_link7', which constitutes a collision.
这说明MoveIt检测到初始状态是无效的(可能是因为数据缺失或不正确)或存在自碰撞。这通常发生在机器人模型配置不正确,或者启动时没有正确设置机器人的初始位置。
解决步骤:
-
确保
controller_manager
和robot_state_publisher
正在运行:- 检查这些节点是否已经在您的ROS系统中启动。您可以使用
rosnode list
查看当前运行的节点。 - 确保这些节点没有因为配置错误或资源问题而崩溃。
- 检查这些节点是否已经在您的ROS系统中启动。您可以使用
-
检查机器人描述文件(URDF/XACRO):
- 确保URDF文件正确描述了机器人,特别是关节和链接的层次结构。
- 检查是否有任何链接被错误地设置为相互碰撞。
-
检查MoveIt配置文件:
- 确保MoveIt的配置文件(如
moveit_config
包中的文件)正确引用了URDF文件。 - 检查
kinematics_solver
和kinematics_solver_parameters
是否正确配置。
- 确保MoveIt的配置文件(如
-
检查时间同步:
- 如果您在多台机器上运行ROS,确保时间同步。
- 检查是否所有相关节点都使用NTP(网络时间协议)或类似的机制保持时间同步。
-
重新启动和重新配置:
- 有时简单地重启所有ROS节点和重新加载配置可以解决问题。
- 确保所有环境变量和路径设置正确。
-
查看更多日志信息:
- 使用
rostopic echo
查看相关话题的数据,如/joint_states
,以确保数据正在被发布。 - 检查ROS的详细日志输出,可能提供更多关于错误原因的线索。
- 使用
通过上述步骤,您应该能够诊断并解决MoveIt无法进行轨迹规划的问题。如果问题仍然存在,可能需要更深入地检查ROS节点之间的通信和配置。
以上为生成回答,仅供参考~
-
-
@小伊 在 moveit_resource中的demo不能进行规划 中说:
rosnode list
zhangchenxu@chenxz-pc:~/moveit2_ws$ ros2 node list
/interactive_marker_display_106623576800784
/move_group
/move_group_private_97862669165264
/moveit_simple_controller_manager
/robot_state_publisher
/rviz2
/rviz2_private_138154199747712
/rviz2_private_138154938381568
/spawner_joint_state_broadcaster
/spawner_panda_arm_controller
/spawner_panda_hand_controller
/static_transform_publisher
/transform_listener_impl_59016da1bff0
/transform_listener_impl_60f9398b5af0
/transform_listener_impl_60f93b7de840
/transform_listener_impl_7da6b401fd30 -
从你提供的
ros2 node list
命令的输出来看,MoveIt2 相关的节点(如/move_group
和/moveit_simple_controller_manager
)已经在运行。这表示 MoveIt2 的基本架构已经启动并正在运行。然而,如果你提到在 MoveIt 的 demo 中无法进行路径规划,这可能由多种原因引起。以下是一些可能的排查步骤和建议:-
检查机器人状态:
- 确保机器人模型正确加载并且关节状态正常。
- 使用
ros2 topic list
和ros2 topic echo /joint_states
来查看关节状态信息。
-
检查场景设置:
- 确认场景中的障碍物和机器人位置是否正确设置。
- 使用 Rviz2 检查和确认环境设置。
-
规划组配置:
- 检查 MoveIt 配置文件(如
moveit_config/setup_assistant
生成的配置文件),确保规划组(planning group)设置正确。 - 验证末端执行器(end effector)和基座(base)链接名称是否正确。
- 检查 MoveIt 配置文件(如
-
机器人描述文件(URDF/XACRO):
- 确保 URDF 文件正确无误,所有链接和关节都正确描述。
- 使用
ros2 topic echo /robot_description
查看加载的机器人描述。
-
控制器状态:
- 确认控制器(如
panda_arm_controller
和panda_hand_controller
)是否已正确启动并运行。 - 使用
ros2 service list
和ros2 service call /controller_manager/list_controllers std_srvs/srv/Trigger
来检查控制器状态。
- 确认控制器(如
-
调试信息:
- 查看
/move_group
节点的日志输出,使用ros2 node info /move_group
和ros2 topic echo /move_group/feedback
(或类似的反馈话题)来获取更多信息。 - 检查 MoveIt 配置文件中的日志级别,可能需要设置为
DEBUG
或INFO
以获取更多细节。
- 查看
-
路径规划器配置:
- 检查路径规划器(如 RRT*, SBL, OMPL 等)的配置参数。
- 确认规划参数(如最大迭代次数、时间限制等)是否合理。
-
依赖服务:
- 确保所有必要的 ROS 2 服务(如
static_transform_publisher
,transform_listener
等)都在运行并正确配置。
- 确保所有必要的 ROS 2 服务(如
-
重新加载和重启:
- 有时简单的重启 ROS 2 网络或重新加载配置可以解决一些不明显的问题。
如果以上步骤仍然无法解决问题,可能需要更深入地检查 MoveIt2 的配置文件和代码,或者考虑是否有软件版本不兼容的问题。此外,查看 MoveIt2 的官方文档和社区论坛也是获取帮助和解决方案的好方法。
以上为生成回答,仅供参考~
-