[Playerstage-developers] Yawspeed in sip.cc

 [Playerstage-developers] Yawspeed in sip.cc From: Vikram Harinath - 2003-11-09 09:07:10 ```Hi, I know I have spoken about this before but I can't seem to figure it out. I was looking at how the speed & yawspeed are calculated in player (under p2os) and saw this: data->position.xspeed = htonl((int32_t) (((lvel) + (rvel) ) / 2)); data->position.yawspeed = htonl((int32_t) (180*((double)(rvel - lvel) / (2.0/PlayerRobotParams[param_idx].DiffConvFactor)) / M_PI)); I was wondering what the values of "PlayerRobotParams[param_idx].DiffConvFactor" and "M_PI" were. This is for the pioneer robot. This is because, as I can get the average speed and the yawspeed, then I can calcuate the value of the speed of each wheel. Vik ```

 [Playerstage-developers] Yawspeed in sip.cc From: Vikram Harinath - 2003-11-09 09:07:10 ```Hi, I know I have spoken about this before but I can't seem to figure it out. I was looking at how the speed & yawspeed are calculated in player (under p2os) and saw this: data->position.xspeed = htonl((int32_t) (((lvel) + (rvel) ) / 2)); data->position.yawspeed = htonl((int32_t) (180*((double)(rvel - lvel) / (2.0/PlayerRobotParams[param_idx].DiffConvFactor)) / M_PI)); I was wondering what the values of "PlayerRobotParams[param_idx].DiffConvFactor" and "M_PI" were. This is for the pioneer robot. This is because, as I can get the average speed and the yawspeed, then I can calcuate the value of the speed of each wheel. Vik ```
 Re: [Playerstage-developers] Yawspeed in sip.cc From: Vikram Harinath - 2003-11-09 15:27:49 ```Hi, Just another reason why I am interested in knowing is because, from what I have read, when speed = (((lvel) + (rvel))/2) then the equation for turnrate is: yawspeed = ((rvel - lvel)/2d) where 2d is the distance between the wheels. (multiply by 180/pi to convert to degrees/sec) I was wondering if (2.0/PlayerRobotParams[param_idx].DiffConvFactor) was the value of the distance between the two wheels of the pioneer robot. This is because I will be using the pioneer.inc model for my testing in stage and need to know what the distance between the two wheels is for the pioneer.inc model in stage. Thankyou. Vikram Vikram Harinath wrote: > Hi, > > I know I have spoken about this before but I can't seem to figure it > out. > > I was looking at how the speed & yawspeed are calculated in player > (under p2os) and saw this: > > data->position.xspeed = htonl((int32_t) (((lvel) + (rvel) ) / 2)); > data->position.yawspeed = htonl((int32_t) > (180*((double)(rvel - lvel) / > (2.0/PlayerRobotParams[param_idx].DiffConvFactor)) / > M_PI)); > > I was wondering what the values of > "PlayerRobotParams[param_idx].DiffConvFactor" and "M_PI" were. > > This is for the pioneer robot. > > This is because, as I can get the average speed and the yawspeed, then I > can calcuate the value of the speed of each wheel. > > Vik > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > Playerstage-developers mailing list > Playerstage-developers@... > https://lists.sourceforge.net/lists/listinfo/playerstage-developers ```
 Re: [Playerstage-developers] Yawspeed in sip.cc From: brian gerkey - 2003-11-09 17:13:09 ```hi Vik, M_PI is the mathematical constant pi. PlayerRobotParams is a table of constants for ActivMedia robots. When connecting to the robot, it gives its type (e.g., "Pioneer p2dx"), and we do a lookup in that table to determine which constants to use. Apparently, DiffConvFactor is 1/r, where r is 1/2 of the axle length (i.e., the distance between the wheels) in mm. For the p2dx: DiffConvFactor = 0.005600 2 * (1/DiffConvFactor) = 357.14285714285717 Which gives the p2dx axle as about 35cm long, which seems right. Regarding Stage, the position model is not detailed enough to specify the axle length independently of the robot size. So the 'size' value effectively determines the axle length. Looking at the 'pioneer.inc' file, the 'pioneer2dx' is specified as follows: define pioneer2dx position ( size [.440 .330] offset [-0.04 0.0] p2dx_sonar() power() ) So this robot is 44cm long (front to back) and 33cm wide (wheel to wheel), with its center of rotation 4cm behind the center of the robot (all ActivMedia robots have offset centers of rotation; I've never understood why they build them like that). You can of course change the size of your simulated robot to be whatever you like (e.g., make it match the physical robot that you have in mind). brian. ```