mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Tango: fixed black clouds. Rtabmap: only add latest optimized pose to graph if localized.
This commit is contained in:
@@ -432,7 +432,9 @@ int RTABMapApp::Render()
|
||||
}
|
||||
|
||||
// Did we lose OpenGL context? If so, recreate the context;
|
||||
if(main_scene_.getAddedClouds().size() != createdMeshes_.size())
|
||||
std::set<int> added = main_scene_.getAddedClouds();
|
||||
added.erase(-1);
|
||||
if(added.size() != createdMeshes_.size())
|
||||
{
|
||||
for(std::map<int, Mesh>::iterator iter=createdMeshes_.begin(); iter!=createdMeshes_.end(); ++iter)
|
||||
{
|
||||
@@ -668,7 +670,7 @@ int RTABMapApp::Render()
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||
pcl::IndicesPtr indices(new std::vector<int>);
|
||||
cloud = rtabmap::util3d::cloudRGBFromSensorData(odomEvent.data(), meshDecimation_, maxCloudDepth_, 0.0f, indices.get());
|
||||
if(cloud->size())
|
||||
if(cloud->size() && indices->size())
|
||||
{
|
||||
LOGI("Created odom cloud (rgb=%dx%d depth=%dx%d cloud=%dx%d)",
|
||||
odomEvent.data().imageRaw().cols, odomEvent.data().imageRaw().rows,
|
||||
|
||||
@@ -336,7 +336,7 @@ void PointCloudDrawable::Render(const glm::mat4 & projectionMatrix, const glm::m
|
||||
GLuint point_size_handle_ = glGetUniformLocation(cloud_shader_program_, "point_size");
|
||||
glUniform1f(point_size_handle_, pointSize);
|
||||
|
||||
GLuint gain_handle = glGetUniformLocation(texture_shader_program_, "u_gain");
|
||||
GLuint gain_handle = glGetUniformLocation(cloud_shader_program_, "u_gain");
|
||||
glUniform1f(gain_handle, gain_);
|
||||
|
||||
GLint attribute_vertex = glGetAttribLocation(cloud_shader_program_, "vertex");
|
||||
|
||||
Reference in New Issue
Block a user