Page 1 of 1
control with the simulator using crazyflie-lib-python
Posted: Wed Jun 02, 2021 5:17 am
by t.yoneda
Hello,
I want to control simulated crazyflies using crazyflie-lib-python.
I am currently able to use
sim_cf simulator to make the connection, but I am having problems unpacking the data. (
I created this issue)
currently I am using
sim_cf simulator, are there any other simulators that can be controlled from crazyflie-lib-python? I have yet to find that information.
If I can control some simulator from crazyflie-lib-python, I will try to document it.
Regards,
Re: control with the simulator using crazyflie-lib-python
Posted: Fri Jun 04, 2021 6:41 am
by kimberly
Currently we haven not heard of a way to control a simulated crazyflie from sim_cf. It is a simulator in gazebo and it would be possible to write a [gazebo plugin](
http://gazebosim.org/tutorials?tut=plug ... eboPlugins) that can perhaps take an input of a regular python script?
We haven't worked on this ourselves though, but perhaps if you are thinking of doing something with that let us know! This would be really interesting for many people probably so we can definitely guide you in that.
Re: control with the simulator using crazyflie-lib-python
Posted: Sun Jun 20, 2021 7:04 pm
by t.yoneda
Hello,
the problem unpacking the data is closed. (
https://github.com/bitcraze/crazyflie-l ... issues/240)
thanks to jonasdn's PR!
now I have a problem with communication between simulator and cflib.
sim_cf can communicate via udp, and we can already create sockets in python.
but the data from the simulator seems to be different from the crtp packet.
based on
this script in the simulator and the data dump received by udpdriver.py, I expected the data from the simulator to be a crtp packet with
simulated crazyflie's id (1 byte) at the beginning.
I tried remove a byte the beginning of the data received by receive_packet() in udpdriver.py and setting the cf_id a byte at the beginning of the packet sent by socket.sendto(), but it didn't work.
Re: control with the simulator using crazyflie-lib-python
Posted: Mon Jun 21, 2021 5:29 am
by jonasdn
Hi t.yoneda!
There is probably more to do, it seems that the simulated CF starts sending logging data without you needing to create/start a log block? That will probably confuse the python library somewhat. Perhaps you need to account for that. Reading the sim_cf sources might be the way forward here.
Good luck!
Jonas