Skip to content

Commit

Permalink
CloudViewer: fixed an iterator comparison error
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Oct 18, 2015
1 parent 2953217 commit 38b3e6c
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions guilib/src/CloudViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ void CloudViewer::removeText(const std::string & id)
return;
}

if(_texts.find(id) != _coordinates.end())
if(_texts.find(id) != _texts.end())
{
_visualizer->removeText3D(id);
_texts.erase(id);
Expand Down Expand Up @@ -959,15 +959,28 @@ void CloudViewer::getCameraPosition(
{
std::vector<pcl::visualization::Camera> cameras;
_visualizer->getCameras(cameras);
x = cameras.front().pos[0];
y = cameras.front().pos[1];
z = cameras.front().pos[2];
focalX = cameras.front().focal[0];
focalY = cameras.front().focal[1];
focalZ = cameras.front().focal[2];
upX = cameras.front().view[0];
upY = cameras.front().view[1];
upZ = cameras.front().view[2];
if(cameras.size())
{
x = cameras.begin()->pos[0];
y = cameras.begin()->pos[1];
z = cameras.begin()->pos[2];
focalX = cameras.begin()->focal[0];
focalY = cameras.begin()->focal[1];
focalZ = cameras.begin()->focal[2];
upX = cameras.begin()->view[0];
upY = cameras.begin()->view[1];
upZ = cameras.begin()->view[2];
}
else
{
_visualizer->setCameraPosition(
-1, 0, 0,
0, 0, 0,
0, 0, 1);
x=-1.0f;
y=z=focalX=focalY=focalZ=upX=upY=0;
upZ=1.0f;
}
}

void CloudViewer::setCameraPosition(
Expand Down

0 comments on commit 38b3e6c

Please sign in to comment.