IMRCLab / crazyswarm2

A Large Quadcopter Swarm
MIT License
117 stars 64 forks source link

cflib bug with upload multiple trajectories #544

Closed ywang760 closed 4 months ago

ywang760 commented 4 months ago

Hi, I have a question on using cf.uploadTrajectory to upload multiple trajectories. For example, I'm changing this to

for cf in allcfs.crazyflies:
            cf.uploadTrajectory(0, 0, traj)
            cf.uploadTrajectory(1, 0, traj1)

I'm getting

[crazyflie_server.py-4]   File "/home/yutongw/ros2_ws/install/crazyflie/lib/crazyflie/crazyflie_server.py", line 990, in _upload_trajectory_callback
[crazyflie_server.py-4]     trajectory_mem = self.swarm._cfs[uri].cf.mem.get_mems(
[crazyflie_server.py-4] IndexError: tuple index out of range

on the server.

knmcguire commented 4 months ago

hmmm that is interesting, perhaps that is a bug on the cflib backend side.

Does this work for the cpp backend? If you start the server with backend:=cpp ?

knmcguire commented 4 months ago

There was a bug indeed, but luckily easy to spot the issue. There is a PR here https://github.com/IMRCLab/crazyswarm2/pull/549, if you can try it out?

ywang760 commented 4 months ago

Thank you. It works with backend:=cpp. Adding in https://github.com/IMRCLab/crazyswarm2/pull/549 also makes backend:=cflib works.

knmcguire commented 4 months ago

Great! The fix has been merged so you can pull the latest changes on your machine.