diff --git a/libs/srba/include/mrpt/srba/RbaEngine.h b/libs/srba/include/mrpt/srba/RbaEngine.h index 358bdb6da2..d2e0d45e0d 100644 --- a/libs/srba/include/mrpt/srba/RbaEngine.h +++ b/libs/srba/include/mrpt/srba/RbaEngine.h @@ -218,7 +218,8 @@ namespace srba span_tree_max_depth(static_cast(-1)), draw_unknown_feats(true), draw_unknown_feats_ellipses(true), - draw_unknown_feats_ellipses_quantiles(1) + draw_unknown_feats_ellipses_quantiles(1), + show_unknown_feats_ids(true) { } @@ -226,6 +227,7 @@ namespace srba bool draw_unknown_feats; //!< Draw features with non-fixed rel.pos as well? bool draw_unknown_feats_ellipses; double draw_unknown_feats_ellipses_quantiles; + bool show_unknown_feats_ids; }; /** Build an opengl representation of the current state of this RBA problem diff --git a/libs/srba/include/mrpt/srba/impl/export_opengl.h b/libs/srba/include/mrpt/srba/impl/export_opengl.h index 1b461291af..d88fc5af88 100644 --- a/libs/srba/include/mrpt/srba/impl/export_opengl.h +++ b/libs/srba/include/mrpt/srba/impl/export_opengl.h @@ -51,7 +51,8 @@ void RbaEngine::build_opengl_repre mrpt::opengl::CSetOfObjectsPtr o = mrpt::opengl::stock_objects::CornerXYZSimple(0.75,2.0); o->setPose(p); - o->setName( mrpt::format("%d",itP->first).c_str() ); + o->setName( mrpt::format("%d",int(itP->first)).c_str() ); + o->enableShowName(); out_scene->insert(o); } // And a bigger one for the root: @@ -63,6 +64,7 @@ void RbaEngine::build_opengl_repre // Draw all edges between frames: mrpt::opengl::CSetOfLinesPtr gl_edges = mrpt::opengl::CSetOfLines::Create(); + gl_edges->setColor(1,0,1); // Magenta, in order to not confuse them with the standard lines of a grid plane #ifdef SRBA_WORKAROUND_MSVC9_DEQUE_BUG for (typename rba_problem_state_t::k2k_edges_deque_t::const_iterator itEdge2 = rba_state.k2k_edges.begin();itEdge2!=rba_state.k2k_edges.end();++itEdge2) { diff --git a/libs/srba/include/mrpt/srba/impl/export_opengl_landmark_renderers.h b/libs/srba/include/mrpt/srba/impl/export_opengl_landmark_renderers.h index 8e4e2e3316..88e985a07f 100644 --- a/libs/srba/include/mrpt/srba/impl/export_opengl_landmark_renderers.h +++ b/libs/srba/include/mrpt/srba/impl/export_opengl_landmark_renderers.h @@ -97,16 +97,19 @@ template <> struct LandmarkRendererBase base_pose.composePoint(p_wrt_base,p_global); gl_lms->insertPoint(p_global.x,p_global.y,p_global.z); - - // Add text label: - mrpt::opengl::CText3DPtr gl_txt = mrpt::opengl::CText3D::Create( - mrpt::format("%u",static_cast( itLM->first)), - "mono", 0.15, - mrpt::opengl::NICE ); - gl_txt->setPose(CPose3D(p_global.x,p_global.y,p_global.z,DEG2RAD(-90),DEG2RAD(0),DEG2RAD(90))); - gl_txt->setColor( is_known ? col_known_lms : col_unknown_lms ); - - scene.insert(gl_txt); + + if( options.show_unknown_feats_ids ) + { + // Add text label: + mrpt::opengl::CText3DPtr gl_txt = mrpt::opengl::CText3D::Create( + mrpt::format("%u",static_cast( itLM->first)), + "mono", 0.15, + mrpt::opengl::NICE ); + gl_txt->setPose(CPose3D(p_global.x,p_global.y,p_global.z,DEG2RAD(-90),DEG2RAD(0),DEG2RAD(90))); + gl_txt->setColor( is_known ? col_known_lms : col_unknown_lms ); + + scene.insert(gl_txt); + } // Uncertainty ellipse? if (options.draw_unknown_feats_ellipses && lms_to_draw_inf_covs[i] )