-
Notifications
You must be signed in to change notification settings - Fork 14
Building simulations from code
edrumwri edited this page Nov 3, 2014
·
9 revisions
- Create the simulation (
Simulatorif no contacts or joint limits,EventDrivenSimulatorotherwise) - Create one or more model(s) and add them to the simulation, see Constructing models
- Set contact parameters for any bodies that may come into contact (unnecessary for
Simulator), see EventDrivenSimulator.h - Set unchecked pairs, denoting bodies not checked for contact (unnecessary for
Simulator), see EventDrivenSimulator.h - Create controllers for any models that you want to control programmatically. Attempting to control models between simulation steps is not recommended, because the simulator can take multiple intermediate steps between a single nominal step.
- Run the simulation in a loop:
- Select a step size (typically from 0.0001 to 0.1)
- Step the simulation
- Update any graphics (you can call the the
update_visualization()method if you're using OpenSceneGraph)