44 return is.good() || is.eof();
56 if (from.count(fromEdge) > 0)
62#ifndef NUMERIC_JACOBIAN_TWO_D_TYPES
69 double si = std::sin(thetai), ci = std::cos(thetai);
72 -ci * dt.x() - si * dt.y(), 0, 0, -1;
78 z.block<2, 2>(0, 0) = rmean.
rotation().toRotationMatrix();
80 z.row(2).head<2>() <<
cst(0.),
cst(0.);
92 if (
typeid(*element).name() !=
_typeName)
return nullptr;
108 *(params->
os) << std::endl;
112#ifdef G2O_HAVE_OPENGL
113EdgeSE2DrawAction::EdgeSE2DrawAction()
116 _triangleY(nullptr) {}
118bool EdgeSE2DrawAction::refreshPropertyPtrs(
119 HyperGraphElementAction::Parameters* params_) {
121 if (_previousParams) {
123 _typeName +
"::GHOST_TRIANGLE_X", .2f);
125 _typeName +
"::GHOST_TRIANGLE_Y", .05f);
133HyperGraphElementAction* EdgeSE2DrawAction::operator()(
134 HyperGraph::HyperGraphElement* element,
135 HyperGraphElementAction::Parameters* params_) {
136 if (
typeid(*element).name() != _typeName)
return nullptr;
138 refreshPropertyPtrs(params_);
139 if (!_previousParams)
return this;
141 if (_show && !_show->value())
return this;
143 EdgeSE2* e =
static_cast<EdgeSE2*
>(element);
144 VertexSE2* from =
static_cast<VertexSE2*
>(e->vertex(0));
145 VertexSE2* to =
static_cast<VertexSE2*
>(e->vertex(1));
146 if (!from && !to)
return this;
149 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING | GL_COLOR);
150 glDisable(GL_LIGHTING);
153 toTransform = to->estimate();
154 fromTransform = to->estimate() * e->measurement().inverse();
157 glTranslatef((
float)fromTransform.translation().x(),
158 (
float)fromTransform.translation().y(), 0.f);
159 glRotatef((
float)
RAD2DEG(fromTransform.rotation().angle()), 0.f, 0.f, 1.f);
161 (
float)_triangleX->value() * .3f);
165 fromTransform = from->estimate();
166 toTransform = from->estimate() * e->measurement();
169 glTranslatef(toTransform.translation().x(), toTransform.translation().y(),
171 glRotatef((
float)
RAD2DEG(toTransform.rotation().angle()), 0.f, 0.f, 1.f);
173 (
float)_triangleX->value() * .3f);
177 fromTransform = from->estimate();
178 toTransform = to->estimate();
181 glVertex3f((
float)fromTransform.translation().x(),
182 (
float)fromTransform.translation().y(), 0.f);
183 glVertex3f((
float)toTransform.translation().x(),
184 (
float)toTransform.translation().y(), 0.f);
BaseFixedSizedEdge< D, SE2, VertexSE2, VertexSE2 >::template JacobianType< D, VertexXj::Dimension > & _jacobianOplusXj
BaseFixedSizedEdge< D, SE2, VertexSE2, VertexSE2 >::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()
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
EdgeSE2WriteGnuplotAction()
2D edge between two Vertex2
EIGEN_MAKE_ALIGNED_OPERATOR_NEW EdgeSE2()
virtual void linearizeOplus()
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 setMeasurement(const SE2 &m)
virtual bool write(std::ostream &os) const
write the vertex to a stream
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
SE2 inverse() const
invert :-)
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)
void drawArrow2D(float len, float head_width, float head_len)
constexpr double cst(long double v)
Property< float > FloatProperty
#define POSE_EDGE_GHOST_COLOR