## Re: [PlayerStage-Gazebo] Problem with angle meassurement

 Re: [PlayerStage-Gazebo] Problem with angle meassurement From: Nathan Michael - 2007-11-19 17:59:20 ```Hello, > 1. For X and Y position I have to add 6 to the proxy-X and 4 to the > proxy-Y - 6 and 4 are the starting coordinates of the robot - Why does > it not know the correct position? I guess it simulates a odomotry > model > and at the beginning it has not "driven" at all - so it meassures the > movement - not the position (e.g. the relative position to the > starting > point) - is this correct? Yes. > 2. Truth Widget seems somehow instable - at the beinning, the robot > procy sees no movement at all - which makes sense as I am just > standing > at the start point - and the truth widget suddenly starts turning. > This > happens also in other moments - it's values just change a little all > the > time. Why? The truth widget is based on the model position in the world. The model position is based on ODE. ODE provides unstable motions over a long period of time for static motion. To test this, create a world with a box, start the simulation, come back twenty minutes later and check to see where the box is positioned. > 3. I read that the angles are meassured in degrees are referencing a > euler "space". But I can not image that these values are degrees. The > truth widgets values (3rd column) are way to small and the the proxy > values (6th column) are bigger but still to small. For the Proxy- > Data I > think it is between -pi and pi. But I am not sure. > How are the angles meassured for truth widget and PositionProxy2D? Quaternions and Euler angles, respectively. Note that the TruthWidget is providing a 4x1 array for rotation. Generally the conversion is done by the underlying code in Gazebo, but if you are interacting directly with the TruthWidget, you will need to do the conversion (which is a utility function in the library or discussed here: http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles) Nate ```

 [PlayerStage-Gazebo] Problem with angle meassurement From: Tom Kazimiers <2voodoo@gm...> - 2007-11-19 17:42:59 ```Hello, currently I am writing on program which uses Gazebo. For this application I need to getthe error in position and turn changes. For this I use a Truth Widget in my Pioneer: robot1 6.0 4.0 0.0 truth1 laser1 0.0 0.0 0.30 camera1 0 0 0.20 0 0 0 1 Further I use Player and the PositionProxy2D to get a "disturbed" signal source. The true position I get via: gz_client_t *client = gz_client_alloc(); gz_truth_t *true_pose; gz_error_init(1, 9); gz_client_connect_wait(client, 0, 0) true_pose = gz_truth_alloc(); gz_truth_open(true_pose, client, "truth1") gz_client_wait(client); gz_truth_lock(true_pose, 1); gz_truth_unlock(true_pose); My aim is it to compare the x,y and yaw position of the sources. I ran a few Tests and drove a bit around with the robot to get some position information. This information I wrote into a file with the following format: trueX trueY trueRotYaw proxyX proxyY ProxyRotYaw Code: fprintf(logFile, "%f %f %f || %f %f %f\n", // || %f %f %f\n", true_pose->data->pos[0], true_pose->data->pos[1], true_pose->data->rot[2], 6 + odoPosition.getX(), 4 + odoPosition.getY(), odoPosition.getOrientation()); Here are some lines of it: 6.000046 4.000000 -0.000638 || 6.000056 4.000000 -0.000000 6.000046 4.000000 -0.000638 || 6.000056 4.000000 -0.000000 6.000046 4.000000 -0.000638 || 6.000056 4.000000 -0.000000 6.000046 4.000000 -0.000638 || 6.000056 4.000000 -0.000000 6.000046 4.000000 -0.000638 || 6.000056 4.000000 -0.000000 6.000601 4.000000 -0.001147 || 6.000056 4.000000 -0.000000 6.001439 4.000000 -0.001363 || 6.001456 4.000000 -0.000000 6.029394 4.000000 -0.011561 || 6.023456 4.000000 -0.000000 6.075261 4.000000 -0.007479 || 6.053856 4.000000 -0.000000 6.107547 4.000000 -0.006650 || 6.053856 4.000000 -0.000000 6.143922 4.000000 -0.004845 || 6.107655 4.000000 0.000000 6.198478 4.000000 -0.004686 || 6.168255 4.000000 0.000000 6.276509 4.000000 -0.005272 || 6.244055 4.000000 0.000000 ... ... 9.055434 4.019617 -0.000619 || 9.029948 4.016208 0.105077 9.207117 4.035112 0.000044 || 9.156819 4.034275 0.196018 9.330768 4.057180 -0.000182 || 9.281331 4.064546 0.302197 9.450539 4.091749 -0.000899 || 9.401550 4.108825 0.428952 9.564016 4.141216 -0.000272 || 9.514443 4.169298 0.586018 9.628628 4.178575 -0.000308 || 9.514443 4.169298 0.586018 9.690449 4.221245 -0.000582 || 9.616489 4.246689 0.743094 9.749380 4.268831 -0.000690 || 9.705174 4.339092 0.900174 9.893024 4.415460 -0.000422 || 9.778312 4.444230 1.057253 9.942682 4.476048 -0.000445 || 9.834101 4.559514 1.214331 ... I encountered sveral problems which I can not solve: 1. For X and Y position I have to add 6 to the proxy-X and 4 to the proxy-Y - 6 and 4 are the starting coordinates of the robot - Why does it not know the correct position? I guess it simulates a odomotry model and at the beginning it has not "driven" at all - so it meassures the movement - not the position (e.g. the relative position to the starting point) - is this correct? 2. Truth Widget seems somehow instable - at the beinning, the robot procy sees no movement at all - which makes sense as I am just standing at the start point - and the truth widget suddenly starts turning. This happens also in other moments - it's values just change a little all the time. Why? 3. I read that the angles are meassured in degrees are referencing a euler "space". But I can not image that these values are degrees. The truth widgets values (3rd column) are way to small and the the proxy values (6th column) are bigger but still to small. For the Proxy-Data I think it is between -pi and pi. But I am not sure. How are the angles meassured for truth widget and PositionProxy2D? I know these are pretty much questions - but I did not find a solution. Thanks in advance Tom ```
 Re: [PlayerStage-Gazebo] Problem with angle meassurement From: Nathan Michael - 2007-11-19 17:59:20 ```Hello, > 1. For X and Y position I have to add 6 to the proxy-X and 4 to the > proxy-Y - 6 and 4 are the starting coordinates of the robot - Why does > it not know the correct position? I guess it simulates a odomotry > model > and at the beginning it has not "driven" at all - so it meassures the > movement - not the position (e.g. the relative position to the > starting > point) - is this correct? Yes. > 2. Truth Widget seems somehow instable - at the beinning, the robot > procy sees no movement at all - which makes sense as I am just > standing > at the start point - and the truth widget suddenly starts turning. > This > happens also in other moments - it's values just change a little all > the > time. Why? The truth widget is based on the model position in the world. The model position is based on ODE. ODE provides unstable motions over a long period of time for static motion. To test this, create a world with a box, start the simulation, come back twenty minutes later and check to see where the box is positioned. > 3. I read that the angles are meassured in degrees are referencing a > euler "space". But I can not image that these values are degrees. The > truth widgets values (3rd column) are way to small and the the proxy > values (6th column) are bigger but still to small. For the Proxy- > Data I > think it is between -pi and pi. But I am not sure. > How are the angles meassured for truth widget and PositionProxy2D? Quaternions and Euler angles, respectively. Note that the TruthWidget is providing a 4x1 array for rotation. Generally the conversion is done by the underlying code in Gazebo, but if you are interacting directly with the TruthWidget, you will need to do the conversion (which is a utility function in the library or discussed here: http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles) Nate ```
 Re: [PlayerStage-Gazebo] Problem with angle meassurement From: Sawyer - 2007-11-19 18:06:11 ```Tom, > I encountered sveral problems which I can not solve: > 1. For X and Y position I have to add 6 to the proxy-X and 4 to the > proxy-Y - 6 and 4 are the starting coordinates of the robot - Why does > it not know the correct position? I guess it simulates a odomotry model > and at the beginning it has not "driven" at all - so it meassures the > movement - not the position (e.g. the relative position to the starting > point) - is this correct? This is correct if you are not using the TruthWidget it is a robot centric frame of reference (the robot does not know the global coordinates). > 2. Truth Widget seems somehow instable - at the beinning, the robot > procy sees no movement at all - which makes sense as I am just standing > at the start point - and the truth widget suddenly starts turning. This > happens also in other moments - it's values just change a little all the > time. Why? Assuming that these values are very small they are probably the result of the physics simulation and joints interacting to cause small variations in the actual pose of the robot (The values in the attached log file seem to fall within this range). > 3. I read that the angles are meassured in degrees are referencing a > euler "space". But I can not image that these values are degrees. The > truth widgets values (3rd column) are way to small and the the proxy > values (6th column) are bigger but still to small. For the Proxy-Data I > think it is between -pi and pi. But I am not sure. > How are the angles meassured for truth widget and PositionProxy2D? > All angles in ODE and Gazebo should be in radians, the control panels (ex: position) have converted these to a degree readout for readability. Also Player2.x expects all angles to be in radians (this is a change from the 1.x line and some of the documentation may not have been updated), so when using the Position2DProxy you should be using radians (note Player itself will let you send any number so you can use degrees but it will break/confuse the prebuilt tools like playerv). Sawyer ```