#include <yarp/dev/Map2DPath.h>
Public Types | |
using | iterator = std::vector< Map2DLocation >::iterator |
using | const_iterator = std::vector< Map2DLocation >::const_iterator |
Public Types inherited from yarp::dev::Map2DPathData | |
typedef yarp::os::idl::Unwrapped< Map2DPathData > | unwrapped |
Public Member Functions | |
Map2DPath (const std::vector< yarp::dev::Nav2D::Map2DLocation > &map_waypoints, const std::string &desc="") | |
Constructor. | |
Map2DPath () | |
Default constructor: the map name is empty, coordinates are set to zero. | |
std::string | toString () const |
Returns text representation of the path. | |
bool | operator!= (const Map2DPath &r) const |
Compares two Map2DPath. | |
bool | operator== (const Map2DPath &r) const |
Compares two Map2DArea. | |
yarp::dev::Nav2D::Map2DLocation & | operator[] (size_t index) |
Returns a waypoint in the path. | |
size_t | size () const |
Returns the size of the path. | |
double | getLength () const |
Returns the length of the path. | |
bool | isOnSingleMap () const |
Checks if all the waypoints of the path belong to the same map return true if the test is successful. | |
bool | read (yarp::os::idl::WireReader &reader) override |
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. | |
void | clear () |
Remove all elements from the path. | |
iterator | begin () noexcept |
Returns an iterator to the begin of the Path. | |
iterator | end () noexcept |
Returns an iterator to the end of the Path. | |
const_iterator | cbegin () const noexcept |
Returns a const iterator to the begin of the Path. | |
const_iterator | cend () const noexcept |
Returns a const iterator to the end of the Path. | |
void | push_back (yarp::dev::Nav2D::Map2DLocation loc) |
Inserts a new location into the path @loc the location to be inserted. | |
Public Member Functions inherited from yarp::dev::Map2DPathData | |
Map2DPathData ()=default | |
Map2DPathData (const std::vector< yarp::dev::Nav2D::Map2DLocation > &waypoints, 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 | |
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::Map2DPathData | |
std::vector< yarp::dev::Nav2D::Map2DLocation > | waypoints {} |
list of waypoints which define the path | |
std::string | description {} |
user defined string | |
Definition at line 18 of file Map2DPath.h.
using yarp::dev::Nav2D::Map2DPath::const_iterator = std::vector<Map2DLocation>::const_iterator |
Definition at line 100 of file Map2DPath.h.
using yarp::dev::Nav2D::Map2DPath::iterator = std::vector<Map2DLocation>::iterator |
Definition at line 99 of file Map2DPath.h.
Map2DPath::Map2DPath | ( | const std::vector< yarp::dev::Nav2D::Map2DLocation > & | map_waypoints, |
const std::string & | desc = "" |
||
) |
Constructor.
area_points | a set of Map2DLocations defining the path. |
Definition at line 61 of file Map2DPath.cpp.
Map2DPath::Map2DPath | ( | ) |
Default constructor: the map name is empty, coordinates are set to zero.
Definition at line 70 of file Map2DPath.cpp.
|
noexcept |
Returns an iterator to the begin of the Path.
Definition at line 109 of file Map2DPath.cpp.
|
noexcept |
Returns a const iterator to the begin of the Path.
Definition at line 120 of file Map2DPath.cpp.
|
noexcept |
Returns a const iterator to the end of the Path.
Definition at line 125 of file Map2DPath.cpp.
void Map2DPath::clear | ( | ) |
Remove all elements from the path.
Definition at line 55 of file Map2DPath.cpp.
|
noexcept |
Returns an iterator to the end of the Path.
Definition at line 115 of file Map2DPath.cpp.
double Map2DPath::getLength | ( | ) | const |
Returns the length of the path.
Definition at line 84 of file Map2DPath.cpp.
bool Map2DPath::isOnSingleMap | ( | ) | const |
Checks if all the waypoints of the path belong to the same map return true if the test is successful.
Definition at line 94 of file Map2DPath.cpp.
Compares two Map2DPath.
Definition at line 22 of file Map2DPath.cpp.
Compares two Map2DArea.
Definition at line 32 of file Map2DPath.cpp.
Map2DLocation & Map2DPath::operator[] | ( | size_t | index | ) |
Returns a waypoint in the path.
index | the waypoint index |
Definition at line 74 of file Map2DPath.cpp.
void Map2DPath::push_back | ( | yarp::dev::Nav2D::Map2DLocation | loc | ) |
Inserts a new location into the path @loc the location to be inserted.
Definition at line 130 of file Map2DPath.cpp.
|
inlineoverridevirtual |
Read this object from a network connection.
Override this for your particular class.
reader | an interface to the network connection for reading |
Implements yarp::os::Portable.
Definition at line 84 of file Map2DPath.h.
|
inlineoverridevirtual |
Reimplemented from yarp::os::idl::WirePortable.
Definition at line 76 of file Map2DPath.h.
size_t Map2DPath::size | ( | ) | const |
Returns the size of the path.
Definition at line 79 of file Map2DPath.cpp.
std::string Map2DPath::toString | ( | ) | const |
Returns text representation of the path.
Definition at line 42 of file Map2DPath.cpp.
|
inlineoverridevirtual |
Reimplemented from yarp::os::idl::WirePortable.
Definition at line 80 of file Map2DPath.h.
|
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
writer | an interface to the network connection for writing |
Implements yarp::os::Portable.
Definition at line 88 of file Map2DPath.h.