Ejemplo n.º 1
0
def main():

    # Data recording HDF5 test
    drg0 = trick.DRAscii("Ball")
    for param in ['position']:
        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)

    trick.sim_control_panel_set_enabled(True)

    trick.real_time_enable()
    trick.itimer_enable()

    #trick.TMM_hexfloat_checkpoint(True)
    #trick.exec_set_rt_nap(False)

    #trick_real_time.gtod_clock.set_clock_ID(trick.TRICK_CLOCK_MONOTONIC)
    #trick.real_time_change_clock(trick_tpro.tpro_cte)
    #trick.real_time_change_clock(trick_bc635.bc635)
    trick.message_publish(
        trick.MSG_INFO,
        "Current clock is = " + trick.real_time_clock_get_name() + "\n")
    trick_real_time.rt_sync.align_sim_to_wall_clock = True
    #real_time.rt_sync.align_tic_mult = 60.0

    #trick.echo_jobs_on() ;
    #trick.debug_pause_on() ;

    if hasattr(top.cvar, 'trick_jsonvs'):
        trick_jsonvs.vs.set_port(50000)
        trick.message_publish(
            trick.MSG_INFO,
            "JSON listen port = " + str(trick_jsonvs.vs.get_port()) + "\n")

    # set the software frame and freeze_frame
    trick.exec_set_software_frame(0.1)
    trick.exec_set_freeze_frame(0.1)
    #trick.exec_set_freeze_command(True)

    #trick.exec_set_enable_freeze(True)
    #trick.exec_set_stack_trace(False)
    #trick.freeze()
    #trick.freeze(5.0)

    #trick.add_read(1.0,"""trick.checkpoint("chkpnt_1.0")""")

    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4)

    trick.exec_set_terminate_time(3000.0)

    # Turn on frame logging
    #real_time.frame_log.tl_max_samples = 10000;
    trick.frame_log_on()
Ejemplo n.º 2
0
def main():
    trick.exec_set_time_tic_value(3000000)
    trick.real_time_enable()
    trick.itimer_enable()
    trick.exec_set_software_frame(0.05)
    trick.exec_set_freeze_frame(0.05)
    trick.sim_control_panel_set_enabled(True)
    trick.exec_set_terminate_time(50000.0)
    trick.frame_log_on()
Ejemplo n.º 3
0
def main():

    # Data recording HDF5 test
    drg0 = trick.DRAscii("Ball")
    for param in [ 'position' ] :
        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)

    trick.sim_control_panel_set_enabled(True)

    trick.real_time_enable()
    trick.itimer_enable()

    #trick.TMM_hexfloat_checkpoint(True)
    #trick.exec_set_rt_nap(False)

    #trick_real_time.gtod_clock.set_clock_ID(trick.TRICK_CLOCK_MONOTONIC)
    #trick.real_time_change_clock(trick_tpro.tpro_cte)
    #trick.real_time_change_clock(trick_bc635.bc635)
    trick.message_publish(trick.MSG_INFO, "Current clock is = " + trick.real_time_clock_get_name() + "\n")
    trick_real_time.rt_sync.align_sim_to_wall_clock = True
    #real_time.rt_sync.align_tic_mult = 60.0

    #trick.echo_jobs_on() ;
    #trick.debug_pause_on() ;

    if hasattr(top.cvar, 'trick_jsonvs'):
        trick_jsonvs.vs.set_port(50000)
        trick.message_publish(trick.MSG_INFO, "JSON listen port = " + str(trick_jsonvs.vs.get_port()) + "\n")

    # set the software frame and freeze_frame
    trick.exec_set_software_frame(0.1)
    trick.exec_set_freeze_frame(0.1)
    #trick.exec_set_freeze_command(True)

    #trick.exec_set_enable_freeze(True)
    #trick.exec_set_stack_trace(False)
    #trick.freeze()
    #trick.freeze(5.0)

    #trick.add_read(1.0,"""trick.checkpoint("chkpnt_1.0")""")

    my_integ_loop.getIntegrator(trick.Runge_Kutta_2, 4)

    trick.exec_set_terminate_time(3000.0)

    # Turn on frame logging
    #real_time.frame_log.tl_max_samples = 10000;
    trick.frame_log_on()
