42 assert(from.size() == 1 && from.count(
_vertices[0]) == 1 &&
43 "Can not initialize VertexSE2 position by VertexPointXY");
45 if (from.count(
_vertices[0]) != 1)
return;
72 if (
typeid(*element).name() !=
_typeName)
return nullptr;
87 *(params->
os) << std::endl;
92EdgeSE2PointXYBearingDrawAction::EdgeSE2PointXYBearingDrawAction()
95HyperGraphElementAction* EdgeSE2PointXYBearingDrawAction::operator()(
96 HyperGraph::HyperGraphElement* element,
97 HyperGraphElementAction::Parameters* params_) {
98 if (
typeid(*element).name() != _typeName)
return nullptr;
100 refreshPropertyPtrs(params_);
101 if (!_previousParams)
return this;
103 if (_show && !_show->value())
return this;
105 EdgeSE2PointXYBearing* e =
static_cast<EdgeSE2PointXYBearing*
>(element);
106 VertexSE2* from =
static_cast<VertexSE2*
>(e->vertex(0));
107 VertexPointXY* to =
static_cast<VertexPointXY*
>(e->vertex(1));
108 if (!from)
return this;
109 double guessRange = 5;
110 double theta = e->measurement();
111 Vector2 p(std::cos(theta) * guessRange, std::sin(theta) * guessRange);
112 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING | GL_COLOR);
113 glDisable(GL_LIGHTING);
115 p = from->estimate() * p;
117 glPushAttrib(GL_POINT_SIZE);
120 glVertex3f((
float)p.x(), (
float)p.y(), 0.f);
128 glVertex3f((
float)from->estimate().translation().x(),
129 (
float)from->estimate().translation().y(), 0.f);
130 glVertex3f((
float)p.x(), (
float)p.y(), 0.f);
EIGEN_STRONG_INLINE const Measurement & measurement() const
accessor functions for the measurement represented by the edge
EIGEN_STRONG_INLINE const InformationType & information() const
information matrix of the constraint
Measurement _measurement
the measurement of the edge
const EstimateType & estimate() const
return the current estimate of the vertex
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
EdgeSE2PointXYBearingWriteGnuplotAction()
virtual bool write(std::ostream &os) const
write the vertex to a stream
EIGEN_MAKE_ALIGNED_OPERATOR_NEW EdgeSE2PointXYBearing()
virtual void initialEstimate(const OptimizableGraph::VertexSet &from, OptimizableGraph::Vertex *to)
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
Abstract action that operates on a graph entity.
VertexContainer _vertices
const Vertex * vertex(size_t i) const
std::set< Vertex * > VertexSet
A general case Vertex for optimization.
const Vector2 & translation() const
translational component
void setRotation(const Rotation2D &R_)
const Rotation2D & rotation() const
rotational component
2D pose Vertex, (x,y,theta)
Eigen::Rotation2D< double > Rotation2D
#define LANDMARK_EDGE_GHOST_COLOR
#define LANDMARK_EDGE_COLOR