uav_trajectories icon indicating copy to clipboard operation
uav_trajectories copied to clipboard

Trajectory throws an error when two waypoints are the same

Open J-Durotifa opened this issue 5 years ago • 5 comments

I tried the UAV-trajectory generation tool, but whenever I have two waypoints with the same values in succession (like a pause during flight) , I get the error message below. How do I generate trajectories that gives room for pauses during flight?

WARNING: Logging before InitGoogleLogging() is written to STDERR F0425 11:04:29.853758 22964 polynomial_optimization_linear_impl.h:287] Check failed: segment_time > 0 (0 vs. 0) Segment times need to be greater than zero *** Check failure stack trace: *** Aborted (core dumped)

J-Durotifa avatar Apr 25 '19 12:04 J-Durotifa

I think a good workaround is to simply generate multiple trajectories - this way you can also control (in your high-level code) how long the pause should be. In the library that is used here, it is also possible to add constraints on derivatives, i.e., you could force the velocity to be zero at a certain waypoint. However, since the timing is computed automatically based on the dynamic limits of your quadrotor, this would not result in a user-configurable pause.

whoenig avatar Apr 26 '19 01:04 whoenig

Hi @whoenig

Just some feedbacks & questions here.

I have some waypoints generated from Blender, where it defines what time to be at what coordinate image

Here's a csv of the path shown above sequence_000.zip It has: Timestamp (100ms interval), x,y,z (absolute) and r, g, b

Can this lib be easily extended to also meet time constraints?

NicksonYap avatar May 08 '19 07:05 NicksonYap

This tool is not made for this purpose. The problem you are describing is actually simpler (mathematically speaking): a trajectory is just another representation of positions (and higher order derivatives) over time. It looks like Blender already generated some smooth curve (e.g., Bezier curve?). All you would need to do is to export the curve itself and convert it the trajectory format (8th order polynomial spline) that is used for the Crazyflie. This repository here deals with the problem of finding timing information if only the waypoints are known.

whoenig avatar May 08 '19 17:05 whoenig

This tool is not made for this purpose. The problem you are describing is actually simpler (mathematically speaking): a trajectory is just another representation of positions (and higher order derivatives) over time. It looks like Blender already generated some smooth curve (e.g., Bezier curve?). All you would need to do is to export the curve itself and convert it the trajectory format (8th order polynomial spline) that is used for the Crazyflie. This repository here deals with the problem of finding timing information if only the waypoints are known.

Hi Whoenig,

I would like to use timestamped Cartesian coordinates to generate 8th order polynomials like NicksonYap showed in his CSV and i don't know how to do this. Is this something you can elaborate on?

J-Durotifa avatar May 12 '19 07:05 J-Durotifa

@J-Durotifa so far this is not handled by this repo, nor was it the goal for creating Trajectories

Assuming you use Crazyflie, for now we can only use Crazyflie's Timescale to speed up or slow down the whole Trajectory (a chain of polynomials)

It's equivalent to this repo's 'stretchtime' argument in: https://github.com/whoenig/uav_trajectories/blob/master/scripts/plot_trajectory.py

For more details on possible workarounds, See: https://github.com/whoenig/uav_trajectories/issues/3

NicksonYap avatar May 12 '19 08:05 NicksonYap