[Playerstage-users] scale conversion From: Minh Tran - 2003-02-01 09:22 ```Hi Hiw do I go about converting values I read from the Laser proxy to pixel = units=20 on the PNM file and vice versa. I have a feeling it's got something to do= =20 with the scale I am seeing in the world file. This is what I've got in my world file unit_length "m" unit_angle "degrees" environment ( file "minh.pnm" #scale 0.02 scale 0.2 ) position ( port 6665 pose [10.0 10.0 0.0] player() laser() ) According to the docs, scale is how many units per pixel. So I'm guessing= it's=20 0.2 metres per pixel. Now some sample readings from the laser proxy is gi= ving=20 me huge values like 8000. I would like to know what this number means and= how=20 to convert it to pixel units and physical units. Also when the robot position is specified as 10, 10. What units is this i= n?? Thanks in advance Minh ```
 Re: [Playerstage-users] scale conversion From: brian gerkey - 2003-02-01 19:50 ```On Sat, 1 Feb 2003, Minh Tran wrote: > > According to the docs, scale is how many units per pixel. So I'm guessing it's > 0.2 metres per pixel. Now some sample readings from the laser proxy is giving > me huge values like 8000. I would like to know what this number means and how > to convert it to pixel units and physical units. Hi Minh, As stated in the C++ Client Library Reference Manual (page 16), the LaserProxy reports laser range values in millimeters and angular resolution in hundredths of a degree (0.01 degree). Note that other client libraries may transform such values into different units (e.g., I suspect that libplayerc converts to meters and radians). To convert from laser range and angle values to world pixel values, you just need to do a standard polar->rectangular coordinate transformation, then scale the result according to your simulation scale. By the way, you'll see lots of ranges of 8000, because the maximum range of the simulated laser is 8 meters (that's the max range for the physical SICK LMS 200 laser rangefinder). > > Also when the robot position is specified as 10, 10. What units is this in?? > The values given for 'unit_length' and 'unit_angle' are sticky, in that they persist throughout parsing of the configuration file. So, if you specify 'unit_length' as 'm' and 'unit_angle' as 'degrees' (which are the defaults, by the way), then give a robot (or any other) pose as [10.0 10.0 0.0], your robot will be 10 meters up and 10 meters right of the origin, facing to the right (we're using a standard right-handed coordinate system). Note that changing the values for 'unit_length' or 'unit_angle' ONLY affect how your configuration file is parsed. In particular, they have NO effect on how data is passed between server and client or how data is reported by a client library. brian. ```