mirror of
https://github.com/nasa/trick.git
synced 2024-12-24 07:16:41 +00:00
7bc6ab74a8
* added SIM_singlerigidbody * Removed a few sections in the README file * Removed the sims directory * Added shutdown job and made minor changes to body.cpp --------- Co-authored-by: Wallace <bnwalla1@scooby.trick.gov>
82 lines
3.7 KiB
Python
82 lines
3.7 KiB
Python
################################################################################
|
|
# _ ___ _ #
|
|
# / |___| _ ) ___ __| |_ _ #
|
|
# | |___| _ \/ _ \/ _` | || | #
|
|
# |_| |___/\___/\__,_|\_, | #
|
|
# __ ___ ___ __|__/ #
|
|
# / / ___| \ / _ \| __| #
|
|
# / _ \___| |) | (_) | _| #
|
|
# \___/ |___/ \___/|_| #
|
|
# #
|
|
# This input creates a simple body with 6 DOF: #
|
|
# -Creates 1 body #
|
|
# -Initializes 6 DOF #
|
|
################################################################################
|
|
|
|
# ============================================================================ -
|
|
# This file is used to store several quality of life python functions.
|
|
# ============================================================================ -
|
|
exec(open("Modified_data/state_data.dr").read())
|
|
exec(open("Modified_data/realtime.py").read())
|
|
|
|
################################################################################
|
|
# dyn DATA #
|
|
# (NOTE: dyn is our instance of BodySimObject) #
|
|
# This builds our objects, and defines their physical properties. #
|
|
################################################################################
|
|
|
|
# ============================================================================ -
|
|
# Establish the physical properties of the body...CONSTANTS!
|
|
# ============================================================================ -
|
|
dyn.body.mass = 20.0
|
|
dyn.body.radius = 2.0
|
|
|
|
# ============================================================================ -
|
|
# Initialize system
|
|
# ============================================================================ -
|
|
M_PI = 3.141592653589793238460
|
|
|
|
#dyn.body.POS_INIT[0] = 0.0
|
|
#dyn.body.POS_INIT[1] = 0.0
|
|
#dyn.body.POS_INIT[2] = 0.0
|
|
|
|
#dyn.body.ANGLE_INIT[0] = 0.0
|
|
#dyn.body.ANGLE_INIT[1] = 0.0
|
|
#dyn.body.ANGLE_INIT[2] = 0.0
|
|
|
|
#dyn.body.OMEGA_INIT[0] = 0.0
|
|
#dyn.body.OMEGA_INIT[1] = 0.0
|
|
#dyn.body.OMEGA_INIT[2] = 0.0
|
|
|
|
#dyn.body.FORCE_INIT[0] = 0.0
|
|
#dyn.body.FORCE_INIT[1] = 0.0
|
|
#dyn.body.FORCE_INIT[2] = 10.0
|
|
|
|
#dyn.body.TORQUE_INIT[0] = 0.0
|
|
#dyn.body.TORQUE_INIT[1] = 0.0
|
|
#dyn.body.TORQUE_INIT[2] = 0.0
|
|
|
|
#dyn.body.VEL_INIT[0] = 0.0
|
|
#dyn.body.VEL_INIT[1] = 0.0
|
|
#dyn.body.VEL_INIT[2] = 0.0
|
|
|
|
#dyn.body.POS_FORCE[0] = 2.0
|
|
#dyn.body.POS_FORCE[1] = 0.0
|
|
#dyn.body.POS_FORCE[2] = 0.0
|
|
|
|
################################################################################
|
|
# SIMULATION SET UP #
|
|
# This is where we set up the remaining inputs to create a working sim. #
|
|
################################################################################
|
|
|
|
# ============================================================================ -
|
|
# getintegrator(integration method, number of variables to be integrated)
|
|
# This sets up the integration scheme we use to analyze this system.
|
|
# ============================================================================ -
|
|
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 12)
|
|
|
|
# ============================================================================ -
|
|
# This tells the sim to stop after a few seconds
|
|
# ============================================================================ -
|
|
trick.stop(10.0)
|