YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
LaserMeasurementData.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#include <
yarp/sig/LaserMeasurementData.h
>
7
#include <cmath>
8
9
using namespace
yarp::sig
;
10
11
LaserMeasurementData::LaserMeasurementData
()
12
{
13
stored_x = stored_y = stored_angle = stored_distance = 0;
14
}
15
16
void
LaserMeasurementData::set_cartesian
(
const
double
x,
const
double
y)
17
{
18
stored_x = x; stored_y = y; stored_distance = sqrt(x*x + y*y); stored_angle = atan2(y, x);
19
}
20
21
void
LaserMeasurementData::set_polar
(
const
double
rho,
const
double
theta)
22
{
23
stored_angle = theta; stored_distance = rho; stored_y = rho*sin(theta); stored_x = rho*cos(theta);
24
}
25
26
void
LaserMeasurementData::get_cartesian
(
double
& x,
double
& y)
27
{
28
x = stored_x; y = stored_y;
29
}
30
31
void
LaserMeasurementData::get_polar
(
double
& rho,
double
& theta)
32
{
33
rho = stored_distance; theta = stored_angle;
34
}
LaserMeasurementData.h
yarp::sig::LaserMeasurementData::set_cartesian
void set_cartesian(const double x, const double y)
Definition
LaserMeasurementData.cpp:16
yarp::sig::LaserMeasurementData::get_cartesian
void get_cartesian(double &x, double &y)
Definition
LaserMeasurementData.cpp:26
yarp::sig::LaserMeasurementData::LaserMeasurementData
LaserMeasurementData()
Definition
LaserMeasurementData.cpp:11
yarp::sig::LaserMeasurementData::get_polar
void get_polar(double &rho, double &theta)
Definition
LaserMeasurementData.cpp:31
yarp::sig::LaserMeasurementData::set_polar
void set_polar(const double rho, const double theta)
Definition
LaserMeasurementData.cpp:21
yarp::sig
Definition
audioBufferSizeData.cpp:13
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
libYARP_sig
src
yarp
sig
LaserMeasurementData.cpp
Generated on Wed Jun 4 2025 02:40:13 for YARP by
1.9.8