Skip to content

Commit

Permalink
fix bug work with orbslam
Browse files Browse the repository at this point in the history
  • Loading branch information
zdzhaoyong committed Oct 28, 2019
1 parent ac5244d commit a2139d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pi_add_target(gslam_topic SHARED GSLAM/plugins/topic REQUIRED System LTO)

pi_add_target(qviz_panel_win3d SHARED GSLAM/plugins/qviz/panels/win3d REQUIRED System Qt OpenGL GLEW)
pi_add_target(qviz_panel_displays SHARED GSLAM/plugins/qviz/panels/displays REQUIRED System Qt)
pi_add_target(qviz_panel_frameinfo SHARED GSLAM/plugins/qviz/panels/frameinfo REQUIRED System Qt)
pi_add_target(qviz_panel_frameinfo SHARED GSLAM/plugins/qviz/panels/frameinfo REQUIRED System Qt OpenCV)
pi_add_target(qviz_panel_pubsubs SHARED GSLAM/plugins/qviz/panels/pubsubs REQUIRED System Qt)
pi_add_target(qviz_panel_logger SHARED GSLAM/plugins/qviz/panels/logger REQUIRED System Qt)

Expand Down
14 changes: 8 additions & 6 deletions GSLAM/plugins/qviz/panels/win3d/Win3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class VisNodeGL: public QObject{

if(node->colors.size()){
glBindBuffer(GL_ARRAY_BUFFER,_colorBuffer);
glBufferData(GL_ARRAY_BUFFER,node->colors.size()*3*sizeof(NodeGL::Color3b),
glBufferData(GL_ARRAY_BUFFER,node->colors.size()*sizeof(NodeGL::Color3b),
node->colors.data(), GL_STATIC_DRAW);
}

if(node->normals.size()){
glBindBuffer(GL_ARRAY_BUFFER,_normalBuffer);
glBufferData(GL_ARRAY_BUFFER,node->normals.size()*3*sizeof(NodeGL::Vertex3f),
glBufferData(GL_ARRAY_BUFFER,node->normals.size()*sizeof(NodeGL::Vertex3f),
node->normals.data(), GL_STATIC_DRAW);
}

Expand Down Expand Up @@ -209,9 +209,11 @@ void Win3D::slotNode(Svar msg)


if(node->empty()) {
nodevis.erase(node->name);
messenger.publish("qviz/display",nodevis);
updateGL();
if(nodevis.exist(node->name)){
nodevis.erase(node->name);
messenger.publish("qviz/display",nodevis);
updateGL();
}
return;
}

Expand Down Expand Up @@ -274,7 +276,7 @@ void Win3D::updateScenseCenterRadius()
if(vis->_transform.get_scale()>0){
std::vector<Point3f> add;
for(int i=0;i<8;i++)
add.push_back(Point3f(vertices[i&1].x,vertices[i&2].y,vertices[i&4].z));
add.push_back(Point3f(vertices[i&1].x,vertices[(i&2)>>1].y,vertices[(i&4)>>2].z));
vertices=add;
}

Expand Down

0 comments on commit a2139d1

Please sign in to comment.