We use SpaceMouse to teleop the franka arm. (credit to https://github.com/columbia-ai-robotics/diffusion_policy)
sudo apt install libspnav-dev spacenavd
sudo systemctl start spacenavd
pip install https://github.com/cheng-chi/spnav/archive/c1c938ebe3cc542db4685e0d13850ff1abfdb943.tar.gz
if you cannot download this file, you can directly git clone this code, which inlcudes this file.
sudo reboot
./teleop/teleoperation.sh
see more details in Frankapy
cd teleoperation/franka
python teleop/spacemouse.py
Play with the device and you should be able to see realtime signal captured by the spacemouse.
cd teleoperation/franka
python teleop/run.py
按住右边按键,操作摇杆即为控制姿态
松开右边按键,操作摇杆即为控制位置
根据这个代码,完成通过3D鼠标遥操作机械臂,并记录机械臂的运动轨迹,而后进行重复运动
cd ~/Franka/frankapy
python teleop/record_trajectory.py
默认记录10s轨迹数据,数据存储在frankapy下
更改时间:
python teleop/record_trajectory.py -t 70 -o
-o: 是否打开夹爪
-f: 默认输出pkl文件名
python teleop/run_recorded_trajectory.py -t franka_traj.pkl
注意这里使用时要退出python的控制程序 机器人回到home state
cd ~/Franka/libfranka/build/examples
./communication_test 192.168.1.10
