YARP
Yet Another Robot Platform
yarp::dev::Nav2D::Map2DLocation Struct Reference

#include <yarp/dev/Map2DLocation.h>

+ Inheritance diagram for yarp::dev::Nav2D::Map2DLocation:

Public Member Functions

 Map2DLocation (const std::string &map_name, const double &inX, const double &inY, const double &inT)
 Constructor. More...
 
 Map2DLocation (const std::string &map_name, yarp::dev::Nav2D::XYWorld location)
 A constructor which accepts a yarp::math::Vec2D, defining the location by its x,y coordinates. More...
 
 Map2DLocation ()
 Default constructor: the map name is empty, coordinates are set to zero. More...
 
std::string toString () const
 Returns text representation of the location. More...
 
bool operator!= (const Map2DLocation &r) const
 Compares two Map2DLocations. More...
 
bool operator== (const Map2DLocation &r) const
 Compares two Map2DLocations. More...
 
bool is_near_to (const Map2DLocation &other_loc, double linear_tolerance, double angular_tolerance) const
 Compares two Map2DLocations. More...
 
bool read (yarp::os::idl::WireReader &reader) override
 Serialization methods. More...
 
bool write (const yarp::os::idl::WireWriter &writer) const override
 
bool read (yarp::os::ConnectionReader &reader) override
 Read this object from a network connection. More...
 
bool write (yarp::os::ConnectionWriter &writer) const override
 Write this object to a network connection. More...
 
- Public Member Functions inherited from yarp::dev::Map2DLocationData
 Map2DLocationData ()
 
 Map2DLocationData (const std::string &map_id, const double x, const double y, const double theta)
 
std::string toString () const
 
- Public Member Functions inherited from yarp::os::idl::WirePortable
virtual bool readBare (yarp::os::ConnectionReader &reader)
 
virtual bool writeBare (yarp::os::ConnectionWriter &writer) const
 
virtual bool readBottle (yarp::os::ConnectionReader &reader)
 
virtual bool writeBottle (yarp::os::ConnectionWriter &writer) const
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor. More...
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations. More...
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations. More...
 
virtual yarp::os::Type getWriteType () const
 

Additional Inherited Members

- Public Types inherited from yarp::dev::Map2DLocationData
typedef yarp::os::idl::Unwrapped< Map2DLocationDataunwrapped
 
- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (const PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 
- Public Attributes inherited from yarp::dev::Map2DLocationData
std::string map_id
 
double x
 
double y
 
double theta
 

Detailed Description

Definition at line 26 of file Map2DLocation.h.

Constructor & Destructor Documentation

◆ Map2DLocation() [1/3]

yarp::dev::Nav2D::Map2DLocation::Map2DLocation ( const std::string &  map_name,
const double &  inX,
const double &  inY,
const double &  inT 
)
inline

Constructor.

Parameters
map_namethe name of the map the location refers to.
inXlocation coordinates w.r.t. map reference frame (expressed in meters)
inYlocation coordinates w.r.t. map reference frame (expressed in meters)
inTlocation orientation w.r.t. map reference frame (expressed in degrees)

Definition at line 35 of file Map2DLocation.h.

◆ Map2DLocation() [2/3]

yarp::dev::Nav2D::Map2DLocation::Map2DLocation ( const std::string &  map_name,
yarp::dev::Nav2D::XYWorld  location 
)
inline

A constructor which accepts a yarp::math::Vec2D, defining the location by its x,y coordinates.

The orientation is set to 0 by default.

Parameters
map_namethe name of the map the location refers to.
inXlocation coordinates w.r.t. map reference frame (expressed in meters)
inYlocation coordinates w.r.t. map reference frame (expressed in meters)
inTlocation orientation w.r.t. map reference frame (expressed in degrees)

Definition at line 51 of file Map2DLocation.h.

◆ Map2DLocation() [3/3]

yarp::dev::Nav2D::Map2DLocation::Map2DLocation ( )
inline

Default constructor: the map name is empty, coordinates are set to zero.

Definition at line 62 of file Map2DLocation.h.

Member Function Documentation

◆ is_near_to()

bool Map2DLocation::is_near_to ( const Map2DLocation other_loc,
double  linear_tolerance,
double  angular_tolerance 
) const

Compares two Map2DLocations.

Returns
true if the two locations are near.

Definition at line 16 of file Map2DLocation.cpp.

◆ operator!=()

bool yarp::dev::Nav2D::Map2DLocation::operator!= ( const Map2DLocation r) const
inline

Compares two Map2DLocations.

Returns
true if the two locations are different.

Definition at line 87 of file Map2DLocation.h.

◆ operator==()

bool yarp::dev::Nav2D::Map2DLocation::operator== ( const Map2DLocation r) const
inline

Compares two Map2DLocations.

Returns
true if the two locations are identical.

Definition at line 105 of file Map2DLocation.h.

◆ read() [1/2]

bool yarp::dev::Nav2D::Map2DLocation::read ( yarp::os::ConnectionReader reader)
inlineoverridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Reimplemented from yarp::dev::Map2DLocationData.

Definition at line 130 of file Map2DLocation.h.

◆ read() [2/2]

bool yarp::dev::Nav2D::Map2DLocation::read ( yarp::os::idl::WireReader reader)
inlineoverridevirtual

Serialization methods.

Reimplemented from yarp::dev::Map2DLocationData.

Definition at line 128 of file Map2DLocation.h.

◆ toString()

std::string yarp::dev::Nav2D::Map2DLocation::toString ( ) const
inline

Returns text representation of the location.

Returns
a human readable string containing the location infos.

Definition at line 74 of file Map2DLocation.h.

◆ write() [1/2]

bool yarp::dev::Nav2D::Map2DLocation::write ( const yarp::os::idl::WireWriter writer) const
inlineoverridevirtual

Reimplemented from yarp::dev::Map2DLocationData.

Definition at line 129 of file Map2DLocation.h.

◆ write() [2/2]

bool yarp::dev::Nav2D::Map2DLocation::write ( yarp::os::ConnectionWriter writer) const
inlineoverridevirtual

Write this object to a network connection.

Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write

Parameters
writeran interface to the network connection for writing
Returns
true iff the object is successfully written

Reimplemented from yarp::dev::Map2DLocationData.

Definition at line 131 of file Map2DLocation.h.


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