lately I tried to use cmdVel to move three cfs to adopt cmdVel in my own formation control code. So, I write down the example script to give cmdVel to three cfs like below, but when I run this script only third cf which is "allcfs.crazyflies[2]" is move and other cfs are not react at all.. can anybody give me some advice of this problem? thk u!!
lately I tried to use cmdVel to move three cfs to adopt cmdVel in my own formation control code. So, I write down the example script to give cmdVel to three cfs like below, but when I run this script only third cf which is "allcfs.crazyflies[2]" is move and other cfs are not react at all.. can anybody give me some advice of this problem? thk u!!
-> test script :
from pycrazyswarm import *
swarm = Crazyswarm() timeHelper = swarm.timeHelper allcfs = swarm.allcfs step = 0
for cf in allcfs.crazyflies: cf.cmdVel(0,0,0,0) timeHelper.sleep(1)
for cf in allcfs.crazyflies: cf.cmdVel(0,0,0,0) timeHelper.sleep(1)
for cf in allcfs.crazyflies: cf.cmdVel(0,0,0,0) timeHelper.sleep(1)
start = timeHelper.time() while 0.0 <= timeHelper.time() - start <= 2.0: for cf in allcfs.crazyflies: cf.cmdVel(0.0, 0.0, 0.0, 39400) timeHelper.sleep(1)
print(timeHelper.time()-start)
while 2.0 <= timeHelper.time()- start <= 6.0: for cf in allcfs.crazyflies: cf.cmdVel(-1,0.0,0.0,39000) timeHelper.sleep(1)
print(timeHelper.time()-start)