mirror of
https://github.com/nasa/trick.git
synced 2025-02-20 09:16:20 +00:00
Updates for Example Sims (#655)
* Move integloop initialization from input file to S_defines create_connections routine * Add README.md to describe the ball sims.
This commit is contained in:
parent
84f67ef79f
commit
d90a979b36
51
trick_sims/Ball/README.md
Normal file
51
trick_sims/Ball/README.md
Normal file
@ -0,0 +1,51 @@
|
||||
# Ball Sims
|
||||
|
||||
## SIM\_ball\_L1
|
||||
|
||||
This is a simulation of a ball under the influence of a force field.
|
||||
The force on the ball is of constant magnitude, and always directed
|
||||
toward a fixed point.
|
||||
|
||||

|
||||
|
||||
#### Inputs
|
||||
| Parameter | Units | Default |
|
||||
|:---------------------------- |:-----:|:-------:|
|
||||
| ball.force.input.origin[2] | m | { 0.0, 2.0 } |
|
||||
| ball.force.input.force | N | 8.0 |
|
||||
| ball.state.input.mass | kg | 10.0 |
|
||||
| ball.state.input.speed | m/s | 2.0 |
|
||||
| ball.state.input.elevation | rad | 45 ° x (180/π) |
|
||||
| ball.state.input.position[2] | m | { 5.0, 5.0 } |
|
||||
|
||||
#### Outputs
|
||||
| Parameter | Units |
|
||||
|:--------------------------------- |:-----:|
|
||||
| ball.state.output.position[2] | m |
|
||||
| ball.state.output.velocity[2] | m |
|
||||
| ball.state.output.acceleration[2] | m |
|
||||
|
||||
|
||||
## SIM\_ball\_L2
|
||||
|
||||
This simulation is a derivation of SIM\_ball\_L1. It uses Trick "dynamic-events" to simulate walls, off of which the ball can bounce.
|
||||
|
||||

|
||||
|
||||
#### Inputs
|
||||
*(In addition to those of SIM\_ball\_L1)*
|
||||
These parameters define the coordinates of the walls.
|
||||
|
||||
| Parameter | Units | Default |
|
||||
|:----------------------------------- |:-----:|:-------:|
|
||||
| ball.force.input.floor\_y\_pos | m | -10.0 |
|
||||
| ball.force.input.right_wall\_x\_pos | m | 10.0 |
|
||||
| ball.force.ceiling\_y\_pos | m | 10.0 |
|
||||
| ball.force.left_wall\_x\_pos | m | -10.0 |
|
||||
|
||||
The outputs are the same as those of SIM\_ball\_L1.
|
||||
|
||||
|
||||
## SIM\_ball\_L3
|
||||
|
||||
This simulation is a derivation of SIM\_ball\_L2. The SIM\_ball\_L3 S_define instanciates two ballSimObject's rather than just one.
|
BIN
trick_sims/Ball/images/Ball_L1.png
Normal file
BIN
trick_sims/Ball/images/Ball_L1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
BIN
trick_sims/Ball/images/Ball_L2.png
Normal file
BIN
trick_sims/Ball/images/Ball_L2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
@ -1,7 +1,5 @@
|
||||
execfile("Modified_data/realtime.py")
|
||||
|
||||
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 5)
|
||||
|
||||
#==========================================
|
||||
# Start the Cannonball Graphics Client
|
||||
#==========================================
|
||||
|
@ -1,5 +1,2 @@
|
||||
|
||||
execfile("Modified_data/realtime.py")
|
||||
execfile("Modified_data/cannon.dr")
|
||||
|
||||
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 5)
|
||||
|
@ -29,3 +29,7 @@ class CannonSimObject : public Trick::SimObject {
|
||||
CannonSimObject dyn ;
|
||||
|
||||
IntegLoop dyn_integloop (0.01) dyn;
|
||||
|
||||
void create_connections() {
|
||||
dyn_integloop.getIntegrator(Runge_Kutta_4, 5);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user