Script to compress trajectories

All discussions related to the Loco Positioning system
Post Reply
estrategico
Beginner
Posts: 21
Joined: Mon Aug 13, 2018 3:20 am

Script to compress trajectories

Post by estrategico »

I don't understand how to convert a Raw representation to the Compressed representation, maybe if you have any example or script, it will help.

Also, I have question: if a single segment requires 132 bytes, how many bites does the compressed representation need?

I really don't use te 7th degree polynomials, the trajectories are linear, i use the trajectory just as a resource to feed the sequence in memory.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Script to compress trajectories

Post by whoenig »

Perhaps https://github.com/whoenig/uav_trajecto ... tion-pairs helps: You can encode a list of timed waypoints to trajectories with a specified number of pieces, i.e., if you want to reduce the memory you can reduce the number of pieces. The script solves an optimization problem, so it is not guaranteed that the drone will actually go through the given points, though.

If you only need waypoints, you can also use the high-level commander goTo functionality.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Script to compress trajectories

Post by arnaud »

Are you talking about this pull requests: https://github.com/bitcraze/crazyflie-firmware/pull/504?

If so, the format has been documented (https://www.bitcraze.io/docs/crazyflie- ... y_formats/) but I have never tested it and I am not aware of any script that can generate it. From what I understand though, the idea is not to convert a polynomial representation to compressed but more to express your trajectory directly using the compressed form.
estrategico
Beginner
Posts: 21
Joined: Mon Aug 13, 2018 3:20 am

Re: Script to compress trajectories

Post by estrategico »

arnaud wrote: Mon Nov 25, 2019 2:29 pm Are you talking about this pull requests: https://github.com/bitcraze/crazyflie-firmware/pull/504?

If so, the format has been documented (https://www.bitcraze.io/docs/crazyflie- ... y_formats/) but I have never tested it and I am not aware of any script that can generate it. From what I understand though, the idea is not to convert a polynomial representation to compressed but more to express your trajectory directly using the compressed form.
Yes, I´m talking about to the PR #504

Does the CF understand the compressed format before or just now that the PR was merged?

Is there a example sequence in compressed format to use as reference?

I build a python script that writes a trajectory sequence from animated object positions from Blender but in raw format, i want to take advantage of the compressed format, so now i want the script to write the trajectory in that format instead, but i don't understand the notation and how the data have to be formatted.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Script to compress trajectories

Post by arnaud »

It is correct that the compressed format was not understood before this PR was merged so you need to use the latest master if you want to use compressed trajectory (in general, the doc can only be applied to the latest master, we are planning to generate doc for each released version as well but it is not done yet).

Unfortunately I have not had the time to test the new format yet, looking at the PR and the doc I was expecting the documentation to be good enough to get write trajectory.

My suggestion would be to make a new ticket in either the crazyflie-firmware or crazyflie-lib-python repos mentioning the author of the PR to get his input on this.
Post Reply