예제 #1
0
파일: unit_test.py 프로젝트: Arafatk/trick
def main():

    # Data recording test
    drg0 = trick.DRAscii("Ball")
    for param in [ 'position' , 'velocity' , 'acceleration' , 'external_force' ] :
        for index in range(0,2) :
            var = "ball.obj.state.output." + param + "[" + str(index) + "]"
            drg0.add_variable(var)
    drg0.set_cycle(0.01)
    drg0.freq = trick.DR_Always
    drg0.thisown = 0
    trick.add_data_record_group(drg0, trick.DR_Buffer)

    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4);

    trick_message.mpublisher.sim_name = "ball_sim"

    trick.checkpoint_pre_init(False)
    trick.checkpoint_post_init(False)
    trick.checkpoint_end(False)

    trick.exec_set_freeze_frame(0.10)
    trick.stop(300.0)

    trick_utest.unit_tests.enable() ;
    trick_utest.unit_tests.set_file_name( os.getenv("TRICK_HOME") + "/trick_test/SIM_Ball++_L1.xml" ) ;
예제 #2
0
def main():

    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4)

    trick_message.mpublisher.sim_name = "ball_sim"

    read = 0.0
    trick.add_read(read,"""trick.checkpoint("chkpnt_pre_init")""")

    trick.exec_set_freeze_frame(0.10)
    trick.stop(300.0)
예제 #3
0
파일: echo_job.py 프로젝트: Arafatk/trick
def main():
    simControlPanel = trick.SimControlPanel()
    simControlPanel.thisown = 0
    #trick.add_external_application(simControlPanel)

    #ball.my_integ = trick.getIntegrator( trick.Runge_Kutta_2, 4, 1.0);
    my_integ_loop.getIntegrator( trick.Runge_Kutta_2, 4 )

    trick_message.mpublisher.sim_name = "ball_sim"
    trick.stop(300.0)
    trick.echo_jobs_on()

    read = 2.4
    trick.add_read(read , "trick.echo_jobs_off()")

    read = 2.6
    trick.add_read(read , "trick.debug_pause_on()")
예제 #4
0
def main():
    simControlPanel = trick.SimControlPanel()
    simControlPanel.thisown = 0
    #trick.add_external_application(simControlPanel)

    #ball.my_integ = trick.getIntegrator( trick.Runge_Kutta_2, 4, 1.0);
    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4)

    trick_message.mpublisher.sim_name = "ball_sim"
    trick.stop(300.0)
    trick.echo_jobs_on()

    read = 2.4
    trick.add_read(read, "trick.echo_jobs_off()")

    read = 2.6
    trick.add_read(read, "trick.debug_pause_on()")
예제 #5
0
파일: input.py 프로젝트: carylogan/Trick
def main():

    # Data recording HDF5 test
    # drg0 = trick.DRAscii("Ball")
    # for param in [ 'position' , 'velocity' , 'acceleration' , 'external_force' ] :
    #    for index in range(0,2) :
    #        var = "ball.obj.state.output." + param + "[" + str(index) + "]"
    #        drg0.add_variable(var)
    # drg0.set_cycle(0.01)
    # drg0.freq = trick.DR_Always
    # drg0.thisown = 0
    # trick.add_data_record_group(drg0, trick.DR_Buffer)

    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4)

    # print trick.ref_attributes("ball.obj.state.output.velocity").attr.units

    # message.mpublisher.sim_name = "ball_sim"

    trick.stop(300.0)

    # trick.exec_set_time(-10.0)
    trick.checkpoint_pre_init(True)
예제 #6
0
def main():

    # Data recording HDF5 test
    drg0 = trick.DRAscii("Ball")
    for param in [ 'position' , 'velocity' , 'acceleration' , 'external_force' ] :
        for index in range(0,2) :
            var = "ball.obj.state.output." + param + "[" + str(index) + "]"
            drg0.add_variable(var)
    drg0.set_cycle(0.01)
    drg0.freq = trick.DR_Always
    drg0.thisown = 0
    trick.add_data_record_group(drg0, trick.DR_Buffer)

    my_integ_loop.getIntegrator( trick.Runge_Kutta_2, 4 );

    #print trick.ref_attributes("ball.obj.state.output.velocity").attr.units

    #message.mpublisher.sim_name = "ball_sim"

    trick.stop(300.0)

    #trick.exec_set_time(-10.0)
    trick.checkpoint_pre_init(True)