whoenig / uav_trajectories

Helper scripts and programs for trajectories
MIT License
85 stars 46 forks source link

Trajectory throws an error when two waypoints are the same #1

Open J-Durotifa opened 5 years ago

J-Durotifa commented 5 years ago

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)

whoenig commented 5 years ago

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.

NicksonYap commented 5 years ago

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?

whoenig commented 5 years ago

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.

J-Durotifa commented 5 years ago

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?

NicksonYap commented 5 years ago

@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