Public Member Functions | Private Attributes
rail::spatial_temporal_learning::worldlib::geometry::Position Class Reference

3-point position information. More...

#include <Position.h>

List of all members.

Public Member Functions

double distance (const Position &position) const
 Distance calculator.
double getX () const
 X value accessor.
double getY () const
 Y value accessor.
double getZ () const
 Z value accessor.
 Position (const double x=0, const double y=0, const double z=0)
 Create a new Position.
 Position (const geometry_msgs::Point &point)
 Create a new Position.
 Position (const geometry_msgs::Vector3 &v)
 Create a new Position.
 Position (const tf2::Vector3 &v)
 Create a new Position.
void setX (const double x)
 X value mutator.
void setY (const double y)
 Y value mutator.
void setZ (const double z)
 Z value mutator.
geometry_msgs::Point toROSPointMessage () const
geometry_msgs::Vector3 toROSVector3Message () const
tf2::Vector3 toTF2Vector3 () const

Private Attributes

double x_
double y_
double z_

Detailed Description

3-point position information.

A position simply contains x, y, and z value. This class is useful for internal data management within the worldlib library. Convenience functions are added for use with ROS messages.

Definition at line 36 of file Position.h.


Constructor & Destructor Documentation

Position::Position ( const double  x = 0,
const double  y = 0,
const double  z = 0 
)

Create a new Position.

Creates a new Position with the given x, y, and z values (defaults are 0).

Parameters:
xThe x value (default of 0).
yThe y value (default of 0).
zThe z value (default of 0).

Definition at line 18 of file Position.cpp.

Position::Position ( const geometry_msgs::Point &  point)

Create a new Position.

Creates a new Position with the given x, y, and z values from the ROS Point message.

Parameters:
pointThe ROS Point message to extract values from.

Definition at line 26 of file Position.cpp.

Position::Position ( const geometry_msgs::Vector3 &  v)

Create a new Position.

Creates a new Position with the given x, y, and z values from the ROS Vector3 message.

Parameters:
pointThe ROS Vector3 message to extract values from.

Definition at line 34 of file Position.cpp.

Position::Position ( const tf2::Vector3 &  v)

Create a new Position.

Creates a new Position with the given x, y, and z values from the ROS tf2 Vector3.

Parameters:
pointThe ROS tf2 Vector3 to extract values from.

Definition at line 42 of file Position.cpp.


Member Function Documentation

double Position::distance ( const Position position) const

Distance calculator.

Calculate the distance between this position vector and the given position vector.

Parameters:
positionThe position vector to calculate the distance to.
Returns:
The distance between this position vector and the given position vector.

Definition at line 80 of file Position.cpp.

double Position::getX ( ) const

X value accessor.

Get the x value of this Position.

Returns:
The x value.

Definition at line 55 of file Position.cpp.

double Position::getY ( ) const

Y value accessor.

Get the y value of this Position.

Returns:
The y value.

Definition at line 65 of file Position.cpp.

double Position::getZ ( ) const

Z value accessor.

Get the z value of this Position.

Returns:
The z value.

Definition at line 75 of file Position.cpp.

void Position::setX ( const double  x)

X value mutator.

Set the x value of this Position.

Parameters:
xThe new x value.

Definition at line 50 of file Position.cpp.

void Position::setY ( const double  y)

Y value mutator.

Set the y value of this Position.

Parameters:
yThe new y value.

Definition at line 60 of file Position.cpp.

void Position::setZ ( const double  z)

Z value mutator.

Set the z value of this Position.

Parameters:
zThe new z value.

Definition at line 70 of file Position.cpp.

geometry_msgs::Point Position::toROSPointMessage ( ) const

Converts this Position object into a ROS Point message.

Returns:
The ROS Point message with this position data.

Definition at line 86 of file Position.cpp.

geometry_msgs::Vector3 Position::toROSVector3Message ( ) const

Converts this Position object into a ROS Vector3 message.

Returns:
The ROS Vector3 message with this position data.

Definition at line 95 of file Position.cpp.

tf2::Vector3 Position::toTF2Vector3 ( ) const

Converts this Position object into a ROS tf2 Vector3.

Returns:
The ROS tf2 Vector3 with this position data.

Definition at line 104 of file Position.cpp.


Member Data Documentation

Members to hold values.

Definition at line 164 of file Position.h.

Definition at line 164 of file Position.h.

Definition at line 164 of file Position.h.


The documentation for this class was generated from the following files:


worldlib
Author(s): Russell Toris
autogenerated on Fri Feb 12 2016 00:24:19