LOCO定位系统入门教程-在仿真环境下两只crazyflie同时起飞、悬浮
说明:
- 介绍在仿真环境下两只crazyflie同时起飞、悬浮
步骤:
- 进入目录
cd ~/crazyswarm/ros_ws/src/crazyswarm/scripts
- 执行脚本文件
python3 niceHover.py --sim
- 代码如下
#!/usr/bin/env python
import numpy as np
from pycrazyswarm import *
Z = 1.0
if __name__ == "__main__":
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
allcfs.takeoff(targetHeight=Z, duration=1.0+Z)
timeHelper.sleep(1.5+Z)
for cf in allcfs.crazyflies:
pos = np.array(cf.initialPosition) + np.array([0, 0, Z])
cf.goTo(pos, 0, 1.0)
print("press button to continue...")
swarm.input.waitUntilButtonPressed()
allcfs.land(targetHeight=0.02, duration=1.0+Z)
timeHelper.sleep(1.0+Z)
- 在仿真环境下,两只crazyflie同时起飞、悬浮
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号