Hello,
My name is Jonathan Handy and I am working on the e-puck project for a
summer research program. I am a computer science major that is very
new to
robotics and had some questions about some e-puck source code. I need help
understanding what these certain functions and values do because no
one is really here to give us the help and understanding we need. I
hope that I am not bothering anyone with my
questions but I am just trying to learn how to program for the e-puck
and its difficult for me since i have no robotics or webots
experience. Any help is greatly appreciated and I
thank everyone in advance. Here are some of the questions I had about
the intermediate_oam.c program
can you tell me what these global defines do and why are their values these
certain numbers?
#define LEFT 0 // Left side
#define RIGHT 1 // right side
#define NO_SIDE 2
#define OAM_K_90 0.08
#define OAM_K_45 0.12
#define OAM_K_10 0.12
why are these values 35?
int ps_offset_sim[NB_DIST_SENS] = {35,35,35,35,35,35,35,35};
can yo explain to me this function possibly by just adding a comment
to each line as to what it does or just break down the if and the else
statements?
void oam(void){
double oam_delta = 0;
oam_speed[LEFT]=oam_speed[RIGHT]=0;
if (obstacle[PS_LEFT_10] || obstacle[PS_LEFT_45] || obstacle[PS_LEFT_90]){
oam_delta -= (int) (OAM_K_90 * ps_value[PS_LEFT_90]);
oam_delta -= (int) (OAM_K_45 * ps_value[PS_LEFT_45]);
oam_delta -= (int) (OAM_K_10 * ps_value[PS_LEFT_10]);
if (oam_delta<-WFM_MAX_SPEED) side=LEFT;
} else if (obstacle[PS_RIGHT_10] || obstacle[PS_RIGHT_45] ||
obstacle[PS_RIGHT_90]){
oam_delta += (int) (OAM_K_90 * ps_value[PS_RIGHT_90]);
oam_delta += (int) (OAM_K_45 * ps_value[PS_RIGHT_45]);
oam_delta += (int) (OAM_K_10 * ps_value[PS_RIGHT_10]);
if (oam_delta>WFM_MAX_SPEED) side=RIGHT;
}
if (oam_delta > OAM_K_MAX_DELTAS) oam_delta = OAM_K_MAX_DELTAS;
if (oam_delta < -OAM_K_MAX_DELTAS) oam_delta = -OAM_K_MAX_DELTAS;
oam_speed[LEFT] -= oam_delta;
oam_speed[RIGHT] += oam_delta;
}
how does this perform wall following?
int wfm_speed[]={0,0};
void wfm(void){
switch(side) {
case LEFT:
wfm_speed[LEFT]=-WFM_MAX_SPEED;
wfm_speed[RIGHT]=WFM_MAX_SPEED;
break;
case RIGHT:
wfm_speed[LEFT]=WFM_MAX_SPEED;
wfm_speed[RIGHT]=-WFM_MAX_SPEED;
break;
default:
wfm_speed[LEFT]=0;
wfm_speed[RIGHT]=0;
}
}
can you explain the psoff set values?
can you explain this function?
for(i=0;i<NB_DIST_SENS;i++){
ps_value[i] = (int)wb_distance_sensor_get_value(ps[i]);
obstacle[i] = ps_value[i]-ps_offset[i]>THRESHOLD_DIST;
}
and
if (ps_value[PS_RIGHT_90]-ps_offset[PS_RIGHT_90]<0 &&
ps_value[PS_LEFT_90]-ps_offset[PS_LEFT_90]<0){
side=NO_SIDE;
}
--
Jonathan Handy 32°
[email protected]
--
Jonathan Handy 32°
[email protected]
_______________________________________________
E-puck-user mailing list
[email protected]
https://mail.gna.org/listinfo/e-puck-user