50 unsigned int index = 2 * i;
62 unsigned int index = 2 * i;
74 for (
unsigned int j = 0; j < i; j++) {
88 unsigned int index = 2 * i;
108 double ct = std::cos(th1);
109 double st = std::sin(th1);
112 unsigned int rows = 2 * (
_vertices.size() - 1);
117 poseRot << ct, st, -st, ct;
119 Matrix2 minusPoseRot = -poseRot;
121 for (
unsigned int i = 1; i <
_vertices.size(); i++) {
124 const double& x2 = point->
estimate()[0];
125 const double& y2 = point->
estimate()[1];
127 unsigned int index = 2 * (i - 1);
129 Ji.block<2, 2>(index, 0) = minusPoseRot;
131 Ji(index, 2) = ct * (y2 - y1) + st * (x1 - x2);
132 Ji(index + 1, 2) = st * (y1 - y2) + ct * (x1 - x2);
137 Jj.block<2, 2>(index, 0) = poseRot;
149 "Bad vertices specified");
158 estimate_this[i] =
true;
162 for (std::set<HyperGraph::Vertex*>::iterator it = fixed.begin();
163 it != fixed.end(); ++it) {
164 for (
unsigned int i = 1; i <
_vertices.size(); i++) {
166 if (vert->
id() == (*it)->id()) estimate_this[i - 1] =
false;
170 for (
unsigned int i = 1; i <
_vertices.size(); i++) {
171 if (estimate_this[i - 1]) {
172 unsigned int index = 2 * (i - 1);
185 for (std::set<HyperGraph::Vertex*>::iterator it = fixed.begin();
186 it != fixed.end(); ++it) {
202 unsigned int index = 2 * i;
EIGEN_STRONG_INLINE const InformationType & information() const
information matrix of the constraint
Measurement _measurement
the measurement of the edge
base class to represent an edge connecting an arbitrary number of nodes
virtual void resize(size_t size)
std::vector< JacobianType > _jacobianOplus
jacobians of the edge (w.r.t. oplus)
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 void initialEstimate(const OptimizableGraph::VertexSet &, OptimizableGraph::Vertex *)
virtual void linearizeOplus()
virtual void computeError()
virtual double initialEstimatePossible(const OptimizableGraph::VertexSet &, OptimizableGraph::Vertex *)
void setSize(int vertices)
unsigned int _observedPoints
virtual bool write(std::ostream &os) const
write the vertex to a stream
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
virtual bool setMeasurementFromState()
VertexContainer _vertices
int id() const
returns the id
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)
MatrixN< Eigen::Dynamic > MatrixX
VectorN< Eigen::Dynamic > VectorX