Ejemplo n.º 4
0
def main():
    trick.sim_control_panel_set_enabled(True)
    trick.real_time_enable()
    trick.itimer_enable()

    trick.exec_set_software_frame(0.05)
    trick.exec_set_freeze_frame(0.05)
    trick.exec_set_freeze_command(True)

    trick.frame_log_set_max_samples(100)
    trick.frame_log_on()

    trick.exec_set_thread_process_type(1, trick.PROCESS_TYPE_ASYNC_CHILD)
    trick.exec_set_thread_amf_cycle_time(1, 0.1)
Ejemplo n.º 5
0
def main():
    trick.sim_control_panel_set_enabled(True)
    trick.real_time_enable()
    trick.itimer_enable()

    trick.exec_set_software_frame(0.05)
    trick.exec_set_freeze_frame(0.05)
    trick.exec_set_freeze_command(True)

    trick.frame_log_set_max_samples(100)
    trick.frame_log_on()

    trick.exec_set_thread_process_type(1, trick.PROCESS_TYPE_ASYNC_CHILD)
    trick.exec_set_thread_amf_cycle_time(1, 0.1)
Ejemplo n.º 6
0
def main():
    trick.exec_set_time_tic_value(3000000)
    trick.real_time_enable()
    trick.itimer_enable()
    trick.exec_set_software_frame(0.05)
    trick.exec_set_freeze_frame(0.05)
    trick.sim_control_panel_set_enabled(True)
    trick.exec_set_terminate_time(50000.0)
    trick.frame_log_on()

    trick.exec_set_thread_process_type( 1 , trick.PROCESS_TYPE_ASYNC_CHILD )
    trick.exec_set_thread_async_cycle_time( 1 , 0.016666666666666666 )
    trick.exec_set_thread_cpu_affinity(0 , 0) ;
    trick.exec_set_thread_cpu_affinity(1 , 2) ;

    comp_vision.tcv.cam_res = trick.RES_640x480
Ejemplo n.º 7
0
def main():
    buggy_so.buggy.chassis_length = 1.2
    buggy_so.buggy.chassis_width = 1.0

    buggy_so.buggy.wheel_width = 0.2

    trick.sim_control_panel_set_enabled(True)
    trick.real_time_enable()
    trick.itimer_enable()

    trick.exec_set_software_frame(0.05)
    trick.exec_set_freeze_frame(0.05)
    trick.exec_set_freeze_command(True)

    trick.frame_log_on()

    trick.exec_set_thread_process_type(1, trick.PROCESS_TYPE_ASYNC_CHILD)
    trick.exec_set_thread_amf_cycle_time(1, 0.1)
Ejemplo n.º 8
0
def main():

    trick.var_server_set_port(50000)
    #trick.var_server_set_source_address(None)
    #trick.var_server_set_source_address('')
    #trick.var_server_set_source_address('192.168.1.23')
    #trick.var_server_set_source_address('galvatron')
    #trick.var_server_set_source_address('localhost')
    #trick.var_server_set_source_address('jfdlkjfklsda')

    #trick.var_server_create_tcp_socket('192.168.1.23', 49000)
    #trick.var_server_create_udp_socket('', 48000)
    trick.var_server_create_multicast_socket('224.10.10.10','', 47000)

    trick.sim_control_panel_set_enabled(True)
    trick.real_time_enable()
    trick.itimer_enable()

    # set the software frame and freeze_frame
    trick.exec_set_software_frame(0.1)
    trick.exec_set_freeze_frame(0.1)
    trick.exec_set_terminate_time(3000.0)
Ejemplo n.º 9
0
def main():

    trick.var_server_set_port(50000)
    #trick.var_server_set_source_address(None)
    #trick.var_server_set_source_address('')
    #trick.var_server_set_source_address('192.168.1.23')
    #trick.var_server_set_source_address('galvatron')
    #trick.var_server_set_source_address('localhost')
    #trick.var_server_set_source_address('jfdlkjfklsda')

    #trick.var_server_create_tcp_socket('192.168.1.23', 49000)
    #trick.var_server_create_udp_socket('', 48000)
    trick.var_server_create_multicast_socket('224.10.10.10','', 47000)

    trick.sim_control_panel_set_enabled(True)
    trick.real_time_enable()
    trick.itimer_enable()

    # set the software frame and freeze_frame
    trick.exec_set_software_frame(0.1)
    trick.exec_set_freeze_frame(0.1)
    trick.exec_set_terminate_time(3000.0)