Skip to content

Commit

Permalink
fixing some MSVC issues caused by the merge
Browse files Browse the repository at this point in the history
I guess it currently does not compile with MSVC.
Still some stuff to fix.
  • Loading branch information
Rainer Kuemmerle committed Jun 11, 2014
1 parent f1fbd90 commit aecec52
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions g2o/core/base_multi_edge.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace g2o {
* E - type to represent the measurement
*/
template <int D, typename E>
class G2O_CORE_API BaseMultiEdge : public BaseEdge<D,E>
class BaseMultiEdge : public BaseEdge<D,E>
{
public:
/**
Expand Down Expand Up @@ -110,7 +110,7 @@ namespace g2o {

// PARTIAL TEMPLATE SPECIALIZATION
template <typename E>
class G2O_CORE_API BaseMultiEdge<-1,E> : public BaseEdge<-1,E>
class BaseMultiEdge<-1,E> : public BaseEdge<-1,E>
{
public:
/**
Expand Down
2 changes: 1 addition & 1 deletion g2o/core/hyper_graph_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

namespace g2o {

struct CacheContainer;
class CacheContainer;
/**
* \brief Abstract action that operates on an entire graph
*/
Expand Down
8 changes: 4 additions & 4 deletions g2o/types/data/vertex_ellipse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace g2o {
<< _covariance(1,1) << " " << _covariance(1,2) << " " << _covariance(2,2) << " ";

os << _matchingVertices.size() << " " ;
for (int i=0 ; i< _matchingVertices.size(); i++){
for (size_t i=0 ; i< _matchingVertices.size(); i++){
os << _matchingVertices[i].x() << " " << _matchingVertices[i].y() << " ";
}

Expand Down Expand Up @@ -135,8 +135,8 @@ namespace g2o {
glPushMatrix();

float sigmaTheta = sqrt(that->covariance()(2,2));
float x = 0.1*cos(sigmaTheta);
float y = 0.1*sin(sigmaTheta);
float x = 0.1f*cosf(sigmaTheta);
float y = 0.1f*sinf(sigmaTheta);

glColor3f(1.f,0.7f,1.f);
glBegin(GL_LINE_STRIP);
Expand All @@ -146,7 +146,7 @@ namespace g2o {
glEnd();

glColor3f(0.f,1.f,0.f);
for (int i=0; i< that->matchingVertices().size(); i++){
for (size_t i=0; i< that->matchingVertices().size(); i++){
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(that->matchingVertices()[i].x(),that->matchingVertices()[i].y(),0);
Expand Down
6 changes: 3 additions & 3 deletions g2o/types/slam2d/edge_se2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ namespace g2o {
fromTransform = to->estimate()*e->measurement().inverse();
// DRAW THE FROM EDGE AS AN ARROW
glPushMatrix();
glTranslatef(fromTransform.translation().x(),fromTransform.translation().y(),0.f);
glTranslatef((float)fromTransform.translation().x(), (float)fromTransform.translation().y(),0.f);
glRotatef((float)RAD2DEG(fromTransform.rotation().angle()),0.f,0.f,1.f);
opengl::drawArrow2D(_triangleX->value(), _triangleY->value(), _triangleX->value()*.3);
opengl::drawArrow2D((float)_triangleX->value(), (float)_triangleY->value(), (float)_triangleX->value()*.3f);
glPopMatrix();
} else if (! to){
glColor3f(POSE_EDGE_GHOST_COLOR);
Expand All @@ -177,7 +177,7 @@ namespace g2o {
glPushMatrix();
glTranslatef(toTransform.translation().x(),toTransform.translation().y(),0.f);
glRotatef((float)RAD2DEG(toTransform.rotation().angle()),0.f,0.f,1.f);
opengl::drawArrow2D(_triangleX->value(), _triangleY->value(), _triangleX->value()*.3);
opengl::drawArrow2D((float)_triangleX->value(), (float)_triangleY->value(), (float)_triangleX->value()*.3f);
glPopMatrix();
} else {
glColor3f(POSE_EDGE_COLOR);
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam2d/edge_se2_lotsofxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ namespace g2o{

VertexSE2 * pose = static_cast<VertexSE2 *>(_vertices[0]);

#ifdef _MSC_VER
std::vector<bool> estimate_this(_observedPoints, true);
#else
bool estimate_this[_observedPoints];
for(unsigned int i=0; i<_observedPoints; i++){
estimate_this[i] = true;
}
#endif

for(std::set<HyperGraph::Vertex*>::iterator it=fixed.begin(); it!=fixed.end(); it++){
for(unsigned int i=1; i<_vertices.size(); i++){
Expand Down
2 changes: 1 addition & 1 deletion g2o/types/slam2d/vertex_se2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace g2o {
glPushMatrix();
glTranslatef((float)that->estimate().translation().x(),(float)that->estimate().translation().y(),0.f);
glRotatef((float)RAD2DEG(that->estimate().rotation().angle()),0.f,0.f,1.f);
opengl::drawArrow2D(_triangleX->value(), _triangleY->value(), _triangleX->value()*.3);
opengl::drawArrow2D((float)_triangleX->value(), (float)_triangleY->value(), (float)_triangleX->value()*.3f);
drawCache(that->cacheContainer(), params_);
drawUserData(that->userData(), params_);
glPopMatrix();
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam3d/edge_se3_lotsofxyz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,14 @@ namespace g2o{

VertexSE3 * pose = static_cast<VertexSE3 *>(_vertices[0]);

#ifdef _MSC_VER
std::vector<bool> estimate_this(_observedPoints, true);
#else
bool estimate_this[_observedPoints];
for(unsigned int i=0; i<_observedPoints; i++){
estimate_this[i] = true;
}
#endif

for(std::set<HyperGraph::Vertex*>::iterator it=fixed.begin(); it!=fixed.end(); it++){
for(unsigned int i=1; i<_vertices.size(); i++){
Expand Down
6 changes: 1 addition & 5 deletions g2o/types/slam3d_addons/edge_se3_plane_calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
#include "edge_se3_plane_calib.h"

#ifdef G2O_HAVE_OPENGL
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#include "g2o/stuff/opengl_wrapper.h"
#endif

namespace g2o
Expand Down

0 comments on commit aecec52

Please sign in to comment.