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" ) ;
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()
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()
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()
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)
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)
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
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)
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)