YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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, const std::string &desc="")
 Constructor.
 
 Map2DLocation (const std::string &map_name, const yarp::dev::Nav2D::XYWorld &location, const std::string &desc="")
 A constructor which accepts a yarp::math::Vec2D, defining the location by its x,y coordinates.
 
 Map2DLocation ()
 Default constructor: the map name is empty, coordinates are set to zero.
 
std::string toString () const
 Returns text representation of the location.
 
bool operator!= (const Map2DLocation &r) const
 Compares two Map2DLocations.
 
bool operator== (const Map2DLocation &r) const
 Compares two Map2DLocations.
 
bool is_near_to (const Map2DLocation &other_loc, double linear_tolerance, double angular_tolerance) const
 Compares two Map2DLocations.
 
bool read (yarp::os::idl::WireReader &reader) override
 Serialization methods.
 
bool write (const yarp::os::idl::WireWriter &writer) const override
 
bool read (yarp::os::ConnectionReader &reader) override
 Read this object from a network connection.
 
bool write (yarp::os::ConnectionWriter &writer) const override
 Write this object to a network connection.
 
- Public Member Functions inherited from yarp::dev::Map2DLocationData
 Map2DLocationData ()=default
 
 Map2DLocationData (const std::string &map_id, const double x, const double y, const double theta, const std::string &description)
 
bool read (yarp::os::idl::WireReader &reader) override
 
bool read (yarp::os::ConnectionReader &connection) override
 Read this object from a network connection.
 
bool write (const yarp::os::idl::WireWriter &writer) const override
 
bool write (yarp::os::ConnectionWriter &connection) const override
 Write this object to a network connection.
 
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.
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor.
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations.
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations.
 
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.
 
- Public Attributes inherited from yarp::dev::Map2DLocationData
std::string map_id {}
 name of the map
 
double x {0.0}
 x position of the location [m], expressed in the map reference frame
 
double y {0.0}
 y position of the location [m], expressed in the map reference frame
 
double theta {0.0}
 orientation [deg] in the map reference frame
 
std::string description {}
 user defined string
 

Detailed Description

Definition at line 21 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,
const std::string &  desc = "" 
)
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 30 of file Map2DLocation.h.

◆ Map2DLocation() [2/3]

yarp::dev::Nav2D::Map2DLocation::Map2DLocation ( const std::string &  map_name,
const yarp::dev::Nav2D::XYWorld location,
const std::string &  desc = "" 
)
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 47 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 59 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 86 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 99 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

Implements yarp::os::Portable.

Definition at line 125 of file Map2DLocation.h.

◆ read() [2/2]

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

Serialization methods.

Reimplemented from yarp::os::idl::WirePortable.

Definition at line 117 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 72 of file Map2DLocation.h.

◆ write() [1/2]

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

Reimplemented from yarp::os::idl::WirePortable.

Definition at line 121 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

Implements yarp::os::Portable.

Definition at line 129 of file Map2DLocation.h.


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