IMRCLab / crazyswarm2

A Large Quadcopter Swarm
MIT License
112 stars 58 forks source link

Webots simulation node #77

Open knmcguire opened 1 year ago

knmcguire commented 1 year ago

Now that the Crazyflie is in the latest version of Webots, it will be easier to start creating a ros2 node for the model and the python bindings.

There are some things to be solved:

knmcguire commented 1 year ago

Also, do we want to enable spawning from the yaml file as well? It should be possible to do from webots

knmcguire commented 1 year ago

The clock in the webots is published by this if you follow the examples https://github.com/cyberbotics/webots_ros2/blob/1cc1c68a31762d6a2628a2be9f1de5dfbf2353cf/webots_ros2_driver/webots_ros2_driver/ros2_supervisor.py#L128

In the #106 I actually removed that since I wrote my own supervisor driver, but it still worked for some reason... but probably will cause problems in the end.

whoenig commented 1 year ago

That was very helpful - thanks! I used it to write a minimal backend to just show the setpoint in rviz at https://github.com/IMRCLab/crazyswarm2/blob/feature_sim/crazyflie_sim/crazyflie_sim/backend_rviz.py. Now one can run the simulation faster/or slower than realtime (just use_sim_time has to be set for every node that wants to be on the sim time).

I think in your case you might not see a problem since by default wall-clock time is used.