Skip to content

Commit

Permalink
Merge pull request #197 from lowsfer/master
Browse files Browse the repository at this point in the history
Fix support for dynamic dimensionality of edges
  • Loading branch information
RainerKuemmerle authored Sep 9, 2017
2 parents 5572908 + 3a740d8 commit e26b432
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions g2o/core/base_binary_edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ void BaseBinaryEdge<D, E, VertexXiType, VertexXjType>::constructQuadraticForm()
template <int D, typename E, typename VertexXiType, typename VertexXjType>
void BaseBinaryEdge<D, E, VertexXiType, VertexXjType>::linearizeOplus(JacobianWorkspace& jacobianWorkspace)
{
new (&_jacobianOplusXi) JacobianXiOplusType(jacobianWorkspace.workspaceForVertex(0), D, Di);
new (&_jacobianOplusXj) JacobianXjOplusType(jacobianWorkspace.workspaceForVertex(1), D, Dj);
new (&_jacobianOplusXi) JacobianXiOplusType(jacobianWorkspace.workspaceForVertex(0), D < 0 ? _dimension : D, Di);
new (&_jacobianOplusXj) JacobianXjOplusType(jacobianWorkspace.workspaceForVertex(1), D < 0 ? _dimension : D, Dj);
linearizeOplus();
}

Expand Down
2 changes: 1 addition & 1 deletion g2o/core/base_multi_edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void BaseMultiEdge<D, E>::linearizeOplus(JacobianWorkspace& jacobianWorkspace)
for (size_t i = 0; i < _vertices.size(); ++i) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(_vertices[i]);
assert(v->dimension() >= 0);
new (&_jacobianOplus[i]) JacobianType(jacobianWorkspace.workspaceForVertex(i), D, v->dimension());
new (&_jacobianOplus[i]) JacobianType(jacobianWorkspace.workspaceForVertex(i), D < 0 ? _dimension : D, v->dimension());
}
linearizeOplus();
}
Expand Down
2 changes: 1 addition & 1 deletion g2o/core/base_unary_edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void BaseUnaryEdge<D, E, VertexXiType>::constructQuadraticForm()
template <int D, typename E, typename VertexXiType>
void BaseUnaryEdge<D, E, VertexXiType>::linearizeOplus(JacobianWorkspace& jacobianWorkspace)
{
new (&_jacobianOplusXi) JacobianXiOplusType(jacobianWorkspace.workspaceForVertex(0), D, VertexXiType::Dimension);
new (&_jacobianOplusXi) JacobianXiOplusType(jacobianWorkspace.workspaceForVertex(0), D < 0 ? _dimension : D, VertexXiType::Dimension);
linearizeOplus();
}

Expand Down

0 comments on commit e26b432

Please sign in to comment.