rflex_configs.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef RFLEX_CONFIGS_H
00017 #define RFLEX_CONFIGS_H
00018
00019 #include <math.h>
00020 #include <libplayercore/player.h>
00021
00022
00023 inline double normalize_theta(double theta){
00024 while(theta>M_PI)
00025 theta-=2*M_PI;
00026 while(theta<-M_PI)
00027 theta+=2*M_PI;
00028 return theta;
00029 }
00030
00031
00032 typedef struct rflex_config_t{
00033 char serial_port[256];
00034
00035 double m_length;
00036
00037 double m_width;
00038
00039 double odo_distance_conversion;
00040
00041 double odo_angle_conversion;
00042
00043 double range_distance_conversion;
00044
00045 double mPsec2_trans_acceleration;
00046
00047 double radPsec2_rot_acceleration;
00048
00049
00050 int heading_home_address;
00051
00052 bool home_on_start;
00053
00054
00055 bool use_joystick;
00056 double joy_pos_ratio, joy_ang_ratio;
00057
00058
00059
00060 int max_num_sonars;
00061
00062 int num_sonars;
00063
00064 int sonar_age;
00065
00066 int num_sonar_banks;
00067
00068 int num_sonars_possible_per_bank;
00069
00070 int *num_sonars_in_bank;
00071
00072
00073 player_pose_t *mrad_sonar_poses;
00074
00075 long sonar_echo_delay;
00076 long sonar_ping_delay;
00077 long sonar_set_delay;
00078
00079 long sonar_2nd_bank_start;
00080 long sonar_1st_bank_end;
00081 long sonar_max_range;
00082
00083
00084
00085 unsigned short bumper_count;
00086 int bumper_address;
00088 int bumper_style;
00089 player_bumper_define_t * bumper_def;
00090
00091
00092 float power_offset;
00093
00094
00095 player_ir_pose_t ir_poses;
00096 int ir_base_bank;
00097 int ir_bank_count;
00098 int * ir_count;
00099 double * ir_a;
00100 double * ir_b;
00101 float ir_min_range;
00102 float ir_max_range;
00103 } rflex_config_t;
00104
00105
00106
00107 extern rflex_config_t rflex_configs;
00108
00109
00110
00111
00112
00113 #define ARB2RAD_ODO_CONV(x) ((x)/rflex_configs.odo_angle_conversion)
00114 #define RAD2ARB_ODO_CONV(x) ((x)*rflex_configs.odo_angle_conversion)
00115 #define ARB2M_ODO_CONV(x) ((x)/rflex_configs.odo_distance_conversion)
00116 #define M2ARB_ODO_CONV(x) ((x)*rflex_configs.odo_distance_conversion)
00117
00118 #define ARB2M_RANGE_CONV(x) (x/rflex_configs.range_distance_conversion)
00119 #define M2ARB_RANGE_CONV(x) (x*rflex_configs.range_distance_conversion)
00120
00121 #endif
00122
00123
00124
00125
00126
00127
00128
00129
00130
Last updated 12 September 2005 21:38:45
|