Logging data without an SD Card

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
DM7299
Member
Posts: 31
Joined: Sat Jun 05, 2021 6:04 pm

Logging data without an SD Card

Post by DM7299 »

Hello,

I am attempting to log the position (in x, y, and z, as well as the yaw, pitch, etc) of my crazyflie while it is in flight. My goal is to do this using code for flight in TWR and TDoA (using LPS) and while using the Flow deck, in order to compare how each system flies a predetermined path. However, my SD Cards have not yet arrived, and it seemed like most of the ways to record data during flight required these. Is there a way to make the code (such as the MotionCommander, for the flow deck, or the PositionHLCommander, for LPS) print its positions to the terminal during flight? Thanks!
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: Logging data without an SD Card

Post by jonasdn »

Hi DM7299!

You can use the logging framework to get log variables via radio and then print them in terminal, please see the step-by-step guide here: https://www.bitcraze.io/documentation/r ... log_param/

You can see documentation of the logging variables here: https://www.bitcraze.io/documentation/r ... /api/logs/
DM7299
Member
Posts: 31
Joined: Sat Jun 05, 2021 6:04 pm

Re: Logging data without an SD Card

Post by DM7299 »

This worked, thank you! I've been constructing plots of my flights, and was now wondering if I could extend this to swarms? The examples of swarm flight all seem to use the High Level Commander rather than the MotionCommander, and feature long sleep times, so I wasn't certain how best to collect data during these flights. Is there a particular method I should attempt or an example I should look at? Thanks again!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Logging data without an SD Card

Post by kimberly »

Currently there is not really an example that does logging with a swarm... except for perhaps the swarm demo's control tower gui script?

The motion commander has more autonomy on the computer and blocks actions if it's not completed yet. Since it is sending all the setpoints through the crazyradio PA, I would not advise to use that one for swarms. The high level commander enables more autonomy on the drone, so less communication load, so actually you can replace those sleeps for some logging action for that duration of the flight_time.
DM7299
Member
Posts: 31
Joined: Sat Jun 05, 2021 6:04 pm

Re: Logging data without an SD Card

Post by DM7299 »

Ah, thank you! I was able to work out how to log while flying a swarm, but I did so using the motion commander, so I may attempt to rebuild it using the High Level Commander if that's the better tool for these purposes.
DM7299
Member
Posts: 31
Joined: Sat Jun 05, 2021 6:04 pm

Re: Logging data without an SD Card

Post by DM7299 »

Sorry to dredge this back up - I've been a bit stubborn about continuing to use the motion commander for my swarm (and single drone) flights, and for the most part, it has been able to do everything I need it to. Logging, swarm flight, etc - but the one issue I've not yet been able to crack is interrupting a flight while it is ongoing. Is this really impossible using the motion commander, and requires the high level commander? I'd rather not have to rewrite all of my code, but it's seeming more and more likely that transitioning is the only way to do this. Is there any way at all to make this happen?

For reference - my code is intended to allow a CF, while flying, to identify an obstacle using the multi-ranger and then stop (so it can be given different instructions). Anything that would make this possible would be appreciated... but a confirmation that the motion commander absolutely cannot do this would also be useful.

Thanks, and my apologies for not taking your advice the first time!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Logging data without an SD Card

Post by kimberly »

Have you looked at the multiranger push demo example for this? https://github.com/bitcraze/crazyflie-l ... er_push.py

It is exactly doing that, a state machine that responds and reacts on input. The only thing that the Multiranger class is doing is starting up a async logging of the measurements of the multiranger, which you could also do seperately.

The step by step the tutorials on the cflib are a good place to start by the way.
Post Reply