flight_trajectory.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. function [ values ] = flight_trajectory( input_args )
  2. %UNTITLED2 Summary of this function goes here
  3. % Detailed explanation goes here
  4. import gtsam.*;
  5. values = Values;
  6. curvature = 2;
  7. forward = Pose3(Rot3(),Point3(10,0,0));
  8. left = Pose3(Rot3.RzRyRx(0.0,0.0,curvature*pi/180),Point3(10,0,0));
  9. right = Pose3(Rot3.RzRyRx(0.0,0.0,-curvature*pi/180),Point3(10,0,0));
  10. pose = Pose3(Rot3.RzRyRx(0,0,0),Point3(0,0,1000));
  11. plan(1).direction = right;
  12. plan(1).steps = 20;
  13. plan(2).direction = forward;
  14. plan(2).steps = 5;
  15. plan(3).direction = left;
  16. plan(3).steps = 100;
  17. plan(4).direction = forward;
  18. plan(4).steps = 50;
  19. plan(5).direction = left;
  20. plan(5).steps = 80;
  21. plan(6).direction = forward;
  22. plan(6).steps = 50;
  23. plan(7).direction = right;
  24. plan(7).steps = 100;
  25. plan_steps = numel(plan);
  26. values_i = 0;
  27. for i=1:plan_steps
  28. direction = plan(i).direction;
  29. segment_steps = plan(i).steps;
  30. for j=1:segment_steps
  31. pose = pose.compose(direction);
  32. values.insert(symbol('x',values_i), pose);
  33. values_i = values_i + 1;
  34. end
  35. end
  36. end