Trouble with Trajectory Tracking | What is pieceOffset? #704
-
Hello, I am using crazyswarm to track generated trajectories, and I've gotten the crazyflie to correctly track a single generated trajectory. To do this, I'm using the two ROS services provided by crazyswarm:
Using these services, I upload two different simple trajectories, one that moves the crazyflie forward and one that moves the crazyflie backwards. I use uploadTrajectory to upload both, then I start one trajectory, wait until that trajectory is finished, and then start the second trajectory. Each trajectory is started with relative=True, so that the trajectory is always relative to the current position of the crazyflie. The problem is that no matter what order the trajectories are uploaded in (forward then backward, or backward then forward), the crazyflie always crashes when tracking the second trajectory only. The uploadTrajectory service has a pieceOffset parameter, which is an integer and looks like it has something to do with memory allocation, but isn't explained in the code or docs. When I change this pieceOffset, I see different behavior when the crazyflie tries to track the second trajectory, sometimes getting halfway through before crashing. This leads me to believe this might be a memory allocation issue. I was wondering if anyone had an idea as to might be going wrong? Or at the very least, what the pieceOffset parameter does when allocating memory? Any ideas would be appreciated! Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Each trajectory is described by 1 or more polynomials (rows in the csv file if you use that for uploading). If you want to upload multiple trajectories, the pieceoffset essentially describes the row you are referring to. So for the first trajectory the offset is 0, for the second it is the number of rows the first csv file had. |
Beta Was this translation helpful? Give feedback.
Each trajectory is described by 1 or more polynomials (rows in the csv file if you use that for uploading). If you want to upload multiple trajectories, the pieceoffset essentially describes the row you are referring to. So for the first trajectory the offset is 0, for the second it is the number of rows the first csv file had.