Page 1 of 1

Script to compress trajectories

Posted: Sat Nov 23, 2019 10:40 pm
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.

Re: Script to compress trajectories

Posted: Sun Nov 24, 2019 4:17 am
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.

Re: Script to compress trajectories

Posted: Mon Nov 25, 2019 2:29 pm
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.

Re: Script to compress trajectories

Posted: Thu Dec 05, 2019 12:05 am
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.

Re: Script to compress trajectories

Posted: Thu Dec 05, 2019 9:19 am
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.