Code: Select all
CompressedStart(0.0, 0.0, 0.0, 0.0)
CompressedSegment(2.0, [0.0, 1.0, 1.0], [0.0, a, 0.0], [], [])
CompressedSegment(2.0, [1.0, b, 0.0], [-a, -c, 0.0], [], []),
CompressedSegment(2.0, [-b, -1.0, -1.0], [c, a, 0.0], [], []),
CompressedSegment(2.0, [-1.0, 0.0, 0.0], [-a, 0.0, 0.0], [], []),
It means that it will start at (0.0, 0.0, 0.0) and follow a cubic Bezier curve to (1.0, 0.0, 0.0), with control points in (0.0, 0.0, 0.0) and (1.0, a, 0.0)
It will continue along a cubic Bezier curve to (0.0, 0.0, 0.0), with control points in (1.0, -a, 0) and (b, -c, 0.0)
continue to (-1.0, 0.0, 0.0) with control points in (-b, c, 0.0) and (-1.0, a, 0.0)
and finally go back to (0.0, 0.0, 0.0) with control points in (-1.0, -a, 0.0) and (0.0, 0.0, 0.0)
If you plot the X and Y coordinates you can see that it will fly a figure 8, starting in the middle of the eight.
i would like to look at this line: CompressedSegment(2.0, [0.0, 0.0, 1], [0.0, 0.0, 1.0], [], []),
i understood that the 2.0 stands for the Duration. The first two brackets decribe the X and Y axis. (here, [0.0, 0.0, 1.0], [0.0, 0.0, 1.0],..) means, that the Crazyflie should fly to position x=1 and y=1 right? But what do the first two zeros indicate for example in [0.0, 0.0, 1.0]?
The first element of the lists represents the first control point, the second element of the lists is the second control point and the third element is the end point. In this case you would have your control points in (0.0, 0.0, ?) and (0.0, 0.0, ?), while the end point would be (1.0, 1.0, ?). Assuming your start point is (0.0, 0.0, ?) the Crazyflie would start by going in the direction of the first control point, which is (0.0, 0.0, 0.0), that is it would stay where it is. After some time it would go more towards the second control point, which is also (0.0, 0.0, 0.0), that is it would stay where it is. At the end it will go to the end point (1.0, 1.0, ?). To conclude you would get a motion where it starts at (0.0, 0.0, ?) and goes towards (1.0, 1.0, ?) at the end.
You can play with bezier curves here
https://javascript.info/bezier-curve for instance. Note that there is a time component that is not obvious when looking at the curves like this. The positions of the control points not only affect the shape of the curve, but also velocity and acceleration. Putting the first control point at the same coordinate at the starting point means that it initially will not have any velocity. Similarly it will come to a stop if the second control point has the same coordinate as the end point. If the control points are at other coordinates, it will imply that the CF will have a velocity.