Page 1 of 1

communicate between lighthouse and PC directly?

Posted: Thu Mar 11, 2021 7:02 am
by Baoasi
Hallo,
ich want to send 10 log data back to PC(3 position,3 velocity and 4 Quaternion), but that is impossible due to the limit of packet. So I want to know, can lighthouse and PC communicate directly? if possibleļ¼Œthen I can get the some data direct from lighthouse instead of from crazyradio.
Thanks!

Re: communicate between lighthouse and PC directly?

Posted: Thu Mar 11, 2021 9:15 am
by arnaud
Can you tell us a bit more about your setup and goal since I do not understand the link between lighthouse and the logs.

For lighthouse: there is no communication from the deck to the basestation, so you cannot get data from the lighthouse basestation. You can get data from the deck directly if you attach a 3.0V serial port to it, but the data are raw IR pulse data and needs to be decoded and interpreted which is a non-trivial task.

You could use 2 log blocks if perfect synchronization between your data is not a hard requirement. The log subsystem has support for converting data to 16bit float which could help fitting everything in a single packet, but unfortunately lib/client support for it has never been implemented.

If you absolutely need a single samples to be sent back, you can implement an app that is using the app channel to send the data back. Either you sample and send the sampled data in 2 different packet, or you can compress the data before sending them. There is code in the Crazyflie to convert float to half-float (16 bit floats), those are well adapted to represent quaternions for example. The Crazyflie repos contains app example that uses the app channel as well some that log variables from within the Crazyflie.