Invalid Trajectory: start point deviates from current robot state more than

本文探讨了MoveIt中出现的“InvalidTrajectory:startpointdeviatesfromcurrentrobotstatemorethan...”错误,提供了调整允许的起始偏差阈值的方法,并详细解释了如何通过动态重配置服务来修改参数。

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

“Invalid Trajectory: start point deviates from current robot state more than …“ MoveIt 0.7.3+ ensures that the start state of the robot is near the current state before executing a trajectory. The check might be violated if the noise in your JointStates exceeds the default threshold value of 0.01 per joint even if your robot did not move between planning and execution. In this case you can increase the threshold value in the ros parameter /move_group/trajectory_execution/allowed_start_tolerance - or disable the check by setting it to 0.0



http://moveit.ros.org/moveit!/ros/2017/01/03/firstIndigoRelease.html


> [ERROR] [1511284205.660285187]: 
> Invalid Trajectory: start point deviates from current robot state more than 
> 0.01 
> joint 'arm_elbow_joint':
expected: 0, current: 1.84494 

This means the trajectory you try to execute starts far away from the current 
state of the robot. Likely your trajectory starts at the all-zero configuration 
which means whichever node plans the trajectory doesn't know, or less likely 
ignores, the current joint configuration. The most common source of error to 
trigger this would be that the `move_group` node does not subscribe to the 

correct JointState topic. 



*******************************************************

Hi all,

So this new feature has been introduced, however it is causing me all ends of problems when running the ARIAC Gazebo competition simulator.

Even though it seems we can disable or alter the threshold through setting the ROSPARAM:

rosparam set /move_group/trajectory_execution/allowed_start_tolerance 0.0

or in rospy

# Set trajectory execution ros paramters
rospy.set_param('/move_group/trajectory_execution/allowed_start_tolerance', 0.0)

It seems to have no discernible effect and I still get this error, even when I check ROSPARAM again and it is definitely set to 0.0.

Is there any possible way that the code call or rosparam call is being ignored?

This is on ROS Indigo / 14.04.

Any help is appreciated

Cdr

> Even though it seems we can disable or alter the threshold through setting the ROSPARAM: 

> rosparam set /move_group/trajectory_execution/allowed_start_tolerance 0.0 

> or in rospy 

> # Set trajectory execution ros paramters 
> rospy.set_param('/move_group/trajectory_execution/allowed_start_tolerance', 
> 0.0) 

Where did you find these lines? 
You should set the parameter in the launch files instead. 
The parameter is managed by dynamic_reconfigure. As far as I understood 
from its implementation, this only fetches the parameters from the parameter 
server *initially*. After that the values can/should be configured by 
ROS service calls. So if you really want to change the parameter at runtime, 
you have to call the service, e.g. by 

$ rosservice call /move_group/trajectory_execution/set_parameters "config: 
  doubles: 
    - {name: 'allowed_start_tolerance', value: 0.0}" 



v4hn 

-- 
Michael Görner, M.Sc. Cognitive Science, PhD Student 
Universität Hamburg 
Faculty of Mathematics, Informatics and Natural Sciences 
Department of Informatics 
Group Technical Aspects of Multimodal Systems 

Vogt-Kölln-Straße 30 
D-22527 Hamburg 

Room: F-315 

Phone: +49 40 42883-2432



**********************************************

I am using Moveit with ROS kinetic for planning the motions for a UR5 arm. I am using the Track_IK kinematic solver. The problem is , I am speicifying simple goal poses for the gripper in cartesian space, but I am getting the error message in the terminal of moveit_planning execution.launch.

[ERROR] [1511284205.660285187]:
Invalid Trajectory: start point deviates from current robot state more than 0.01
joint 'arm_elbow_joint': expected: 0, current: 1.84494


I looked into the issue mentioned here. But I'm using trac_Ik instead of Descartes. So I am not sure how to implement a proper solution.

From that thread, it seems like the general solution is independent of whatever IK solver you're using, Trak-IK or Descartes. I think the most relevant part of that thread is this:

The way to handle this is to "connect" the start of the descartes-generated trajectory with the current position of the robot. You can do this manually by inserting a trajectory_msgs::JointTrajectoryPoint with the positions variables set to the robot's current position into the trajectory before attempting execution.

You also mentioned that:

I also referenced this, but then changing the

/move_group/trajectory_execution/allowed_start_tolerance to 0.0 is giving me another error.
[ WARN] [1511285456.138267775]: Controller failed with error code INVALID_GOAL
[ WARN] [1511285456.138359326]: Controller handle reports status FAILED
[ INFO] [1511285456.138473683]: Execution completed: FAILED
[ INFO] [1511285456.168054862]: Execution request received for ExecuteTrajectory action.

in the terminal where I launch the UR_driver to interface with the real robot I have the error

[ERROR] [1511285455.959112929]: Goal start doesn't match current pose
[ INFO] [1511285455.995846536]: on_goal
[ERROR] [1511285455.996445868]: Goal start doesn't match current pose
[ INFO] [1511285456.036065982]: on_goal

This is because the controller on the UR has a similar protection mechanism that you disabled in MoveIt: it will refuse to execute the trajectory if the start state isn't the current state of the robot. (See this for some more info). I would suggest re-enabling the check in MoveIt and adding your current state to the beginning of the path you are trying to execute.

It looks like the relevant portion of your code is in the move2pose method.

Hope that helps you figure out how to tackle your problem.


