修正后的指尖投影似乎与高机位相机像素 (95, 246) 和 (141, 250) 附近的黑色指尖相符。指尖位于局部 x = 0.1576米,局部 y 偏移约为 ±0.04米,因此全局 x 偏移为 ∓0.04米,得到的投影 x 坐标约为 110 和 139。初始夹指沿全局 +Y 水平指向,夹爪则沿全局 X 闭合。
对于桌面抓取,我很可能需要让夹指朝下,使局部 X 映射到全局 -Z,并让闭合方向与全局 X 或 Y 对齐。[0.5, 0.5, 0.5, 0.5] 会是合适的四元数吗?我应该推导一下。绕全局 Y 轴旋转 +90° 会把局部 X 映射到 -Z,把局部 Y 映射到全局 Y,把局部 Z 映射到全局 X。其四元数为 [0.707, 0, 0.707, 0],因此夹指会沿全局 Y 闭合。绕 Y 轴旋转 -90° 则会使局部 X 沿 +Z 向上指。
另一种方案是使用 (90°) (90°) 保留初始偏航。它把局部 X 映射到 (0, 0, -1),把局部 Y 映射到 (-1, 0, 0),把局部 Z 映射到 (0, 1, 0)。将四元数相乘得到 [0.5, -0.5, 0.5, 0.5]:各分量为 w = c² = 0.5、x = -s² = -0.5、y = = 0.5 和 z = = 0.5。它与初始四元数 [0.707, 0, 0, 0.707] 的点积约为 0.707,因此整个姿态变化为 90°,即 1.570弧度。这超过了 1.0弧度的目标限制,需要一个中间姿态。从初始 Z 轴旋转直接变为仅绕 Y 轴旋转的四元数,点积为 0.5,角距离为 120°,即 2.094弧度,也超过了限制。我还考虑过将仅绕 Y 轴的旋转作为一种自上而下的选择,使局部 Y 沿全局 X。无论哪种情况,我都可以使用四元数将旋转拆成两次运动。
我应该谨慎选择抓取姿态和桌面位置。我记得在其他任务中见过 [0.5, 0.5, 0.5, -0.5],但我应该推导旋转,而不是依赖那段记忆;科学计算库可能会有帮助。两条机械臂可以先移动到桌面上方较高处的中间位姿,或许位于 z = 0.90米,同时开始向下旋转。它们当前大约位于 z = 0.922米,水平夹指也处于相同高度,远高于估计位于 z = 0.60米的桌面。如果我在不改变第六连杆高度的情况下完全向下旋转,指尖会到达 z = 0.764米。物体可能在 z = 0.63–0.69米附近,顶部或许接近 0.68米,因此我仍然需要下降。
正确的接触偏移尚不确定。第六连杆可能需要比物体接触高度高约 0.14米,或者在指垫从两侧闭合时高约 0.13米。指垫中点可能位于向前约 0.11米处,而夹指最远端为 0.1576米。另一种可能是第六连杆比物体中心高约 0.10米,或者典型抓取高度为桌面上方约 0.15米。第六连杆高度在 0.78–0.83米左右可能使夹指接触物体。一旦腕部朝下,它们的视图应该有助于细化物体位置和抓取目标。
使用估计的桌面高度 0.60米,我估计青椒高度约为 0.065米,中心 z = 0.632米,顶部 z = 0.665米。木制小猪可能高 0.08米,中心 z = 0.64米,狮子可能高 0.075米。扁平的巧克力可能厚 0.015米,中心接近 z = 0.61米。篮子底部可能位于 z = 0.60米,边缘接近 z = 0.74米。在高机位视图中,左侧篮子位于像素 y = 140 的顶部可能对应 y = 0.35米、z = 0.72米处的后侧边缘,而像素 y = 210 附近的前侧底部可能对应 y = 0.08米、z = 0.61米。篮子的尺寸可能约为 0.28 × 0.24米,中心位于 x = -0.42、0 和 0.42米,且 y = 0.17米。这些仍是估计。
我可以在不同的假定高度下使用投影函数来细化目标。左侧青椒的高机位相机中心大约为 (173, 259);假设其主体中心位于 z = 0.633米,可得到估计的水平位置 (-0.385, -0.076) m。它的蒂可能靠近像素 (174, 256)。右侧青椒位于 (494, 228),假设中心 z = 0.635米,可得到约 (0.479, 0.015) m。小猪位于 (125, 238),使用中心 z = 0.635米,可得到约 (-0.54, -0.018) m,不过我不确定头部位置。腕部图像显示小猪位于左下方,狮子位于右侧。狮子位于 (205, 224),使用 z = 0.64米,可得到 (-0.316, 0.024) m。看起来像大象的物体位于 (387, 270),同样使用 z = 0.64米,可得到 (0.168, -0.114) m。在 z = 0.61米时,巧克力的估计水平位置为 (-0.162, -0.057)、(0.284, -0.013) 和 (0.53, -0.08) m。桌面可能覆盖 x = -0.7 到 0.7米、y = -0.4 到 0.4米。初始物体位置可能是有意在一定范围内随机生成的;篮子中心也可能实际位于 x = -0.4、0 和 0.4米,但仍为 y = 0.17米。
我可以让左臂移动到左侧青椒上方,同时让右臂移动到大象上方,并让两者都朝下。不过,大约位于 (0.48, 0.015) m 的右侧青椒就在附近,可能更适合作为右臂的第一个目标。左臂可以在大约 (-0.385, -0.076) m 处抓取它的青椒。两个青椒都要进入白色篮子,因此两条机械臂不应该同时投放。右臂可以握住它的青椒,等待左臂投放完并离开篮子区域。
一种可能的顺序是:左臂将左侧青椒放入白色篮子,然后在左臂离开后,右臂把右侧青椒放进去。接下来,左臂处理左侧巧克力,右臂处理中间巧克力,依次放入蓝色篮子。然后,右臂处理右侧巧克力,同时左臂处理要放入红色篮子的小猪。最后,左臂处理狮子,右臂处理要放入红色篮子的大象。这是八个循环;每个约 60 步,总计约 480 步,再加上运送。让左臂在处理自己的青椒后再伸过去抓取右侧青椒会增加移动距离,因此我更倾向于让右臂抓取并握住它。
右臂通往白色篮子的路径必须避开红色和蓝色篮子。第六连杆位于 z = 0.95米且夹指朝下时,指尖将接近 z = 0.792米,比估计为 0.74米的篮子边缘高约 0.05米。将第六连杆升至 1.0米会使指尖位于约 0.842米,对于在篮子上方水平移动似乎是安全的。我也考虑过在第六连杆 z = 0.93 或 0.95米时进行运送。
释放高度取决于最终的抓取偏移。当第六连杆 z = 0.90米时,指尖将接近 0.742米;我仍然需要将青椒底部及其位于约 0.63米的中心与约 0.65米的接触高度联系起来。例如,如果我在第六连杆位于 0.77米、青椒中心位于 0.64米时抓取,那么偏移为 0.13米。随后将第六连杆升至 0.92米,会使青椒中心位于 0.79米,高于估计为 0.72米的篮子边缘。我可以让它对准篮子中心,在不将其降入篮子内部的情况下释放,让它下落约 0.10–0.15米。在第六连杆 z = 0.88米时释放,会使其中心位于约 0.75米、底部位于约 0.72米,可能离篮子边缘太近。在 0.93米处释放,会使其中心位于约 0.80米、底部位于约 0.77米,高于 0.72米的篮子边缘,到 0.60米处的篮子底面估计有 0.15米的下落距离。它可能会弹跳,但我预计容器会将其留在内部。对于在第六连杆位于 0.74米、物体中心位于 0.61米时抓取的巧克力,同样的 0.13米偏移意味着在第六连杆 z = 0.88米时释放,其中心会位于 0.75米,高于估计为 0.73米的篮子边缘。
第一次接近时,我可以让两条机械臂朝各自的物体移动,同时在开放空间中向下旋转一部分。每个目标姿态必须保持在 1弧度以内。从 = [0.7071, 0, 0, 0.7071] 开始,到 = [0.5, -0.5, 0.5, 0.5] 结束,我最初估计中途的归一化和为 [0.683, -0.2817, 0.2817, 0.683],但需要检查其归一化。完整旋转为 π/2,中途旋转为 45°;中途四元数约为 [0.6533, -0.2706, 0.2706, 0.6533]。它可以表示为乘以的逆乘的平方根,而归一化后的和为 [0.65328, -0.2706, 0.2706, 0.65328]。在该姿态下,局部 X 沿 (0, 0.707, -0.707) 指向,即斜向前下方,看起来是安全的。
直接将左臂的第一个目标设为 (-0.385, -0.076, 0.96) m,会距其当前大致位姿 (-0.3, -0.352, 0.922) m 约 0.292米,超过 0.25米的限制。中间目标 (-0.37, -0.14, 0.95) m 的距离约为 0.231米。对于右臂,直接以青椒上方的 (0.48, 0.015, 0.95) m 为目标,距离约为 0.411米,因此我可以改用 (0.39, -0.15, 0.95) m,距离约为 0.228米。在中途姿态下,右侧指尖将到达约 (0.39, -0.039, 0.839) m,位于桌面上方,靠近 x = 0.48米处的青椒。左侧指尖将位于约 (-0.37, -0.029, 0.839) m,悬停在 (-0.385, -0.076) m 处的青椒附近。这些路径似乎没有障碍,不过我应该检查动作后的观测。
更保守的第一次移动主要是改变姿态,并向前移动约 0.10米,目标保持当前 x 位置,同时设为 y = -0.18米和 z = 0.95米。这样位移约为 0.175米。然后我可以在物体上方 z = 0.93米处完成向下旋转。我暂时不需要创建位置备注。现在我会让两个张开的夹爪向前移动,同时向下旋转到中途姿态。
原文9,291 字
The corrected fingertip projection seems consistent with the black fingertips near high-camera pixels (95, 246) and (141, 250). With fingertips at local x = 0.1576 m and local y offsets of approximately ±0.04 m, the global x offsets are ∓0.04 m, giving projected x coordinates around 110 and 139. The initial fingers point horizontally along global +Y, and the grippers close along global X.
For a table grasp, I likely need to point the fingers down, with local X mapped to global -Z and the closing direction aligned with global X or Y. Could [0.5, 0.5, 0.5, 0.5] be the appropriate quaternion? I should derive it. A +90° rotation about global Y maps local X to -Z, local Y to global Y, and local Z to global X. Its wxyz quaternion is [0.707, 0, 0.707, 0], so the fingers would close along global Y. A -90° Y rotation would point local X upward along +Z instead.
An alternative is to preserve the initial yaw using Rz(90°) Ry(90°). This maps local X to (0, 0, -1), local Y to (-1, 0, 0), and local Z to (0, 1, 0). Multiplying the quaternions gives [0.5, -0.5, 0.5, 0.5]: the components are w = c² = 0.5, x = -s² = -0.5, y = cs = 0.5, and z = sc = 0.5. The dot product with the initial quaternion [0.707, 0, 0, 0.707] is approximately 0.707, so the whole orientation change is 90°, or 1.570 rad. That exceeds the 1.0 rad target limit and requires an intermediate orientation. Moving directly from the initial Z rotation to the Y-only quaternion has dot product 0.5 and an angular distance of 120°, or 2.094 rad, which also exceeds the limit. I also considered the Y-only rotation as a top-down option with local Y along global X. In either case, I can split the rotation into two motions using quaternion slerp.
I should choose the grasp orientation and table positions carefully. I recall seeing [0.5, 0.5, 0.5, -0.5] in other RoboDojo tasks, but I should derive the rotations rather than rely on that memory; SciPy could help. Both arms could first move to an intermediate pose high above the table, perhaps at z = 0.90 m, while beginning the downward rotation. They currently sit at approximately z = 0.922 m, with horizontal fingers at the same height, well above the estimated table at z = 0.60 m. If I rotate fully downward without changing link6 height, the fingertips would reach z = 0.764 m. The objects may be around z = 0.63–0.69 m, with tops perhaps near 0.68 m, so I would still need to descend.
The correct contact offset is uncertain. Link6 might need to be about 0.14 m above the object contact height, or perhaps 0.13 m when the pads close around the sides. The pad midpoint could be around 0.11 m forward, while the farthest finger extent is 0.1576 m. Another possibility is link6 about 0.10 m above the object center, or a typical grasp height about 0.15 m above the table. A link6 height around 0.78–0.83 m may bring the fingers into contact. Once the wrists face downward, their views should help refine the object positions and grasp targets.
Using the estimated table height of 0.60 m, I estimate a pepper height of about 0.065 m, center z = 0.632 m, and top z = 0.665 m. The wooden pig may be 0.08 m tall with center z = 0.64 m, and the lion may be 0.075 m tall. The flat chocolates may be 0.015 m thick with centers near z = 0.61 m. Basket bottoms may be at z = 0.60 m and rims near z = 0.74 m. In the high view, the left basket’s top at pixel y = 140 could correspond to a back rim at y = 0.35 m, z = 0.72 m, while its front base near pixel y = 210 could correspond to y = 0.08 m, z = 0.61 m. The baskets may measure about 0.28 by 0.24 m, with centers at x = -0.42, 0, and 0.42 m and y = 0.17 m. These remain estimates.
I can use a projection function at different assumed heights to refine the targets. The left pepper’s high-camera center is around (173, 259); assuming its body center is at z = 0.633 m gives an estimated horizontal position of (-0.385, -0.076) m. Its stem might be near pixel (174, 256). The right pepper at (494, 228), assuming center z = 0.635 m, gives approximately (0.479, 0.015) m. The pig at (125, 238), using center z = 0.635 m, gives approximately (-0.54, -0.018) m, though I am unsure about the head location. The wrist image shows the pig at lower left and the lion toward the right. The lion at (205, 224), using z = 0.64 m, gives (-0.316, 0.024) m. The apparent elephant at (387, 270), also using z = 0.64 m, gives (0.168, -0.114) m. At z = 0.61 m, the chocolates’ estimated horizontal positions are (-0.162, -0.057), (0.284, -0.013), and (0.53, -0.08) m. The table may span x = -0.7 to 0.7 m and y = -0.4 to 0.4 m. The initial object positions may be deliberately randomized within ranges; the basket centers might instead be at x = -0.4, 0, and 0.4 m, still with y = 0.17 m.
I could move the left arm above the left pepper and the right arm above the elephant simultaneously while orienting both downward. However, the right pepper at approximately (0.48, 0.015) m is nearby and may be a better first target for the right arm. The left arm can pick its pepper at approximately (-0.385, -0.076) m. Both peppers go into the white basket, so the arms should not deposit them simultaneously. The right arm could hold its pepper while the left deposits and clears the basket.
A possible sequence is: the left arm puts the left pepper into the white basket, then the right arm puts the right pepper there after the left clears. Next, the left arm handles the left chocolate and the right arm handles the middle chocolate, depositing into the blue basket sequentially. Then the right arm handles the right chocolate while the left handles the pig for the red basket. Finally, the left handles the lion and the right handles the elephant for the red basket. That is eight cycles; at approximately 60 steps each, it would use about 480 steps plus transport. Having the left arm reach across for the right pepper after its own would add travel, so I prefer the right arm picking and holding it.
The right arm’s path to the white basket must clear the red and blue baskets. With link6 at z = 0.95 m and fingers down, the tips would be near z = 0.792 m, about 0.05 m above an estimated 0.74 m rim. Raising link6 to 1.0 m would put the tips around 0.842 m and seems safe for horizontal travel over the baskets. I also considered carrying at link6 z = 0.93 or 0.95 m.
Release height depends on the eventual grasp offset. At link6 z = 0.90 m, the tips would be near 0.742 m; I still need to relate the pepper’s bottom and its center around 0.63 m to a contact height around 0.65 m. For example, if I grasp with link6 at 0.77 m and pepper center at 0.64 m, the offset is 0.13 m. Raising link6 to 0.92 m would then put the pepper center at 0.79 m, above an estimated 0.72 m rim. I could center it over the basket and release without lowering it inside, allowing a drop of approximately 0.10–0.15 m. Releasing at link6 z = 0.88 m would put its center around 0.75 m and bottom around 0.72 m, perhaps too close to the rim. A release at 0.93 m would put its center around 0.80 m and bottom around 0.77 m, above the 0.72 m rim, with an estimated 0.15 m drop to the floor at 0.60 m. It might bounce, but I expect the container to retain it. For a chocolate grasped with link6 at 0.74 m and object center at 0.61 m, the same 0.13 m offset would put its center at 0.75 m when released from link6 z = 0.88 m, above an estimated 0.73 m rim.
For the first approach, I can shift both arms toward their objects while rotating partway downward in open space. Each target orientation must remain within 1 rad. Starting with q0 = [0.7071, 0, 0, 0.7071] and ending at q1 = [0.5, -0.5, 0.5, 0.5], I initially estimated the halfway normalized sum as [0.683, -0.2817, 0.2817, 0.683], but its normalization needs checking. The full rotation is π/2 and the halfway rotation is 45°; the halfway quaternion is approximately [0.6533, -0.2706, 0.2706, 0.6533]. It can be expressed as q0 times the square root of q0 inverse times q1, and the normalized sum gives [0.65328, -0.2706, 0.2706, 0.65328]. At that orientation, local X points along (0, 0.707, -0.707), diagonally forward and down, which appears safe.
A direct first left target of (-0.385, -0.076, 0.96) m would be about 0.292 m from its current approximate pose (-0.3, -0.352, 0.922) m, exceeding the 0.25 m limit. An intermediate target of (-0.37, -0.14, 0.95) m would be about 0.231 m away. For the right arm, a direct pepper target of (0.48, 0.015, 0.95) m would be about 0.411 m away, so I could instead use (0.39, -0.15, 0.95) m, approximately 0.228 m away. With the halfway orientation, the right fingertips would reach approximately (0.39, -0.039, 0.839) m, above the table near the pepper at x = 0.48 m. The left tips would be around (-0.37, -0.029, 0.839) m, hovering near the pepper at (-0.385, -0.076) m. These paths appear clear, though I should inspect the resulting observation.
A more conservative first move would mostly change orientation and move forward by about 0.10 m, targeting the current x positions with y = -0.18 m and z = 0.95 m. That would be roughly 0.175 m of displacement. I could then finish rotating downward above the objects at z = 0.93 m. I do not need to create position notes yet. I will now move both open grippers forward while rotating them halfway downward.