[英]How to use KinematicTrajectoryOptimization in a context which has free body objects in it?
We are trying to use KinematicTrajectoryOptimization to optimize our trajectory for basic pick and place.我们正在尝试使用 KinematicTrajectoryOptimization 来优化基本拾取和放置的轨迹。 We are using 8th notebook provided by Russ Tedrake as a reference Deepnote .我们使用 Russ Tedrake 提供的第 8 笔记本作为参考Deepnote 。 Normally, they do not have a free body object in the examples.通常,它们在示例中没有自由体 object。 But, we need an object on the space as well.但是,我们还需要空间上的 object。 Hence, we added an urdf model to use as a brick.因此,我们添加了一个 urdf model 用作砖块。 However, after adding that box to the plant, obviously, the context dimensions change.然而,在将该框添加到工厂之后,显然,上下文维度发生了变化。 With that change, it raises the following exception:通过该更改,它引发了以下异常:
SystemExit: Failure at systems/trajectory_optimization/kinematic_trajectory_optimization.cc:351 in AddVelocityBounds(): condition 'lb.size() == num_positions()' failed.
/shared-libs/python3.8/py-core/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3386: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
Is there a solution for that problem?这个问题有解决方案吗? It is probably because of additional quarternion.这可能是因为额外的四分之一。
Thanks in advance.提前致谢。
I agree with your analysis;我同意你的分析; if you have the extra body that num_positions() will increase by 7 (for x,y,z + quaternion).如果你有额外的身体,num_positions() 将增加 7(对于 x、y、z + 四元数)。 You can adjust add elements to your lower and upper bounds accordingly when calling Add*Bounds() -- infinite limits are fine.您可以在调用 Add*Bounds() 时相应地调整添加元素到您的下限和上限——无限限制很好。
As the documentation says, the velocities in the optimization (eg for AddVelocityBounds) will correspond to qdot, not v. The multibodyplant, on the other hand will use angular velocity in the state in place of qdot for the quaternion.正如文档所说,优化中的速度(例如,对于 AddVelocityBounds)将对应于 qdot,而不是 v。另一方面,多体植物将使用 angular 速度在 state 中代替四元数的 qdot。 You'll have to map between them yourself (eg using MapVelocityToQdot ).您必须自己在它们之间使用 map(例如使用MapVelocityToQdot )。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.