Commit Graph

15 Commits

Author SHA1 Message Date
Sravan Balaji
390cdabc5a Adjust Some Parameters
- Increase `sim_stop_idx` to near the limit
- Adjust some cost parameters
- Remove unused `NL` cost parameter
- Increase `fmincon` iteration & evaluation limits
- Decrease `fmincon` constraint tolerance
2021-12-13 16:07:22 -05:00
Sravan Balaji
593d451ebf Add Gradients for Cost Function & Nonlinear Constraints
- Set gradient options to true for `fmincon` optimizer
- Play with optimizer limits a bit
- Add gradient computation for cost function
- Add gradient computation for track & obstacle constraints
- Compute gradients offline in `miscellaneous_stuff.m`
- Update `point_to_line` to output signed distance
2021-12-13 14:21:52 -05:00
Sravan Balaji
3d3c53fcd1 Continuous Track/Boundary Constraints
- Adjust input error cost for steering angle
- Increase `fmincon` maximum function evaluations
- Add buffer factors for track boundary distance
  and obstacle radius
- Add intermediate variables for calculating the
  number of constraints
- Change discrete `inpolygon` constraints to continuous
  function based constraints where obstacles are modeled
  as circles and distance/direction from track boundary
  is computed
- Add `point_to_line` function for computing track boundary
  quantities
2021-12-13 11:59:43 -05:00
Sravan Balaji
7d502fa8f5 Create New Trajectory 2021-12-13 10:25:18 -05:00
Sravan Balaji
d591bb68c9 Try adjusting track boundary constraints (still being violated, but not detected)
- Use all track boundary points when checking if position is inside
- Still fails to stop simulation when car goes off track
2021-12-13 07:45:23 -05:00
Sravan Balaji
91fc8ff4c3 Playing with Nonlinear Constraint Costs
- Drastically increase nonlinear constraint violation cost (I think)
- Make state & input costs much smaller than constraint costs
- Add condition to stop simulation if nonlinear constraint
  is not satisfied (doesn't seem to work for going off track)
- Create separate nonlinear constraints for each state to check
  if it is on track and if it doesn't intersect each obstacle
- Change indexing of nonlinear constraints
2021-12-13 07:16:27 -05:00
Sravan Balaji
69c704e66b More outputs / debugging info
- Decrease `sim_stop_idx` to 1500
- Add some debugging messages for when simulation hits
  limit or when `fmincon` can't satisfy constraints
- Add more `fmincon` outputs for future debugging
- Add obstacle information to `getTrajectoryInfo` call
  in `part2_test_controller.m` to see when car crashes
2021-12-12 17:31:52 -05:00
Sravan Balaji
6f6db84c23 Simulation Stop Index & Obstacle Plotting
- Add parameter to stop simulation when specified
  index in reference trajectory is reached
- Modify `forwardIntegrate` to return `Xobs` for plotting
- Plot obstacles in part2 testing figure
- Change some line plotting styles for clarity
2021-12-12 16:29:20 -05:00
Sravan Balaji
5534819d90 File Renaming / Reorganization & Minor Changes
- Add 1/2 coefficient to cost function
- Move `MPC_Class.m` to "Deliverables" folder
- Modify `part2_test_controller.m` plotting style a bit
- Rename `part2_MPC_controller.m` to `sravan_MPC_controller.m`
2021-12-12 16:03:27 -05:00
Sravan Balaji
96aa438587 Bunch of new properties, remove unnecessary function arguments
- Add properties for prediction horizon of states & inputs
- Add properties for obstacles, current state, reference index,
  and termination flag
- Update constructor to take in and set new properties
- Move properties with calculated values to constructor
- Remove function inputs for new properties
- Rename `curr_state` to `Y_curr` in `MPC_Class.m`
- Use object properties instead of function arguments (e.g., obj.ref_idx)
2021-12-12 13:26:15 -05:00
Sravan Balaji
d16e25ca85 Update part2 function to use MPC_Class
- Update part2 deliverable function to use `MPC_Class`
- Clean-up some comments in `MPC_Class`
- Add MPC tunable parameters to `MPC_Class`
- Add TODO comments
2021-12-10 08:05:47 -05:00
Sravan Balaji
6416cc762b Reference Trajectory States & Global Variable Clean-Up
- Add generated states from part 1 as variable
  `ROB535_ControlProject_part1_state` to
  `ROB535_ControlProject_part1_Team3.mat`
- Make step size and prediction horizon global variables
- Remove references to unused global variables
- Fix reference trajectory indexing with "i" based
  on `ROB535_ControlProject_part1_state` variable
- Replace `dt` with `T_s` in `linearized_bike_model`
2021-12-09 14:27:38 -05:00
Sravan Balaji
f7b9eb687c Extend end of part 1 trajectory so car crosses finish line
- Increase the number of steps in last sector so the
  car actually crosses the finish line and registers
  a "t_finished" in the getTrajectoryInfo output
2021-12-08 11:26:43 -05:00
Sravan Balaji
b036087001 Add Gitignore & Garbage Submission for Part 2
- Add gitignore for matlab's "asv" files
- Provide garbage inputs for qualifying session submission of part 2
2021-11-30 15:45:46 -05:00
Sravan Balaji
33945f6414 Re-Organize Files Again
- Deliverables folder holds final files for submission
- Experimentation holds scripts and things related to our development of
  a final solution
- Simulation holds the provided files
- Added template for part 2 submission with comments
2021-11-30 11:17:24 -05:00