⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverparam.c

📁 在LINUX下运行的仿真机器人服务器源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
    timer_loaded = false;  synch_offset = 60;  synch_micro_sleep = 1;  start_goal_l = 0;  start_goal_r = 0;  fullstate_l = FALSE;  fullstate_r = FALSE;#ifdef NEW_QSTEP  bool defined_qstep_l = false;  bool defined_qstep_r = false;  bool defined_qstep_l_l = false;  bool defined_qstep_l_r = false;  bool defined_qstep_dir_l = false;  bool defined_qstep_dir_r = false;#endif  slowness_on_top_for_left_team = 1.0;  slowness_on_top_for_right_team = 1.0;  landmark_file = ServerParam::LANDMARK_FILE;  send_comms = ServerParam::SEND_COMMS;  text_logging = ServerParam::TEXT_LOGGING;  game_logging = ServerParam::GAME_LOGGING;  game_log_version = ServerParam::GAME_LOG_VERSION;  text_log_dir = ServerParam::TEXT_LOG_DIR;  game_log_dir = ServerParam::GAME_LOG_DIR;  text_log_fixed_name = ServerParam::TEXT_LOG_FIXED_NAME;  game_log_fixed_name = ServerParam::GAME_LOG_FIXED_NAME;  text_log_fixed = ServerParam::TEXT_LOG_FIXED;  game_log_fixed = ServerParam::GAME_LOG_FIXED;  text_log_dated = ServerParam::TEXT_LOG_DATED;  game_log_dated = ServerParam::GAME_LOG_DATED;  log_date_format = ServerParam::LOG_DATE_FORMAT;  log_times = ServerParam::LOG_TIMES;  record_messages = ServerParam::RECORD_MESSAGES;  text_log_compression = ServerParam::TEXT_LOG_COMPRESSION;  game_log_compression = ServerParam::GAME_LOG_COMPRESSION;  M_profile = ServerParam::PROFILE;  kaway_logging = ServerParam::KAWAY_LOGGING;  kaway_log_dir = ServerParam::KAWAY_LOG_DIR;  kaway_log_fixed_name = ServerParam::KAWAY_LOG_FIXED_NAME;  kaway_log_fixed = ServerParam::KAWAY_LOG_FIXED;  kaway_log_dated = ServerParam::KAWAY_LOG_DATED;  kaway_start = ServerParam::KAWAY_START;    M_point_to_ban = ServerParam::POINT_TO_BAN;  M_point_to_duration = ServerParam::POINT_TO_DURATION;  M_say_msg_size = ServerParam::SAY_MSG_SIZE ;  M_hear_max = ServerParam::HEAR_MAX ;  M_hear_inc = ServerParam::HEAR_INC ;  M_hear_decay = ServerParam::HEAR_DECAY ;  M_tackle_dist = TACKLE_DIST;  M_tackle_back_dist = TACKLE_BACK_DIST;  M_tackle_width = TACKLE_WIDTH;  M_tackle_exponent = TACKLE_EXPONENT;  M_tackle_cycles = TACKLE_CYCLES;  M_tackle_power_rate = TACKLE_POWER_RATE;  M_freeform_wait_period = FREEFORM_WAIT_PERIOD;  M_freeform_send_period = FREEFORM_SEND_PERIOD;  M_free_kick_faults = FREE_KICK_FAULTS;  M_back_passes = BACK_PASSES;  M_proper_goal_kicks = PROPER_GOAL_KICKS;  M_stopped_ball_vel = STOPPED_BALL_VEL;  M_max_goal_kicks = MAX_GOAL_KICKS;  M_auto_mode = S_AUTO_MODE;  M_kick_off_wait = S_KICK_OFF_WAIT;  M_connect_wait = S_CONNECT_WAIT;  M_game_over_wait = S_GAME_OVER_WAIT;  M_team_l_start = S_TEAM_L_START;  M_team_r_start = S_TEAM_R_START;  setHalfTime( HALF_TIME );  rcss::lib::Loader::setPath( S_MODULE_DIR );}server_params_t ServerParam::convertToStruct (){  server_params_t tmp;  tmp.gwidth = htonl( (long)(SHOWINFO_SCALE2 * gwidth) );  tmp.inertia_moment = htonl( (long)(SHOWINFO_SCALE2 * inertia_moment) );  tmp.psize = htonl( (long)(SHOWINFO_SCALE2 * psize) );  tmp.pdecay = htonl( (long)(SHOWINFO_SCALE2 * pdecay) );  tmp.prand = htonl( (long)(SHOWINFO_SCALE2 * prand) );  tmp.pweight = htonl( (long)(SHOWINFO_SCALE2 * pweight) );  tmp.pspeed_max = htonl( (long)(SHOWINFO_SCALE2 * pspeed_max) );  tmp.paccel_max = htonl( (long)(SHOWINFO_SCALE2 * paccel_max) );  tmp.stamina_max = htonl( (long)(SHOWINFO_SCALE2 * stamina_max) );  tmp.stamina_inc = htonl( (long)(SHOWINFO_SCALE2 * stamina_inc) );  tmp.recover_init = htonl( (long)(SHOWINFO_SCALE2 * recover_init) );  tmp.recover_dthr = htonl( (long)(SHOWINFO_SCALE2 * recover_dthr) );  tmp.recover_min = htonl( (long)(SHOWINFO_SCALE2 * recover_min) );  tmp.recover_dec = htonl( (long)(SHOWINFO_SCALE2 * recover_dec) );  tmp.effort_init = htonl( (long)(SHOWINFO_SCALE2 * effort_init) );  tmp.effort_dthr = htonl( (long)(SHOWINFO_SCALE2 * effort_dthr) );  tmp.effort_min = htonl( (long)(SHOWINFO_SCALE2 * effort_min) );  tmp.effort_dec = htonl( (long)(SHOWINFO_SCALE2 * effort_dec) );  tmp.effort_ithr = htonl( (long)(SHOWINFO_SCALE2 * effort_ithr) );  tmp.effort_inc = htonl( (long)(SHOWINFO_SCALE2 * effort_inc) );  tmp.kick_rand = htonl( (long)(SHOWINFO_SCALE2 * kick_rand) );                                  tmp.team_actuator_noise = htons( (short) team_actuator_noise );                          tmp.prand_factor_l = htonl( (long)(SHOWINFO_SCALE2 * prand_factor_l ) );                             tmp.prand_factor_r = htonl( (long)(SHOWINFO_SCALE2 * prand_factor_r ) );                             tmp.kick_rand_factor_l = htonl( (long)(SHOWINFO_SCALE2 * kick_rand_factor_l ) );  tmp.kick_rand_factor_r = htonl( (long)(SHOWINFO_SCALE2 * kick_rand_factor_r ) );                         tmp.bsize = htonl( (long)(SHOWINFO_SCALE2 * bsize) );  tmp.bdecay = htonl( (long)(SHOWINFO_SCALE2 * bdecay) );  tmp.brand = htonl( (long)(SHOWINFO_SCALE2 * brand) );  tmp.bweight = htonl( (long)(SHOWINFO_SCALE2 * bweight) );  tmp.bspeed_max = htonl( (long)(SHOWINFO_SCALE2 * bspeed_max) );  tmp.baccel_max = htonl( (long)(SHOWINFO_SCALE2 * baccel_max ) );  tmp.dprate = htonl( (long)(SHOWINFO_SCALE2 * dprate) );  tmp.kprate = htonl( (long)(SHOWINFO_SCALE2 * kprate) );  tmp.kmargin = htonl( (long)(SHOWINFO_SCALE2 * kmargin) );  tmp.ctlradius = htonl( (long)(SHOWINFO_SCALE2 * ctlradius) );  tmp.ctlradius_width = htonl( (long)(SHOWINFO_SCALE2 * ctlradius_width) );  tmp.maxp = htonl( (long)(SHOWINFO_SCALE2 * maxp) );  tmp.minp = htonl( (long)(SHOWINFO_SCALE2 * minp) );  tmp.maxm = htonl( (long)(SHOWINFO_SCALE2 * maxm) );  tmp.minm = htonl( (long)(SHOWINFO_SCALE2 * minm) );  tmp.maxnm = htonl( (long)(SHOWINFO_SCALE2 * maxnm) );  tmp.minnm = htonl( (long)(SHOWINFO_SCALE2 * minnm) );  tmp.maxn = htonl( (long)(SHOWINFO_SCALE2 * maxn) );  tmp.minn = htonl( (long)(SHOWINFO_SCALE2 * minn) );  tmp.visangle = htonl( (long)(SHOWINFO_SCALE2 * visangle) );  tmp.visdist = htonl( (long)(SHOWINFO_SCALE2 * visdist) );  tmp.windir = htonl( (long)(SHOWINFO_SCALE2 * windir) );  tmp.winforce = htonl( (long)(SHOWINFO_SCALE2 * winforce) );  tmp.winang = htonl( (long)(SHOWINFO_SCALE2 * winang) );  tmp.winrand = htonl( (long)(SHOWINFO_SCALE2 * winrand) );  tmp.kickable_area = htonl( (long)(SHOWINFO_SCALE2 * kickable_area) );  tmp.catch_area_l = htonl( (long)(SHOWINFO_SCALE2 * catch_area_l) );  tmp.catch_area_w = htonl( (long)(SHOWINFO_SCALE2 * catch_area_w) );  tmp.catch_prob = htonl( (long)(SHOWINFO_SCALE2 * catch_prob) );  tmp.goalie_max_moves = htons( (short) goalie_max_moves );                   tmp.ckmargin = htonl( (long)(SHOWINFO_SCALE2 * ckmargin) );  tmp.offside_area = htonl( (long)(SHOWINFO_SCALE2 * offside_area) );  tmp.win_no = htons( (short) win_no);  tmp.win_random = htons( (short) win_random) ;  tmp.say_cnt_max = htons( (short) say_cnt_max) ;  tmp.SayCoachMsgSize = htons( (short) SayCoachMsgSize) ;  tmp.clang_win_size = htons( (short) clang_win_size );  tmp.clang_define_win = htons( (short) clang_define_win );  tmp.clang_meta_win = htons( (short) clang_meta_win );  tmp.clang_advice_win = htons( (short) clang_advice_win );  tmp.clang_info_win = htons( (short) clang_info_win );  tmp.clang_mess_delay = htons( (short) clang_mess_delay );  tmp.clang_mess_per_cycle = htons( (short) clang_mess_per_cycle );  tmp.half_time = htons( (short) half_time) ;  tmp.sim_st = htons( (short) sim_st) ;  tmp.send_st = htons( (short) send_st) ;  tmp.recv_st = htons( (short) recv_st) ;  tmp.sb_step = htons( (short) sb_step) ;  tmp.lcm_st = htons( (short) lcm_st) ;                          tmp.M_say_msg_size = htons( (short) M_say_msg_size) ;  tmp.M_hear_max = htons( (short) M_hear_max) ;  tmp.M_hear_inc = htons( (short) M_hear_inc) ;  tmp.M_hear_decay = htons( (short) M_hear_decay) ;  tmp.cban_cycle = htons( (short) cban_cycle) ;  tmp.slow_down_factor = htons( (short) slow_down_factor) ;                            tmp.useoffside = htons( (short) useoffside) ;  tmp.kickoffoffside = htons( (short) kickoffoffside) ;  tmp.offside_kick_margin = htonl( (long)(SHOWINFO_SCALE2 * offside_kick_margin) );  tmp.audio_dist = htonl( (long)(SHOWINFO_SCALE2 * audio_dist) );  tmp.dist_qstep = htonl( (long)(SHOWINFO_SCALE2 * dist_qstep) );  tmp.land_qstep = htonl( (long)(SHOWINFO_SCALE2 * land_qstep) );#ifdef NEW_QSTEP  tmp.dir_qstep = htonl( (long)(SHOWINFO_SCALE2 * dir_qstep) );  tmp.dist_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * dist_qstep_l) );  tmp.dist_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * dist_qstep_r) );  tmp.land_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * land_qstep_l) );  tmp.land_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * land_qstep_r) );  tmp.dir_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * dir_qstep_l) );  tmp.dir_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * dir_qstep_r) );#else  tmp.dir_qstep = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.dist_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.dist_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.land_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.land_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.dir_qstep_l = htonl( (long)(SHOWINFO_SCALE2 * -1) );  tmp.dir_qstep_r = htonl( (long)(SHOWINFO_SCALE2 * -1) );#endif      tmp.CoachMode = htons( (short) CoachMode) ;  tmp.CwRMode = htons( (short) CwRMode) ;  tmp.old_hear = htons( (short) old_hear) ;  tmp.sv_st = htons( (short) sv_st) ;  tmp.synch_mode   = htons( (short)synch_mode);//pfr:SYNCH  tmp.synch_offset = htons( (short)synch_offset);//pfr:SYNCH  tmp.synch_micro_sleep = htons( (short)synch_micro_sleep);//pfr:SYNCH  tmp.start_goal_l = htons( (short)start_goal_l );  tmp.start_goal_r = htons( (short)start_goal_r );  tmp.fullstate_l = htons( (short)fullstate_l );  tmp.fullstate_r = htons( (short)fullstate_r );  tmp.drop_time = htons( (short) drop_time) ;  tmp.slowness_on_top_for_left_team = htonl( (long)(SHOWINFO_SCALE2 * slowness_on_top_for_left_team) );  tmp.slowness_on_top_for_right_team = htonl( (long)(SHOWINFO_SCALE2 * slowness_on_top_for_left_team) );  tmp.ka_length = htonl( (long)(SHOWINFO_SCALE2 * ka_length) );  tmp.ka_width = htonl( (long)(SHOWINFO_SCALE2 * ka_width) );  tmp.point_to_ban =  htons( (short)M_point_to_ban );  tmp.point_to_duration =  htons( (short)M_point_to_duration );  return tmp;}boolServerParam::getInt( const std::string& param, int& value ) const{    return m_builder->get( param, value ); }boolServerParam::getBool( const std::string& param, bool& value ) const{ return m_builder->get( param, value ); }boolServerParam::getDoub( const std::string& param, double& value ) const{ return m_builder->get( param, value ); }boolServerParam::getStr( const std::string& param, std::string& value ) const{ return m_builder->get( param, value ); }std::ostream& toStr ( std::ostream& o, const ServerParamSensor_v7::data_t& data ){  return o << "(server_param "           << data.M_gwidth << " "           << data.M_inertia_moment << " "           << data.M_psize << " "           << data.M_pdecay << " "           << data.M_prand << " "           << data.M_pweight << " "           << data.M_pspeed_max << " "           << data.M_paccel_max << " "           << data.M_stamina_max << " "           << data.M_stamina_inc << " "           << data.M_recover_init << " "           << data.M_recover_dthr << " "           << data.M_recover_min << " "           << data.M_recover_dec << " "           << data.M_effort_init << " "           << data.M_effort_dthr << " "           << data.M_effort_min << " "           << data.M_effort_dec << " "           << data.M_effort_ithr << " "           << data.M_effort_inc << " "           << data.M_kick_rand << " "           << data.M_team_actuator_noise << " "           << data.M_prand_factor_l << " "           << data.M_prand_factor_r << " "           << data.M_kick_rand_factor_l << " "           << data.M_kick_rand_factor_r << " "           << data.M_bsize << " "           << data.M_bdecay << " "            << data.M_brand << " "            << data.M_bweight << " "            << data.M_bspeed_max << " "            << data.M_baccel_max << " "           << data.M_dprate << " "            << data.M_kprate << " "            << data.M_kmargin << " "            << data.M_ctlradius << " "            << data.M_ctlradius_width << " "            << data.M_maxp << " "           << data.M_minp << " "            << data.M_maxm << " "            << data.M_minm << " "            << data.M_maxnm << " "            << data.M_minnm << " "            << data.M_maxn << " "            << data.M_minn << " "            << data.M_visangle << " "            << data.M_visdist << " "            << data.M_windir << " "           << data.M_winforce << " "            << data.M_winang << " "            << data.M_winrand << " "            << data.M_kickable_area << " "            << data.M_catch_area_l << " "            << data.M_catch_area_w << " "            << data.M_catch_prob << " "            << data.M_goalie_max_moves << " "                             << data.M_ckmargin << " "            << data.M_offside_area << " "            << data.M_win_no << " "            << data.M_win_random << " "            << data.M_say_cnt_max << " "            << data.M_SayCoachMsgSize << " "            << data.M_clang_win_size << " "           << data.M_clang_define_win << " "           << data.M_clang_meta_win << " "           << data.M_clang_advice_win << " "           << data.M_clang_info_win << " "           << data.M_clang_mess_delay << " "           << data.M_clang_mess_per_cycle << " "           << data.M_half_time << " "            << data.M_sim_st << " "            << data.M_send_st << " "            << data.M_recv_st << " "            << data.M_sb_step << " "            << data.M_lcm_st << " "                                    << data.M_say_msg_size << " "            << data.M_hear_max << " "            << data.M_hear_inc << " "            << data.M_hear_decay << " "            << data.M_cban_cycle << " "            << data.M_slow_down_factor << " "                                      << data.M_useoffside << " "            << data.M_kickoffoffside << " "           << data.M_offside_kick_margin << " "            << data.M_audio_dist << " "            << data.M_dist_qstep << " "            << data.M_land_qstep << " "            << data.M_dir_qstep << " "            << data.M_dist_qstep_l << " "            << data.M_dist_qstep_r << " "            << data.M_land_qstep_l << " "            << data.M_land_qstep_r << " "            << data.M_dir_qstep_l << " "            << data.M_dir_qstep_r << " "           << data.M_CoachMode << " "            << data.M_CwRMode << " "            << data.M_old_hear << " "            << data.M_sv_st << " "           << data.M_start_goal_l << " "           << data.M_start_goal_r << " "           << data.M_fullstate_l << " "           << data.M_fullstate_r << " "           << data.M_drop_time << ")";}std::ostream& toStr ( std::ostream& o, const ServerParamSensor_v8::data_t& data ){      o << "(server_param ";  std::for_each( data.m_sp.verMap().begin(), data.m_sp.verMap().end(), ServerParam::Printer( o, 8 ) );  o << ")";  return o;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -