YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::dev::Nav2D::Map2DObject Struct Reference

#include <yarp/dev/Map2DObject.h>

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

Public Member Functions

 Map2DObject (const std::string &map_name, const double &inX, const double &inY, const double &inZ, const double &inr=0, const double &inp=0, const double &iny=0, const std::string &desc="")
 Constructor.
 
 Map2DObject (const std::string &map_name, const yarp::dev::Nav2D::XYWorld &object, const std::string &desc="")
 A constructor which accepts a yarp::math::Vec2D, defining the object by its x,y coordinates.
 
 Map2DObject ()
 Default constructor: the map name is empty, coordinates are set to zero.
 
std::string toString () const
 Returns text representation of the object.
 
bool operator!= (const Map2DObject &r) const
 Compares two Map2DObjects.
 
bool operator== (const Map2DObject &r) const
 Compares two Map2DObjects.
 
bool is_near_to (const Map2DObject &other_loc, double linear_tolerance) const
 Compares two Map2DObjects.
 
bool is_near_to (const Map2DLocation &other_loc, double linear_tolerance) const
 
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::Map2DObjectData
 Map2DObjectData ()=default
 
 Map2DObjectData (const std::string &map_id, const double x, const double y, const double z, const double roll, const double pitch, const double yaw, 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::Map2DObjectData
typedef yarp::os::idl::Unwrapped< Map2DObjectData > unwrapped
 
- 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::Map2DObjectData
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 z {0.0}
 z position of the location [m], expressed in the map reference frame
 
double roll {0.0}
 orientation [deg] in the map reference frame
 
double pitch {0.0}
 orientation [deg] in the map reference frame
 
double yaw {0.0}
 orientation [deg] in the map reference frame
 
std::string description {}
 user defined string
 

Detailed Description

Definition at line 22 of file Map2DObject.h.

Constructor & Destructor Documentation

◆ Map2DObject() [1/3]

yarp::dev::Nav2D::Map2DObject::Map2DObject ( const std::string &  map_name,
const double &  inX,
const double &  inY,
const double &  inZ,
const double &  inr = 0,
const double &  inp = 0,
const double &  iny = 0,
const std::string &  desc = "" 
)
inline

Constructor.

Parameters
map_namethe name of the map the Object refers to.
inXObject coordinates w.r.t. map reference frame (expressed in meters)
inYobject coordinates w.r.t. map reference frame (expressed in meters)
inTobject orientation w.r.t. map reference frame (expressed in degrees)

Definition at line 31 of file Map2DObject.h.

◆ Map2DObject() [2/3]

yarp::dev::Nav2D::Map2DObject::Map2DObject ( const std::string &  map_name,
const yarp::dev::Nav2D::XYWorld &  object,
const std::string &  desc = "" 
)
inline

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

The orientation is set to 0 by default.

Parameters
map_namethe name of the map the object refers to.
inXobject coordinates w.r.t. map reference frame (expressed in meters)
inYobject coordinates w.r.t. map reference frame (expressed in meters)
inTobject orientation w.r.t. map reference frame (expressed in degrees)

Definition at line 51 of file Map2DObject.h.

◆ Map2DObject() [3/3]

yarp::dev::Nav2D::Map2DObject::Map2DObject ( )
inline

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

Definition at line 66 of file Map2DObject.h.

Member Function Documentation

◆ is_near_to() [1/2]

bool Map2DObject::is_near_to ( const Map2DLocation &  other_loc,
double  linear_tolerance 
) const

Definition at line 38 of file Map2DObject.cpp.

◆ is_near_to() [2/2]

bool Map2DObject::is_near_to ( const Map2DObject &  other_loc,
double  linear_tolerance 
) const

Compares two Map2DObjects.

Returns
true if the two locations are near.

Definition at line 16 of file Map2DObject.cpp.

◆ operator!=()

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

Compares two Map2DObjects.

Returns
true if the two locations are different.

Definition at line 97 of file Map2DObject.h.

◆ operator==()

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

Compares two Map2DObjects.

Returns
true if the two locations are identical.

Definition at line 111 of file Map2DObject.h.

◆ read() [1/2]

bool yarp::dev::Nav2D::Map2DObject::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 139 of file Map2DObject.h.

◆ read() [2/2]

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

Serialization methods.

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

Definition at line 131 of file Map2DObject.h.

◆ toString()

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

Returns text representation of the object.

Returns
a human readable string containing the object infos.

Definition at line 82 of file Map2DObject.h.

◆ write() [1/2]

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

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

Definition at line 135 of file Map2DObject.h.

◆ write() [2/2]

bool yarp::dev::Nav2D::Map2DObject::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 143 of file Map2DObject.h.


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