-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started With the Sim
The most current version is typically in the branch dev_dev. Although the most current stable version will be in "dev". So if you have just cloned the repository try out dev_dev to see if things are working and if not go back to dev.
The folder structure looks like this soci-gnc
Include Lib Src Test
Src contains the main simulink file as well as sim_init.m. In order to do anything first make sure you are inside the Src folder and run sim_init.m.
The Lib folder contains all of our simulink libraries along with their corresponding init files. All libraries require an init file to set up their specific set of variables or constants.
The Test folder contains all of our testing scripts and simulink unit tests.
The Include folder is probably a little harder to understand but will eventually make sense. For now just htink of it as the scripts that trigger the initialization of all of our libraries. In addition it contains scripts that set up all of our data types.
Provided that there is nothing horribly wrong inside the main sim getting it to run is fairly straight forward. The steps are the following:
- make sure you are inside the Src folder
- Run sim_init.m
- Should you get no errors open up mainSim.slx inside Src
- Run the simulink file.
You may notice after running sim init there are a few variables in the workspace. Chiefly you should see the two structs:
- simParams
- fswParams
simParams is a large struct containing all of the variables and constants necessary to run the sim. For example the vehicle weight is stored in "simParams.scParams.m_2u". Likewise the fswParams contains all of the variables and constants necessary to run flight software. These two variable are populated when you run sim_init triggering the "include" director to run the "init_params.m" script. Init_params just runs all of those library init files I talked about earlier. In addition sim_init sets up all of your folder paths so that simulink can find all the libraries it needs.