Want to record a trajectory and then play it back

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
Federico Rossi
Beginner
Posts: 12
Joined: Fri Nov 30, 2018 10:11 pm

Want to record a trajectory and then play it back

Post by Federico Rossi »

Hi,

I am part of a team that has recently acquired a swarm bundle.

We want to record a given trajectory by moving the CF manually and then play it back by sending those same coordinates to the CF.

I believe there was a post describing how to move the CF manually in order to record the trajectory but could not find it. Is it possible to do this and how exactly?

Thanks and congrats for an amazing product!

Fede R.-
coreysnipes
Beginner
Posts: 16
Joined: Mon Jan 21, 2019 3:09 am
Location: Cleveland, OH, USA
Contact:

Re: Want to record a trajectory and then play it back

Post by coreysnipes »

arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Want to record a trajectory and then play it back

Post by arnaud »

This is correct, the icra demo was implementing this functionality. The file that has the implementation is there: https://github.com/bitcraze/crazyflie-f ... /retrace.c.

As a side note, this code should work with any positioning system, we had it working without modification in a Qualisys mocap: https://www.youtube.com/watch?v=3lDvWlbDSOA.
Federico Rossi
Beginner
Posts: 12
Joined: Fri Nov 30, 2018 10:11 pm

Re: Want to record a trajectory and then play it back

Post by Federico Rossi »

Hi @arnaud and @coreysnipes, thanks for your quick reply! We will check the links and get back to you in case we have any question.

Fede R.-
Federico Rossi
Beginner
Posts: 12
Joined: Fri Nov 30, 2018 10:11 pm

Re: Want to record a trajectory and then play it back

Post by Federico Rossi »

Hi again.

Thanks for the videos and the additional links you provided as a reference. What we want to achieve might be slightly different though. We put the post in the Autonomous Flight section, now we are not sure if it the post was for the Positioning System section instead. Sorry if that is the case, we are newbies still learning about the CF and the channels we have for posting our questions.

Let me provide some further insight. We understand there are several ways in which we could feed a trajectory to the CF from an external system, among them we have:

1. Calculate the trajectory by hand and then transmit the coordinates to the CF from an external script
2. Convert the output from a system like Cinema4D or similar and then transmit the coordinates to the CF from an external script
3. Turn on the CF and move it by hand with the CF transmitting all coordinates along the path to an external system for recording. Later on we want to reproduce the same path from an external script.

Our initial question was related to option 3 above. We want to playback a pre-recorded trajectory from an external script. CAn we use the logger functionality for that and how? Is there a better way than using the logger?

Again, thanks for your support. We really appreciate.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Want to record a trajectory and then play it back

Post by tobias »

A kind of short answer to your question. Yes you can use the logging framework to record variables such as position. There are different levels of complexity to this though as it depends on how accurately you wan't it to be played back. You could potentially record pose, speed and acceleration too...

Simplest, I think, is to just record the position. You could do this by creating a log block in the cflient with the variables "kalman.stateX, kalman.stateY, kalman.stateZ" and then save it to a CSV file. This data you could then use to send position setpoints to the crazyflie.
Federico Rossi
Beginner
Posts: 12
Joined: Fri Nov 30, 2018 10:11 pm

Re: Want to record a trajectory and then play it back

Post by Federico Rossi »

Hi Tobias,

Thanks for the details. And also thanks for replying so quick. We are glad to see that we have timely support from the team there.

Fede R.
Post Reply