6#ifndef YARP_DEV_MAP2DLOCATION_H
7#define YARP_DEV_MAP2DLOCATION_H
30 Map2DLocation(
const std::string& map_name,
const double& inX,
const double& inY,
const double& inT,
const std::string& desc =
"")
74 std::ostringstream stringStream;
75 stringStream.precision(-1);
76 stringStream.width(-1);
77 stringStream << std::string(
"map_id:") << map_id << std::string(
" x:") << x << std::string(
" y:") << y << std::string(
" theta:") << theta;
78 stringStream << std::string(
"desc:") << description;
79 return stringStream.str();
89 map_id != r.
map_id || x != r.
x || y != r.
y || theta != r.
theta) {
102 map_id == r.
map_id && x == r.
x && y == r.
y && theta == r.
theta) {
112 bool is_near_to(
const Map2DLocation& other_loc,
double linear_tolerance,
double angular_tolerance)
const;
119 return Map2DLocationData::read(reader);
123 return Map2DLocationData::write(writer);
127 return Map2DLocationData::read(reader);
131 return Map2DLocationData::write(writer);
contains definitions for common types used in navigation interfaces
std::string map_id
name of the map
double theta
orientation [deg] in the map reference frame
double y
y position of the location [m], expressed in the map reference frame
double x
x position of the location [m], expressed in the map reference frame
An interface for reading from a network connection.
An interface for writing to a network connection.
IDL-friendly connection reader.
IDL-friendly connection writer.
bool write(const yarp::os::idl::WireWriter &writer) const override
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
bool operator==(const Map2DLocation &r) const
Compares two Map2DLocations.
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.
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Map2DLocation(const std::string &map_name, const double &inX, const double &inY, const double &inT, const std::string &desc="")
Constructor.
std::string toString() const
Returns text representation of the location.
Map2DLocation()
Default constructor: the map name is empty, coordinates are set to zero.
bool operator!=(const Map2DLocation &r) const
Compares two Map2DLocations.
bool read(yarp::os::idl::WireReader &reader) override
Serialization methods.