54 assert(from.size() == 1 && from.count(
_vertices[0]) == 1 &&
55 "Can not initialize VertexSE2 position by VertexPointXY");
59 if (from.count(vi) > 0 && to == vj) {
64#ifndef NUMERIC_JACOBIAN_TWO_D_TYPES
71 const double& x2 = vj->
estimate()[0];
72 const double& y2 = vj->
estimate()[1];
74 double aux_1 = std::cos(th1);
75 double aux_2 = -aux_1;
76 double aux_3 = std::sin(th1);
98 if (
typeid(*element).name() !=
_typeName)
return nullptr;
114 *(params->
os) << std::endl;
118#ifdef G2O_HAVE_OPENGL
119EdgeSE2PointXYDrawAction::EdgeSE2PointXYDrawAction()
122HyperGraphElementAction* EdgeSE2PointXYDrawAction::operator()(
123 HyperGraph::HyperGraphElement* element,
124 HyperGraphElementAction::Parameters* params_) {
125 if (
typeid(*element).name() != _typeName)
return nullptr;
127 refreshPropertyPtrs(params_);
128 if (!_previousParams)
return this;
130 if (_show && !_show->value())
return this;
132 EdgeSE2PointXY* e =
static_cast<EdgeSE2PointXY*
>(element);
133 VertexSE2* fromEdge =
static_cast<VertexSE2*
>(e->vertex(0));
134 VertexPointXY* toEdge =
static_cast<VertexPointXY*
>(e->vertex(1));
135 if (!fromEdge)
return this;
137 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING | GL_COLOR);
138 glDisable(GL_LIGHTING);
140 p = fromEdge->estimate() * p;
142 glPushAttrib(GL_POINT_SIZE);
145 glVertex3f((
float)p.x(), (
float)p.y(), 0.f);
149 p = toEdge->estimate();
153 glVertex3f((
float)fromEdge->estimate().translation().x(),
154 (
float)fromEdge->estimate().translation().y(), 0.f);
155 glVertex3f((
float)p.x(), (
float)p.y(), 0.f);
BaseFixedSizedEdge< D, Vector2, VertexSE2, VertexPointXY >::template JacobianType< D, VertexXj::Dimension > & _jacobianOplusXj
BaseFixedSizedEdge< D, Vector2, VertexSE2, VertexPointXY >::template JacobianType< D, VertexXi::Dimension > & _jacobianOplusXi
bool writeInformationMatrix(std::ostream &os) const
write the upper trinagular part of the information matrix into the stream
bool readInformationMatrix(std::istream &is)
EIGEN_STRONG_INLINE const Measurement & measurement() const
accessor functions for the measurement represented by the edge
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()
EdgeSE2PointXYWriteGnuplotAction()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
virtual bool write(std::ostream &os) const
write the vertex to a stream
EIGEN_MAKE_ALIGNED_OPERATOR_NEW EdgeSE2PointXY()
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
virtual void linearizeOplus()
Abstract action that operates on a graph entity.
int numUndefinedVertices() const
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
const Rotation2D & rotation() const
rotational component
2D pose Vertex, (x,y,theta)
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
#define LANDMARK_EDGE_GHOST_COLOR
#define LANDMARK_EDGE_COLOR