25 , m_point(0.0, 0.0, 0.0)
53 if (numOfElements > 0)
55 m_elements =
new double[numOfElements];
61 m_numOfElements = numOfElements;
66 if (m_elements != NULL)
77 if ((numOfRows > 0) && (numOfColumns > 0))
79 m_elements =
new double*[numOfRows];
80 for (
UINT16 r=0; r < numOfRows; r++)
82 m_elements[r] =
new double[numOfColumns];
84 m_numOfRows = numOfRows;
85 m_numOfColumns = numOfColumns;
97 if (m_elements != NULL)
99 for (
UINT16 r=0; r < m_numOfRows; r++)
101 delete m_elements[r];
119 P_LS[0] = pt->
getX();
120 P_LS[1] = pt->
getY();
121 P_LS[2] = pt->
getZ();
125 double dXOffset_LS, dYOffset_LS, dZOffset_LS;
128 double dPitch_LS, dYaw_LS, dRoll_LS;
142 double dSPitch_LS = sin(dPitch_LS);
143 double dCPitch_LS = cos(dPitch_LS);
144 double dSYaw_LS = sin(dYaw_LS);
145 double dCYaw_LS = cos(dYaw_LS);
146 double dSRoll_LS = sin(dRoll_LS);
147 double dCRoll_LS = cos(dRoll_LS);
150 H_LS_Car(0,0) = dCYaw_LS*dCPitch_LS - dSYaw_LS*dSPitch_LS*dSRoll_LS;
151 H_LS_Car(0,1) = -dSYaw_LS*dCRoll_LS;
152 H_LS_Car(0,2) = dCYaw_LS*dSPitch_LS + dSYaw_LS*dSRoll_LS*dCPitch_LS;
153 H_LS_Car(0,3) = dXOffset_LS;
155 H_LS_Car(1,0) = dSYaw_LS*dCPitch_LS + dCYaw_LS*dSRoll_LS*dSPitch_LS;
156 H_LS_Car(1,1) = dCYaw_LS*dCRoll_LS;
157 H_LS_Car(1,2) = dSYaw_LS*dSPitch_LS - dCYaw_LS*dSRoll_LS*dCPitch_LS;
158 H_LS_Car(1,3) = dYOffset_LS;
160 H_LS_Car(2,0) = -dCRoll_LS*dSPitch_LS;
161 H_LS_Car(2,1) = dSRoll_LS;
162 H_LS_Car(2,2) = dCRoll_LS*dCPitch_LS;
163 H_LS_Car(2,3) = dZOffset_LS;
172 pt_vehicle = H_LS_Car * P_LS;
173 pt->
setXYZ(pt_vehicle[0], pt_vehicle[1], pt_vehicle[2]);
216 std::ostringstream ostr;
217 ostr <<
"(x " <<
getX()
219 <<
", z " <<
getZ() <<
"m" void setXYZ(double x, double y, double z)
Sets the coordinates of this point to the given values.
value_type m_yawAngle
Yaw angle [rad].
Position3D & set(value_type yaw, value_type pitch, value_type roll, value_type x, value_type y, value_type z)
Set all values.
This class defines a point in the three-dimensional plane.
double getY() const
Returns the y-coordinate of this point.
value_type getX() const
x-coordinate [m] of the sensor in the vehicle coordinate system
A Position with orientation.
Position3D()
Empty constructor.
Matrix(UINT16 numOfRows, UINT16 numOfColumns)
value_type m_rollAngle
Roll angle [rad].
value_type m_pitchAngle
Pitch angle [rad].
value_type getPitchAngle() const
Pitch angle [rad] of the sensor in the vehicle coordinate system.
value_type getYawAngle() const
Yaw angle [rad] of the sensor in the vehicle coordinate system.
Point2D toPoint2D() const
Returns the x/y components of this class, converted into a Point2D object.
Vector(UINT16 numOfElements)
double getZ() const
Returns the z-coordinate of this point.
value_type getRollAngle() const
Roll angle [rad] of the sensor in the vehicle coordinate system.
bool transformToVehicle(Point3D *pt)
void normalizeAngles()
Normalize all three internal angles to the range [-PI..PI].
double getX() const
Returns the x-coordinate of this point.
value_type getY() const
y-coordinate [m] of the sensor in the vehicle coordinate system
Point3D toPoint3D() const
Returns the x/y/z components of this class, converted into a Point3D object.
bool operator==(const Position3D &other) const
Equality predicate.
value_type getZ() const
z-coordinate [m] of the sensor in the vehicle coordinate system
std::string toString() const