遥操作和模仿学习#
遥操作#
我们提供接口以便在 SE(2) 和 SE(3) 空间中提供机器人控制命令。在 SE(2) 遥操作的情况下,返回的命令是x-y线速度和yaw角度率,而在 SE(3) 中,返回的命令是一个表示姿态变化的 6-D 向量。
要使用键盘设备进行反向运动学(IK)控制:
./isaaclab.sh -p source/standalone/environments/teleoperation/teleop_se3_agent.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --num_envs 1 --teleop_device keyboard
脚本打印配置的遥操作事件。对于键盘,它们如下:
Keyboard Controller for SE(3): Se3Keyboard
Reset all commands: L
Toggle gripper (open/close): K
Move arm along x-axis: W/S
Move arm along y-axis: A/D
Move arm along z-axis: Q/E
Rotate arm along x-axis: Z/X
Rotate arm along y-axis: T/G
Rotate arm along z-axis: C/V
模仿学习#
使用遥操作设备,还可以收集用于从示范中学习 (LfD) 的数据。为此,我们支持学习框架 Robomimic (仅限 Linux),并允许以 HDF5 格式保存数据。
收集用于环境
Isaac-Lift-Cube-Franka-IK-Rel-v0
的遥操作演示:# step a: collect data with keyboard ./isaaclab.sh -p source/standalone/workflows/robomimic/collect_demonstrations.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --num_envs 1 --num_demos 10 --teleop_device keyboard # step b: inspect the collected dataset ./isaaclab.sh -p source/standalone/workflows/robomimic/tools/inspect_demonstrations.py logs/robomimic/Isaac-Lift-Cube-Franka-IK-Rel-v0/hdf_dataset.hdf5
将数据集分割为训练集和验证集:
# install the dependencies sudo apt install cmake build-essential # install python module (for robomimic) ./isaaclab.sh -i robomimic # split data ./isaaclab.sh -p source/standalone/workflows/robomimic/tools/split_train_val.py logs/robomimic/Isaac-Lift-Cube-Franka-IK-Rel-v0/hdf_dataset.hdf5 --ratio 0.2
使用 Robomimic 对
Isaac-Lift-Cube-Franka-IK-Rel-v0
训练一个 BC 智能体。./isaaclab.sh -p source/standalone/workflows/robomimic/train.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --algo bc --dataset logs/robomimic/Isaac-Lift-Cube-Franka-IK-Rel-v0/hdf_dataset.hdf5
播放学习模型以可视化结果:
./isaaclab.sh -p source/standalone/workflows/robomimic/play.py --task Isaac-Lift-Cube-Franka-IK-Rel-v0 --checkpoint /PATH/TO/model.pth