osprey mpc node
subscribes to path and from_autobox messages. from_autobox msg has callback function which computes MPC control input. source files: calcEnvEnv.cpp calcInitialState.cpp calcLongitudinalDynamics.cpp calcModel.cpp calcMPC.cpp calcScaledOptData.cpp calcTimeHorizon.cpp calcVehEnv.cpp load_constant_structs.cpp mpc_class.cpp mpc_constants.cpp mpc_types.cpp osprey_mpc.cpp parseOptResults.cpp solveCVXGEN.cpp stateOperators.cpp tire_models.cpp world.cpp
calc files
mpc_constants.cpp
load mpc constants to ROS constMsg
- horizon
- state dimension/ input dimension
- number of steps using ZOH/FOH
- duration of short/long time step
- stability envelope options
- conversion factors
mpc_types.cpp
copy data to ROS messages
mpc_class file
osprey simulation
osprey is intended to run at 100Hz, simulation update is calculated using real time difference. In one loop, simulator sends from_autobox msg, which is subscribed by MPC and trigger callback function to compute MPC problem and sends out to_autobox. To_autobox msg, again, triggers simulator to propogate vehicle state. source files:
- testing/simulator/Sim_Class.cpp
- testing/simulator/osprey_sim.cpp
- bicycle_model.cpp:
- load_constant_structs.cpp
- mpc_types.cpp:
- stateOperators.cpp:
- tire_models.cpp
- world.cpp
main files are osprey_sim.cpp and Sim_Class.cpp
mpc_types.cpp
copy data to ROS messages
Sim_Class.cpp
bicycle_model.cpp
- continuousBicycleModel: returns bicycle model derivatives
- simBicycleModel: returns x(t+dT)
load_constant_structs.cpp
load sim/control/X1 parameters
stateOperators.cpp
define + on vehicle states (x + dx) define operator on time and vehicle state (t dx)
tire_model.cpp
calculates lateral force according to tire model