HITL and SITL for crazyflie
-
- Beginner
- Posts: 3
- Joined: Thu May 31, 2018 9:55 am
Re: HITL and SITL for crazyflie
Thank you wuwushrek
Re: HITL and SITL for crazyflie
Hi,
There is the link for my current version : https://github.com/wuwushrek/sim_cf .
I added a small installation tuto and you can use the test_high_level.py in crazyflie_gazebo/scripts for testing the high level control. After that, normally you will be able to use whatever code you have written using CrazyflieROS with the simulator.
Just few remarks :
* My gazebo node is also the one that launch in a separate thread an instance of CrazyflieROS (I modified it a little bit) for communicating with the quad. The obvious reason is that I needed to have access to the crazyflieUSB/Socket inside my gazebo sim in order to send sensors data in HITL mode. This isn't a good solution for me... It isn't modular at all.
* When gazebo is started, you need to push button play and wait for the kalman been initialized before doing any other routines.
* I used kalibr allan model https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model in order to model the sensors. But it appears that the model doesn't fit that well the sensors in crazyflie from the data I obtained. Thus the gyro variance are a little bit higher than the variance you will get using the real sensors.
* Oh if you don't have a powerful enough computer, you may want to launch the crazyflie SITL on another computer than the gazebo instance. the simulation will be better.
Anyway I'm still working on these problems. And it will be great If you can give me back feedback in order to improve the simulator
If you have any questions, feel free to ask. I will be working again on the simulator around Wednesday
Regards,
There is the link for my current version : https://github.com/wuwushrek/sim_cf .
I added a small installation tuto and you can use the test_high_level.py in crazyflie_gazebo/scripts for testing the high level control. After that, normally you will be able to use whatever code you have written using CrazyflieROS with the simulator.
Just few remarks :
* My gazebo node is also the one that launch in a separate thread an instance of CrazyflieROS (I modified it a little bit) for communicating with the quad. The obvious reason is that I needed to have access to the crazyflieUSB/Socket inside my gazebo sim in order to send sensors data in HITL mode. This isn't a good solution for me... It isn't modular at all.
* When gazebo is started, you need to push button play and wait for the kalman been initialized before doing any other routines.
* I used kalibr allan model https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model in order to model the sensors. But it appears that the model doesn't fit that well the sensors in crazyflie from the data I obtained. Thus the gyro variance are a little bit higher than the variance you will get using the real sensors.
* Oh if you don't have a powerful enough computer, you may want to launch the crazyflie SITL on another computer than the gazebo instance. the simulation will be better.
Anyway I'm still working on these problems. And it will be great If you can give me back feedback in order to improve the simulator
If you have any questions, feel free to ask. I will be working again on the simulator around Wednesday
Regards,
-
- Beginner
- Posts: 19
- Joined: Mon May 14, 2018 8:33 am
Re: HITL and SITL for crazyflie
Hi,
I have tried the SITL version, by following installation notes and instructions you added, it is working quite well right now. At that point, I wonder if you ever tried anything with more than one crazyflie? (Regarding it's computational load, I do not mean like 20 but 2-3 crazyflies). Except the modification in other files which can be done similar to other RotorS applications, how would you approach the problem of running multiple softwares in the loop? If any one else are trying to achieve same thing, I would appreciate it to discuss here.
Kind Regards,
Tugay
I have tried the SITL version, by following installation notes and instructions you added, it is working quite well right now. At that point, I wonder if you ever tried anything with more than one crazyflie? (Regarding it's computational load, I do not mean like 20 but 2-3 crazyflies). Except the modification in other files which can be done similar to other RotorS applications, how would you approach the problem of running multiple softwares in the loop? If any one else are trying to achieve same thing, I would appreciate it to discuss here.
Kind Regards,
Tugay
Re: HITL and SITL for crazyflie
Hi,
Normally, this could be done thanks to the mav.launch file but I have a bug with it at the moment. I'm working on
Another way to do it, is to duplicate the crazyflie_gazebo/models/crazyflie and just specify differents namespace and uri in the crazyflie_gazebo/models/crazyflie/crazyflie.sdf . Then you will need to add the new model in the crazyflie_gazebo/worlds/crazyflie.world and then launch two instance of crazyflie SITL with the two uri specified above.
Anyway I will update the README.md about this procedure as soon as I fixed the mav.launch problem
Normally, this could be done thanks to the mav.launch file but I have a bug with it at the moment. I'm working on
Another way to do it, is to duplicate the crazyflie_gazebo/models/crazyflie and just specify differents namespace and uri in the crazyflie_gazebo/models/crazyflie/crazyflie.sdf . Then you will need to add the new model in the crazyflie_gazebo/worlds/crazyflie.world and then launch two instance of crazyflie SITL with the two uri specified above.
Anyway I will update the README.md about this procedure as soon as I fixed the mav.launch problem
-
- Beginner
- Posts: 19
- Joined: Mon May 14, 2018 8:33 am
Re: HITL and SITL for crazyflie
Hi again,
I just want to let you know, about the multiple instances of SITL (to explain, in two separate terminals, executing "./cf2" command with different arguments), the second instance can not be opened, corresponding situation can be seen at attachments. Moreover, "./cf2" command does not seem to care about arguments to be valid or not. This example also in attachments. Finally, the lines that are involving corresponding uri for sitl in crazyflie_add.launch or mav.launch files can be changed arbitrarily and simulation still works perfectly. It seems like these connections are created somewhere else regardless of ./cf2 argument or launch files. I hope that helps.
Kind Regards,
I just want to let you know, about the multiple instances of SITL (to explain, in two separate terminals, executing "./cf2" command with different arguments), the second instance can not be opened, corresponding situation can be seen at attachments. Moreover, "./cf2" command does not seem to care about arguments to be valid or not. This example also in attachments. Finally, the lines that are involving corresponding uri for sitl in crazyflie_add.launch or mav.launch files can be changed arbitrarily and simulation still works perfectly. It seems like these connections are created somewhere else regardless of ./cf2 argument or launch files. I hope that helps.
Kind Regards,
Re: HITL and SITL for crazyflie
I just updated the git. You should have a working example with two quads using only .launch file and I fixed the problem you mentioned above. However even just 2 quads in SITL on the same computer seems a lot (as you will (or not) see). I will try to see what can be done to reduce the computational load.
PS: Pay attention, I changed the order of program cf2 arguments.
Regards
PS: Pay attention, I changed the order of program cf2 arguments.
Regards
-
- Beginner
- Posts: 19
- Joined: Mon May 14, 2018 8:33 am
Re: HITL and SITL for crazyflie
I have tried the two quad case also, they work seamless except the consequences of increased computational load, you are right... Even so, thank you again for your valuable contribution.
a small note: in the tutorial for two quad case, for the second console, port number will be "19951" instead of "19551".
Kind Regards,
a small note: in the tutorial for two quad case, for the second console, port number will be "19951" instead of "19551".
Kind Regards,
-
- Beginner
- Posts: 5
- Joined: Wed Jun 06, 2018 1:34 pm
Re: HITL and SITL for crazyflie
Hello there,
I was wondering how a CRTP packet is created after one Crazyflie is commanded to move (goTo, takeoff etc.). I'd like to know if we can write a code that will behave like a router in a network and regulate the packets among the Crazyflie controllers and the SITL session. Because, multiple SITLs put quite a workload on my computer (even after 1 successful run, single Crazyflie end up upside down on the ground plane). What I suggest is this:
Thanks in advance...
Burak
I was wondering how a CRTP packet is created after one Crazyflie is commanded to move (goTo, takeoff etc.). I'd like to know if we can write a code that will behave like a router in a network and regulate the packets among the Crazyflie controllers and the SITL session. Because, multiple SITLs put quite a workload on my computer (even after 1 successful run, single Crazyflie end up upside down on the ground plane). What I suggest is this:
- Let's say there are multiple Crazyflies in a Gazebo simulation, each will have a different port number, but same IP address.
- There will be a layer (i.e. router) which will take CRTP packets created by the Crazyflie controllers' commands and send them to SITL session in a synchronized manner. In other words, there will be a priority for each packet to be routed to SITL. Thus, SITL will think it is communicating with only 1 Crazyflie at a time.
- Since Gazebo works if a valid message is published to the topics it has subscribed to, packet transmission will not affect it's execution of Crazyflie commands.
Thanks in advance...
Burak
Re: HITL and SITL for crazyflie
Hi,
Interesting what you are saying ! Before testing that path (and Yes it is possible to implement something like that ), I'm currently working on another alternative. Maybe I will combine the two at the end (?).
I will keep you updated when things will be better with multiple cf.
Interesting what you are saying ! Before testing that path (and Yes it is possible to implement something like that ), I'm currently working on another alternative. Maybe I will combine the two at the end (?).
I will keep you updated when things will be better with multiple cf.
-
- Beginner
- Posts: 3
- Joined: Thu May 31, 2018 9:55 am
Re: HITL and SITL for crazyflie
Hi everybody,
I have also tested SITL for one and two quads,
It works good, enough tot test new controllers, I get Gyro Bias found warning,
Thank you wuwushrek,
I have suggestions;
1- putting remarks on this page to https://github.com/wuwushrek/sim_cf/tre ... lie_gazebo
2- port number typo: 19551 -> 19951
3- path typo: cd ~/catkin_ws/src/Modal2018/crazyflie_gazebo/scripts/ -> ~/catkin_ws/src/sim_cf/crazyflie_gazebo/scripts
I have also tested SITL for one and two quads,
It works good, enough tot test new controllers, I get Gyro Bias found warning,
Thank you wuwushrek,
I have suggestions;
1- putting remarks on this page to https://github.com/wuwushrek/sim_cf/tre ... lie_gazebo
2- port number typo: 19551 -> 19951
3- path typo: cd ~/catkin_ws/src/Modal2018/crazyflie_gazebo/scripts/ -> ~/catkin_ws/src/sim_cf/crazyflie_gazebo/scripts