Open RandyChen233 opened 2 years ago
Hi Randy,
You can generate an object of the class MinimumSnapTrajectoy as long as you have appropriate tau_vec and path arguments.
traj_obj = MinimumSnapTrajectory(tau_vec, path)
path should consist of the way points including start and end, and tau_vec should be time intervals corresponding to that path.
If you want to allocate time interval automatically, you can use time allocation technique that I used in here.
If you want to allocate time interval automatically, you can use time allocation technique that I used in here.
path = [0,0,0;1,1,0;2,0,0;1,-1,0;0,0,0;-1,1,0;-2,0,0;-1,-1,0;0,0,0]; tau_vec = timeAllocation(path, 100)';
If you want to allocate time interval automatically, you can use time allocation technique that I used in here.
path = [0,0,0;1,1,0;2,0,0;1,-1,0;0,0,0;-1,1,0;-2,0,0;-1,-1,0;0,0,0]; tau_vec = timeAllocation(path, 100)';
With this generated tau_vec
, you can create a trajectory object.
If you want to allocate time interval automatically, you can use time allocation technique that I used in here.
path = [0,0,0;1,1,0;2,0,0;1,-1,0;0,0,0;-1,1,0;-2,0,0;-1,-1,0;0,0,0]; tau_vec = timeAllocation(path, 100)';
With this generated
tau_vec
, you can create a trajectory object.
The second argument 100
is time penalty. If you increase this number, you will have shorter time intervals, meaning having a faster trajectory.
thank you so much!!! just another question: how should I design the desired yaw vector such that the heading of the drone is aligned with the direction it is going? I think intuitively I should just set desired.yaw = desired. velocity, but I keep getting some errors that I don't know how to resolve
yawd = desired_state.yaw; yawd_dot = desired_state.yawdot; yawd_2dot = desired_state.yawddot;
you get errors when you set desired yaw as implemented in the controller.m ?
Sorry I didn't make it clear: I was trying to change desired.yaw
such that when the simulation is run, the heading of the drone is aligned with the trajectory (direction of the path). I thought I can set desired.yaw = vel
, but it is not working
desired.yaw
should be a scalar whereas vel
is 3-dimensional vector. I don't think you can just set equal them.
I see, thanks! Is there a way to make the heading direction point along the trajectory?
Hi,
Your code is very well written! I just have a question: how should I remove the obstacle constraints in the path planning? I would like to generate a 3-D minimum snap trajectory without any obstacle constraints at all (such as the screenshot of that helical path). I can't figure out how I should do that by modifying 'mainsim.m'