tutorials:virtual-laser-scanner
Differences
This shows you the differences between two versions of the page.
| tutorials:virtual-laser-scanner [2024/04/15 11:57] – created gaetan | tutorials:virtual-laser-scanner [2024/04/15 12:22] (current) – gaetan | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| p.6). | p.6). | ||
| - |  _ designates the segment which has the point _point_ | + | **Notations :** //Seg(Point3d point, Vector3d vector, Double l)// designates the segment which has the point // |
| - | of length | + | of length |
| - | _Cir(Point3d center, Vector3d normal, Double r)_ designates the circle of _center_ | + | //Cir(Point3d center, Vector3d normal, Double r)// designates the circle of //center// |
| - | center, of radius | + | center, of radius |
| - | **setRayLength** | + | **setRayLength** Sets the range of the rays. |
| - | <div align=" | + | |
| - | void setRayLength(double desiredLength) ; | + | |
| - | </ | + | |
| - | | + | |
| - | _desiredLenght_ must be strictly positive. | + | > **void setRayLength(double desiredLength) ;** |
| - | **setBasis** | + | // |
| - | <div align=" | + | |
| - | void setBasis(Vector3d x, Vector3d y, Vector3d y) ; | + | **setBasis** Sets the 3-dimensional basis to be used as reference for shooting the rays. |
| - | </ | + | |
| - | | + | > **void setBasis(Vector3d x, Vector3d y, Vector3d y) ;** |
| The 3 vectors must form a direct orthogonal basis. | The 3 vectors must form a direct orthogonal basis. | ||
| - | **setRange**   Sets the angular opening in _θ_ and _φ_. | + | **setRange**   Sets the angular opening in θ and φ. |
| - | <div align=" | + | |
| - | void setRange(double thetaRange, | + | > **void setRange(double thetaRange, |
| - | </ | + | |
| - | | + | |
| If $thetaRange \ge 2 · \pi$ (resp. $phiRange \ge \pi$) , then $thetaRange = 2 · \pi$ (resp. $phiRange = \pi$) will be used instead. $thetaRange \le 0$ (resp. $phiRange \le 0$) | If $thetaRange \ge 2 · \pi$ (resp. $phiRange \ge \pi$) , then $thetaRange = 2 · \pi$ (resp. $phiRange = \pi$) will be used instead. $thetaRange \le 0$ (resp. $phiRange \le 0$) | ||
| - | sets an angular opening in _theta_ | + | sets an angular opening in // |
| - | _phiRange | + | // |
| + | |||
| + | **setSteps** Sets the resolution in //theta// and //phi//. | ||
| + | |||
| + | > **void setSteps(double thetaStep, | ||
| - | **setSteps**   Sets the resolution in _theta_ and _phi_. | ||
| - | <div align=" | ||
| - | void setSteps(double thetaStep, | ||
| - | </ | ||
| - | | ||
| - | If $thetaStep \ge thetaRange$ (resp. $phiStep \ge phiRange$) , then _thetaStep = thetaRange_ (resp. | + | If $thetaStep \ge thetaRange$ (resp. $phiStep \ge phiRange$) , then _thetaStep = thetaRange_ (resp. |
| **setpDrawRay**   Set the probability of drawing one ray. | **setpDrawRay**   Set the probability of drawing one ray. | ||
| - | <div align=" | ||
| - | void setpDrawRay(double p) ; | ||
| - | </ | ||
| - | | ||
| - | Each ray will be drawn with a probability | + | > **void setpDrawRay(double p) ;** |
| - | if $p \ge 1$ all the rays will be drawn), thus $n · p$ will be drawn in average (with _n_ the total number of rays shot). | + | |
| + | Each ray will be drawn with a probability | ||
| + | if $p \ge 1$ all the rays will be drawn), thus $n · p$ will be drawn in average (with //n// the total number of rays shot). | ||
| + | |||
| + | **scan**Triggers the scanning with the specified options. | ||
| + | |||
| + | > **ArrayList< | ||
| - | **scan**   Triggers the scanning with the specified options. | ||
| - | <div align=" | ||
| - | ArrayList< | ||
| - | </ | ||
| - | | ||
| Rays will be shot from the point center, according to the angular parameters | Rays will be shot from the point center, according to the angular parameters | ||
| specified. Scanned points are returned in an ArrayList. | specified. Scanned points are returned in an ArrayList. | ||
| - | **writeDataToFile** | + | **writeDataToFile** Writes the ArrayList |
| - | <div align=" | + | |
| - | void writeDataToFile(ArrayList< | + | |
| - | </ | + | |
| - | | + | |
| - | **scanSegment**   Moves the origin of the rays along the segment _Seg(startingPoint, | + | > **void writeDataToFile(ArrayList< |
| - | <div align=" | + | |
| - | ArrayList< | + | |
| - | direction, double stepLength, int nbSteps) ; | + | |
| - | </ | + | |
| - | | + | |
| - | The vector | + | |
| + | **scanSegment** | ||
| + | |||
| + | > **ArrayList< | ||
| + | direction, double stepLength, int nbSteps) ;** | ||
| + | |||
| + | |||
| + | The vector | ||
| **Please note that for all the following methods, the angular pa- | **Please note that for all the following methods, the angular pa- | ||
| - | rameters used are those fixed by the methods | + | rameters used are those fixed by the methods |
| However, the basis defining the directions of the rays are defined | However, the basis defining the directions of the rays are defined | ||
| within the methods.** | within the methods.** | ||
| - | **scanCircle** | + | **scanCircle** Moves the origin of the rays along the circle _Cir(center, |
| been covered. Directions of the rays shot are defined by the local cylindrical basis $(-u, -u_{\theta}, | been covered. Directions of the rays shot are defined by the local cylindrical basis $(-u, -u_{\theta}, | ||
| returned in an ArrayList. | returned in an ArrayList. | ||
| - | <div align=" | + | |
| - | ArrayList< | + | > **ArrayList< |
| - | normal, | + | normal, |
| - | </div> | + | > **ArrayList< |
| - | <div align=" | + | normal, double angleStep) ;** |
| - | ArrayList< | + | |
| - | normal, double angleStep) ; | + | |
| - | </ | + | |
| - | | + | |
| The vector _zeroAngleVector_ specifies the angle reference for the circle. It | The vector _zeroAngleVector_ specifies the angle reference for the circle. It | ||
| must be orthogonal to normal. If none is specified, an arbitrary vector is used. | must be orthogonal to normal. If none is specified, an arbitrary vector is used. | ||
| - | **scanCylinder** | + | **scanCylinder** Moves the origin of the rays on the surface of the cylinder |
| of axis the segment _Seg(startingPoint, | of axis the segment _Seg(startingPoint, | ||
| of radius _r_. For each step _i_ along the cylinder’s axis, the origin of the rays | of radius _r_. For each step _i_ along the cylinder’s axis, the origin of the rays | ||
| Line 143: | Line 128: | ||
| the rays shot are defined by the local cylindrical basis $(-u, -u_{\theta}, | the rays shot are defined by the local cylindrical basis $(-u, -u_{\theta}, | ||
| each angular step, with respect to the reference basis $(zeroAngleVector, | each angular step, with respect to the reference basis $(zeroAngleVector, | ||
| - | <div align=" | + | |
| - | ArrayList< | + | > **ArrayList< |
| axis, double radius, double angularStep, | axis, double radius, double angularStep, | ||
| - | int nbSteps) ; | + | int nbSteps) ;** |
| - | </div> | + | > **ArrayList< |
| - | <div align=" | + | |
| - | ArrayList< | + | |
| - | axis, double radius, double angularStep, | + | |
| - | int nbSteps, Vector3d zeroAngleVector) ; | + | |
| - | </ | + | |
| - | | + | |
| - | The vector | + | |
| - | must be orthogonal to _axis_. If none is specified, an arbitrary vector is used. | + | The vector |
| + | must be orthogonal to //axis//. If none is specified, an arbitrary vector is used. | ||
| **scanSphere**   Moves the origin of the rays on a sphere of center center and | **scanSphere**   Moves the origin of the rays on a sphere of center center and | ||
| - | radius | + | radius |
| - | _(x,y,z)_, the origin of the rays moves from _φ = 0_ to _φ = π_ with a step _phiStep_, | + | (x,y,z), the origin of the rays moves from φ = 0 to φ = π with a step //phiStep//, |
| - | and, for each angle _φ_, from _θ = 0_ to _θ = 2π_ with a step _thetaStep_. Rays are | + | and, for each angle φ, from θ = 0 to θ = 2π with a step // |
| - | shot for each couple | + | shot for each couple (θ, φ), their directions being defined by the local spherical |
| basis $(−u_{r}$, | basis $(−u_{r}$, | ||
| - | <div align=" | ||
| - | ArrayList< | ||
| - | phiStep, double thetaStep, Vector3d x, Vector3d y, Vector3d z) ; | ||
| - | </ | ||
| - | | ||
| - | _(x, y, z)_ must be a direct orthogonal basis, | + | > **ArrayList< |
| - | positive. If $thetaStep \le 0$, then _θ = 0_ will be used at each step (thus the origin | + | |
| + | |||
| + | //(x, y, z)// must be a direct orthogonal basis, | ||
| + | positive. If $thetaStep \le 0$, then θ = 0 will be used at each step (thus the origin | ||
| of the rays describes an half circle). | of the rays describes an half circle). | ||
| - | **Noise simulation**   A set of methods enables noise simulation. The introduction of a noise factor is triggered for the parameters | + | **Noise simulation**   A set of methods enables noise simulation. The introduction of a noise factor is triggered for the parameters θ, φ and the hit distance by the following methods: |
| - | <div align=" | + | |
| - | void setThetaNoise(boolean value) ; | + | |
| - | </ | + | |
| - | <div align=" | + | |
| - | void setPhiNoise(boolean value) ; | + | |
| - | </ | + | |
| - | <div align=" | + | |
| - | void setDistanceNoise(boolean value) ; | + | |
| - | </ | + | |
| - | | + | |
| - | Each time a point is acquired, a noise factor is added to the angle _θ_ and or _φ_ and or the hit distance when computing the point’s position. Noise on _θ_ | + | > **void setThetaNoise(boolean value) ;** |
| - | and _φ_ modifies the direction in which the point is thought to be ; noise on the | + | > **void setPhiNoise(boolean value) ;** |
| + | > **void setDistanceNoise(boolean value) ;** | ||
| + | |||
| + | Each time a point is acquired, a noise factor is added to the angle θ and or φ and or the hit distance when computing the point’s position. Noise on θ | ||
| + | and φ modifies the direction in which the point is thought to be ; noise on the | ||
| hit distance the distance (in this direction) from the scanner. | hit distance the distance (in this direction) from the scanner. | ||
| The type of noise can be set through the following methods : | The type of noise can be set through the following methods : | ||
| - | <div align=" | ||
| - | void setThetaNoiseType(int type, boolean adapt, double param1, | ||
| - | double param2) ; | ||
| - | </ | ||
| - | <div align=" | ||
| - | void setPhiNoiseType(int type, boolean adapt, double param1, | ||
| - | double param2) ; | ||
| - | </ | ||
| - | <div align=" | ||
| - | void setDistanceNoiseType(int type, boolean adapt, double param1, | ||
| - | double param2) ; | ||
| - | </ | ||
| - | | ||
| - | _type = 0_ sets the noise to an uniform perturbation, | + | > **void setThetaNoiseType(int type, boolean adapt, double param1, |
| - | one (any other value inducing no noise at all). _adapt | + | double param2) ;** |
| - | with fixed parameters, whereas | + | > **void setPhiNoiseType(int type, boolean adapt, double param1, |
| + | double param2) ;** | ||
| + | > **void setDistanceNoiseType(int type, boolean adapt, double param1, | ||
| + | double param2) ;** | ||
| + | |||
| + | // | ||
| + | one (any other value inducing no noise at all). // | ||
| + | with fixed parameters, whereas | ||
| depends on the real value (see below). | depends on the real value (see below). | ||
| - | Given the real value $\alpha_{r}$ of one parameter (_θ_, _φ_ or the hit distance), the | + | Given the real value $\alpha_{r}$ of one parameter (θ, φ or the hit distance), the |
| - | value used to compute the point’s position is $`\alpha_{r} = \alpha_{r} + \epsilon`$, where _ϵ_ is the noise. | + | value used to compute the point’s position is $`\alpha_{r} = \alpha_{r} + \epsilon`$, where ϵ is the noise. |
| - | With _U(a, b)_ denoting the uniform density on [_a_, _b_] (a < b), and _N(μ, σ)_ the | + | With U(a, b) denoting the uniform density on [a, b] (a < b), and N(μ, σ) the |
| - | gaussian density of mean _μ_ and standard deviation | + | gaussian density of mean μ and standard deviation σ, the perturbation ϵ has the |
| corresponding density : | corresponding density : | ||
| - | $, and a fixed origin point | + | //r//. Given a direct orthonormal basis $B_{0} = (\vec{x}, \vec{y}, \vec{z})$, and a fixed origin point |
| - | _O_, these parameters, for some point _M(r, θ, φ)_, are defined as follow (see Fig.2 | + | //O//, these parameters, for some point M(r, θ, φ), are defined as follow (see Fig.2 |
| p.7) : | p.7) : | ||
| - | $\theta = \widehat{\vec{x}, | + | > $\theta = \widehat{\vec{x}, |
| + | > $\phi = \widehat{\vec{z}, | ||
| + | > r = OM | ||
| - | $\phi = \widehat{\vec{z}, | ||
| - | _r = OM_ | + | with //P// the orthogonal projection of //M// on the plane $(O, \vec{y}, \vec{z})$. Note that |
| - | + | only the two angular parameters θ and φ are needed to define a direction (see | |
| - | + | ||
| - | with _P_ the orthogonal projection of _M_ on the plane $(O, \vec{y}, \vec{z})$. Note that | + | |
| - | only the two angular parameters | + | |
| Fig.2 p.7). | Fig.2 p.7). | ||
| - | For each direction (_θ_, _φ_) a local direct orthonormal basis $B_{\theta, \phi} = (\vec{u_{r}}, | + | For each direction (θ, φ) a local direct orthonormal basis $B_{\theta, \phi} = (\vec{u_{r}}, |
| can be de defined, with : | can be de defined, with : | ||
| - | _, are defined as follow (see | + | point //O//, these parameters, for some point //M (r, θ, z)//, are defined as follow (see |
| Fig.2 p.7) | Fig.2 p.7) | ||
| - | $\theta = \widehat{\vec{x}, | ||
| - | _r = OM_ | + | > $\theta |
| + | > //r = OM// | ||
| + | > $z = \vec{OM} · \vec{z}$ | ||
| - | $z = \vec{OM} · \vec{z}$ | + | {{: |
| - | $ (see Fig.2 p.7). | + | with P the orthogonal projection of M on the plane $(O, \vec{x}, \vec{y})$ (see Fig.2 p.7). |
| - | For each angle _θ_ a local direct orthonormal basis $B_{\theta} = (\vec{u}, \vec{u_{\theta}}, | + | For each angle θ a local direct orthonormal basis $B_{\theta} = (\vec{u}, \vec{u_{\theta}}, |
| defined, with : | defined, with : | ||
| - | 