Esempio n. 1
0
# from chap2.video_writer import video_writer
from chap3.mav_dynamics import mav_dynamics
from chap3.data_viewer import data_viewer

# import parameters
import parameters.simulation_parameters as SIM
# import message types
from message_types.msg_state import msg_state

from IPython.core.debugger import Pdb

# initialize viewers and video
VIDEO = False  # True==write video, False==don't write video
mav_view = mav_viewer()
data_view = data_viewer()
mav = mav_dynamics(SIM.ts_simulation)
cmd_state = msg_state()
if VIDEO:
    video = video_writer(video_name="chap3_video.avi",
                         bounding_box=(0, 0, 1000, 1000),
                         output_rate=SIM.ts_video)

FM_list = ['fx', 'fy', 'fz', 'l', 'm', 'n']
# main simulation loop
for i in range(6):
    # initialize the simulation time
    sim_time = SIM.start_time
    forces_moments = np.zeros(6)  # fx, fy, fz, l, m, n
    if i < 3:
        val = 100
        print('***** APPLYING FORCE {} OF {} N *****'.format(FM_list[i], val))
Esempio n. 2
0
from chap2.mav_viewer import mav_viewer
#from chap2.video_writer import video_writer
from chap3.data_viewer import data_viewer
from chap3.mav_dynamics import mav_dynamics

# initialize the visualization
VIDEO = False  # True==write video, False==don't write video
mav_view = mav_viewer()  # initialize the mav viewer
data_view = data_viewer()  # initialize view of data plots
if VIDEO == True:
    video = video_writer(video_name="chap3_video.avi",
                         bounding_box=(0, 0, 1000, 1000),
                         output_rate=SIM.ts_video)

# initialize elements of the architecture
mav = mav_dynamics(SIM.ts_simulation, [P.pn0, P.pe0, P.pd0])

# initialize the simulation time
sim_time = SIM.start_time

# main simulation loop
print("Press Command-Q to exit...")
while sim_time < SIM.end_time_short:
    if sim_time < SIM.end_time_short / 12.:
        #-------vary forces and moments to check dynamics-------------
        fx = 10.  #10
        fy = 0  # 10
        fz = 0  # 10
        Mx = 0  # 0.1
        My = 0  # 0.1
        Mz = 0  # 0.1