【问题标题】:How to get the transformation between two body frames in PyDrake如何在 PyDrake 中获得两个身体框架之间的转换
【发布时间】:2022-11-02 02:38:37
【问题描述】:

我在 IIWA 手臂的不同关节位置有两个框架,使用 f1 = plant.GetFrameByName("iiwa_link_0", kuka_model) f2 = plant.GetFrameByName("iiwa_link_2", kuka_model)

我想找到这两个身体框架(f1,f2)之间的转换。

使用 f1.CalcPoseInBodyFrame() 时出错:

TypeError: CalcPoseInBodyFrame(): incompatible function arguments. The following argument types are supported: 1. (self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) -> pydrake.math.RigidTransform_[float]

解决这个问题的正确方法是什么?

谢谢, 萨维什

【问题讨论】:

    标签: python transformation robotics drake pose-estimation


    【解决方案1】:

    如果您发布给您错误的实际代码会很有帮助。

    最坏的情况,你可以这样做:

    context = ... # assuming you have a context where things are posed.
    
    f1 = plant.GetFrameByName("iiwa_link_0", kuka_model)
    f2 = plant.GetFrameByName("iiwa_link_2", kuka_model)
    X_F2F1 = f1.CalcPose(context, f2)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-22
      • 1970-01-01
      • 1970-01-01
      • 2020-07-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多