Replies: 11 comments 21 replies
-
Hmmm I can also handle this within this issue: #117. But since I have multiple topics discussed, we could use the thread feature of this? |
Beta Was this translation helpful? Give feedback.
-
First question: The |
Beta Was this translation helpful? Give feedback.
-
But this creates some if statements here: crazyswarm2/crazyflie_sim/crazyflie_sim/crazyflie_sil.py Lines 271 to 274 in bc0489c I guess it would be ideal to unify the framework, which means that we also have to make data structures for all the other controllers as well. Also, I believe that @krichardsson had some ideas of improving the structure in general, but maybe that might be too much work for now. |
Beta Was this translation helpful? Give feedback.
-
In my previous attempt to integrating the webots simulator, the driver file had too much functionality in one, but I can still use it as some inspiration, so let's see how to do that. We can get measurements similar in this part and set the motors with these parts But... calling the simulator at a fixed timestep needs to be figured out. Currently the driver also have the ROS calling in there, but that is ofcourse handled now from the crazyflie_server side... so in terms of how to implement it I'm afraid that I probably can not use the ROS_driver example of webots 🤔 |
Beta Was this translation helpful? Give feedback.
-
FYI, I'm currently working on my own fork of crazyswarm2 to hack around and try out ideas. After I found a solution I'll make a draft PR here |
Beta Was this translation helpful? Give feedback.
-
Alright. I've made some good steps with the simulation: https://github.com/knmcguire/crazyswarm2/tree/add-webots-sim-2 I have quite some control with the supervisor node, I can spawn the crazyflies and observe their position. But... I can not access the internals of the crazyflie instances, which includes sensors and motors. The documentation says:
So yeah... there needs to be a controller per Crazyflie instance in order to access the motor control |
Beta Was this translation helpful? Give feedback.
-
I've made a draft PR ! #179 Still want to intergrate the multiprocessing library to make it even cleaner and find out what is going on with the control |
Beta Was this translation helpful? Give feedback.
-
So a bit of bad news. Currently I am not able to tune the Crazyflie with the pythonbindings with the standard timestep of Webots. The numpy backend runs much faster and that is able to handle it, but the bindings for the controller behave very different if it is running at a slower rate. Technically webots can run at 1 ms... but then it is so slow that it is hardly worth it. This is an issue we will need to investigate first. Before I got it to work in webots with the pythonbindings, but I had to scale the output of the controller waaaaay down, and even scale the roll pitch yaw commands even more to make it flyable. So then using SIL loses it's purpose I'm afraid as the simulation is so far off the actual flight. So I'm going to do it a bit differently, since the backend structure allows to send through setpoints to the simulator as well. So I'll extend the simple simulated crazyflie controller with no bindings to handle setpoints ( only velocity and position?), which acts on setpoints that the server is feeding to it. The SIL can ofcourse do high level commands and generate setpoints based on that since that is something that I don't like to rewrite ofcourse :) This is the approach I was thinking about, but I'll first work on the crazyflie_simulation repo to write this controller. So the (3rd) PR will come in the weeks after that. Sorry again for the delay! But I hope it will come out all nicely in the end 🙂 |
Beta Was this translation helpful? Give feedback.
-
I kind of noticed when writing an 'onboard' controller for the webots crazyflie: the behavior of the controller directly embedded into the webots robot node, behaves differently than when I 'externalize' that same controller through a TCP connection (like I was trying to do before). I couldn't investigate any further in this due to the upcoming quartely meeting but I just wanted to put it here to remind myself to create a minimal example of this such that I can notify the Webots maintiners on this. |
Beta Was this translation helpful? Give feedback.
-
I'm starting with a third attempt of intergrating the webots. Now, staying closer to webots intented implementation, and that the webots backend sends out topics instead. It will allow me to switch between python bindings on the controller itself and outside like in the current framework more easily. Very early works started on my personal one but I will make a draft PR once it is at least flyable. https://github.com/knmcguire/crazyswarm2/tree/add-webots-sim-3 |
Beta Was this translation helpful? Give feedback.
-
So... we have some issues with intergrating webots properly in this, which has to do with timing issues in webots and the python bindings, which makes it difficult to have good syncing. To allow ourselves to have more time to take a good look at the python bindings, I proposed together with @whoenig to have an 'external sim' backend instead, that does not start a simulator but sends out topics, which can be read in by an external simulator. This way, we can allow ourselves time to fix the issues with the python bindings and such. I've made an issue for this and will push a PR soon: #252 Also, this will show the modularity of Crazyswarm 2 even more. |
Beta Was this translation helpful? Give feedback.
-
Hi! I want to get started to include webots into Crazyswarm2! I went through the code of the current implementation and had some ideas or questions of how to handle this, and it might be better to start refractoring and clean up things first. This is perhaps a bit too vague to start issues for now so that is why I started a discussion here.
Crazyflie Server
So I was thinking to have a thread per topic, so that is perhaps easier to discuss?
These will consist off:
crazyflie_server.py
in the crazyflie and crazyflie_sim folder.Beta Was this translation helpful? Give feedback.
All reactions