gtfactslab / CrazySim

A Crazyflie simulator for testing CFLib Python code, ROS 2 nodes through Crazyswarm2, custom crazyflie-firmware modules, or perform a flight demo on the crazyflie-python-client.
GNU General Public License v3.0
71 stars 15 forks source link

Crazyswarm2 not detecting crazyflie from simulator #8

Closed GusBon closed 5 months ago

GusBon commented 5 months ago

When I try to launch Crazyswarm2 after launching Crazysim with a singleagent nothing appears in RVIZ or the log of Crazyswarm, even if the configurations files of Crazyswarm are good (configured for one drone). And of course I used cflib backend when launching Crazyswarm2 This is really weird because it was working well yesterday and today when I reboot my pc it is working for two or three times (the drone get detected and work well. It is a really obscure behavior

llanesc commented 5 months ago

Thanks for bringing this up. I've noticed this issue when the number of drones is high (~20 on my computer) and others have pointed this out as well (see https://github.com/gtfactslab/CrazySim/issues/6). The issue is mainly related to the Gazebo real-time factor decreasing and causing packets to be lost. I'll think about a better solution for this. Also, make sure you wait a few seconds after Ctrl+C to allow the processes to terminate. I've never experienced this with only one drone.

GusBon commented 5 months ago

I was working on a laptop with no graphic card, this might be the source of the problem. By the time I am writing this, I have now access again to a powerful computer and Crazysim is working fine with one drone. I will try to rerun Crazysim on the laptop by changing Gazebo step size as recommended on https://github.com/gtfactslab/CrazySim/issues/6