Uploading multipe trajectories, and overwriting trajectories in memory.

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
LupoCani
Beginner
Posts: 1
Joined: Thu Jul 11, 2019 1:42 pm

Uploading multipe trajectories, and overwriting trajectories in memory.

Post by LupoCani » Thu Jul 11, 2019 2:16 pm

Hello, I am currently trying to control a crazyflie nano quadcopter by means of several, possibly dynamically generated, trajectories.

First, I am having trouble setting several trajectories. This example demonstates how to upload, set and fly along a single trajectory, but I have been unable to generalize this to more than one.
  • "upload_trajectory" can be used twice, with two different IDs. The first trajectory will be usable as before. However, the second trajectory will somehow include both original trajectories - that is, calling "start_trajectory" with the ID of the second trajectory will cause the drone to first fly along the first trajectory, then along the second.
  • Supsecting that this is because the "offset" argument taken by "define_trajectory", set to "0" in the example, I have replacing this value with several estimates of the length of the first trajectory when uploading the second trajectory. However, all values tried thus far result instead in the drone immedately stopping its rotors when calling "start_trajectory" with the ID of the second trajectory.
Do I understand correctly that the "offset" argument is, in fact, what needs adjusting? Further, where is the proper use of "upload" and "define_trajectory" documented?

Second, I am hoping to upload several trajectories while in flight, such that the memory capacity of the Crazyflie might be exceeded. Any given trajectory is likely to be used only once, so overwrting older ones in memory is acceptable, so long as the last two or three trajectories are preserved. Is this supported?



estrategico
Beginner
Posts: 14
Joined: Mon Aug 13, 2018 3:20 am

Re: Uploading multipe trajectories, and overwriting trajectories in memory.

Post by estrategico » Mon Jul 15, 2019 3:10 pm

Hello Lupo, some tips from my experiencies:

>>>First, I am having trouble setting several trajectories. This example demonstates how to upload, set and fly along a single trajectory, but I have been unable to generalize this to more than one.
"upload_trajectory" can be used twice, with two different IDs. The first trajectory will be usable as before. However, the second trajectory will somehow include both original trajectories - that is, calling "start_trajectory" with the ID of the second trajectory will cause the drone to first fly along the first trajectory, then along the second.
Supsecting that this is because the "offset" argument taken by "define_trajectory", set to "0" in the example, I have replacing this value with several estimates of the length of the first trajectory when uploading the second trajectory. However, all values tried thus far result instead in the drone immedately stopping its rotors when calling "start_trajectory" with the ID of the second trajectory.
Do I understand correctly that the "offset" argument is, in fact, what needs adjusting? Further, where is the proper use of "upload" and "define_trajectory" documented?

R. I didn't find any documentation of that but my experience is that the offset must be the number of steps of the last trajectory uploaded, multiplied by 132.

>>>Second, I am hoping to upload several trajectories while in flight, such that the memory capacity of the Crazyflie might be exceeded. Any given trajectory is likely to be used only once, so overwrting older ones in memory is acceptable, so long as the last two or three trajectories are preserved. Is this supported?

R.Yes, you can upload(overwrite), define, and play trajectories on air, and you can use each trajectory uploaded at anytime and multiple times, you must have care that the ending points of the last trajectory must be near the starting points of the next.

Hope this helps

Post Reply