<think>好的,我现在需要解决用户在ROS中遇到的机器人轨迹规划错误,具体是起点与当前状态偏差过大的问题,尤其是涉及到shoulder_pan_joint的期望值与当前解的偏差。首先,我需要分析可能的原因,然后给出解决方案。 首先,用户提到起点偏差过大,这可能是因为机器人的当前关节状态与规划的起始点不一致。在ROS中,轨迹规划通常需要当前的关节状态作为起点,如果规划时使用的起点与实际状态不符,就会导致错误。例如,如果shoulder_pan_joint的实际位置与规划预期的位置相差超过一定阈值,ROS的规划器可能会拒绝执行,认为存在安全问题。 接下来,我需要考虑可能的原因: 1. **关节状态反馈延迟或错误**:可能是传感器数据未及时更新,或者话题通信出现问题,导致规划器获取了过时的关节状态。 2. **未正确设置起始状态**:在调用规划器时,如果没有显式设置起始状态,规划器可能默认使用错误的值,例如0或其他默认值,而不是当前实际值。 3. **控制器未正确跟踪轨迹**:如果之前的轨迹执行未完成或被中断,当前关节位置可能偏离预期,导致下一次规划的起点不一致。 4. **运动学求解器容差设置过小**:运动学求解器允许的起点偏差阈值设置过小,即使有微小偏差也会报错。 5. **硬件问题**:如编码器故障、电机失步等导致实际位置与期望位置不符。 针对这些可能的原因,我需要逐一给出解决方案。例如,检查/joint_states话题的发布情况,确保规划时显式设置起始点为当前状态,调整容差参数等。同时,可能需要使用MoveIt!提供的工具进行调试,比如手动设置起始状态,或通过RViz的规划面板重新规划。 此外,用户提到的错误信息中提到了shoulder_pan_joint,这说明问题可能集中在这个关节上,需要特别检查该关节的传感器数据、控制器配置以及运动学链中的相关部分。例如,该关节的限位是否被正确设置,是否存在超出限位的情况,或者该关节的PID参数是否不合适导致跟踪偏差累积。 在代码层面,用户可能需要检查他们的规划请求是否正确设置了start_state,例如使用MoveIt的API时是否从当前的机器人状态获取了起始点。另外,如果使用OMPL作为规划库,可能需要调整规划参数中的起始状态容忍度。 最后,验证解决方案的步骤也很重要,比如通过rostopic echo检查关节状态,使用RViz的Planning Scene监视当前状态,或者手动发送关节目标来测试控制器是否正常工作。如果所有方法都无效,可能需要检查URDF模型是否正确,尤其是shoulder_pan_joint的定义是否有误。 总结起来,解决这个问题需要系统性地排查硬件、传感器数据、ROS话题通信、规划器配置以及控制器的跟踪性能等多个环节,逐步缩小问题范围,找到具体原因并针对性处理。</think>### 机器人轨迹规划起点偏差问题分析与解决 #### 问题分析 机器人轨迹规划报错"start point deviation",尤其是`shoulder_pan_joint`关节的期望值与当前状态不匹配,主要源于**规划起始点与实际关节位置的偏差超过系统容忍阈值**。以下是具体原因及对应解决方案: --- #### 一、核心原因 1. **状态同步问题** - 规划器使用的起始状态未实时更新,可能读取到缓存数据或默认值(如零位)[^2] - 检查`/joint_states`话题的发布频率:`rostopic hz /joint_states` - 验证规划请求代码是否显式设置起点: ```python move_group.set_start_state_to_current_state() # MoveIt!关键API ``` 2. **控制器跟踪误差累积** - 连续运动时控制器未完全到达目标位置就启动新规划 - 解决方法:在规划前插入状态检查 ```python while not move_group.get_current_joint_values() == target_joints: rospy.sleep(0.1) ``` 3. **运动学约束过严** - 运动学求解器的起始点容差参数设置过小 - 修改`joint_limits.yaml`配置: ```yaml shoulder_pan_joint: has_velocity_limits: true max_velocity: 3.14 has_position_limits: true min_position: -6.28 max_position: 6.28 angle_tolerance: 0.0175 # 默认1度,可增大到0.0349(2度) ``` --- #### 二、关键调试步骤 1. **实时状态监控** ```bash rostopic echo /joint_states | grep shoulder_pan_joint rqt_plot /joint_states/position[0] # 可视化关节位置变化 ``` 2. **强制状态重置** 在RViz的"Planning"标签页中: - 勾选"Allow Approximate IK" - 点击"Query Start State"后手动拖动模型对齐实际位置 3. **容差测试** ```python # 在规划请求中增加位置容差 req.start_state.joint_state.position_tolerance = [ JointTolerance(name="shoulder_pan_joint", position=0.05, velocity=0.1) ] ``` --- #### 三、进阶解决方案 1. **硬件校准** - 执行关节归零操作: ```bash rosrun dynamixel_controllers set_speed.sh shoulder_pan_joint 0.5 roslaunch my_robot calibration.launch ``` 2. **轨迹预处理** 在规划前插入过渡轨迹: ```python from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint transition = JointTrajectory() transition.joint_names = ["shoulder_pan_joint"] point = JointTrajectoryPoint() point.positions = [current_position] point.time_from_start = rospy.Duration(1.0) transition.points.append(point) move_group.execute(transition) ``` 3. **修改OMPL参数** 在`ompl_planning.yaml`中调整: ```yaml RRTConnect: range: 0.1 # 增大采样范围 start_state_max_bounds_error: 0.2 # 最大起始误差 ``` --- #### 四、典型错误排查 | 现象 | 检查点 | 工具命令 | |-------|--------|----------| | 位置跳变 | 编码器接线 | `rosservice call /shoulder_pan_joint/diagnostic` | | 延迟>100ms | 网络负载 | `rostopic delay /joint_states` | | 数据无效 | 坐标系转换 | `rosrun tf view_frames` | ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值