Skip to content

Commit e4e7d77

Browse files
authored
Merge pull request #65 from naturerobots/fix/custom-cost-limits
Fix: custom limit float properties were not shown
2 parents ac5bc51 + afcae4d commit e4e7d77

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

rviz_mesh_tools_plugins/src/MeshDisplay.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787

8888
using namespace std::chrono_literals;
8989
using std::placeholders::_1;
90-
using std::placeholders::_2;
9190

9291
namespace {
9392
constexpr struct {
@@ -176,6 +175,13 @@ MeshDisplay::MeshDisplay()
176175

177176
// Vertex Costs
178177
{
178+
m_selectVertexCostMap = new rviz_common::properties::EnumProperty("Vertex Costs Type", "-- None --",
179+
"Select the type of vertex cost map to be displayed. New types "
180+
"will appear here when a new message arrives.",
181+
m_displayType, SLOT(updateVertexCosts()), this);
182+
183+
m_selectVertexCostMap->addOption("-- None --", 0);
184+
179185
m_costColorType = new rviz_common::properties::EnumProperty("Color Scale", "Rainbow",
180186
"Select color scale for vertex costs. Mesh will update when new data "
181187
"arrives.",
@@ -210,14 +216,11 @@ MeshDisplay::MeshDisplay()
210216
1 // Min value: This is 1 since we want at least one update per second
211217
);
212218

213-
m_selectVertexCostMap = new rviz_common::properties::EnumProperty("Vertex Costs Type", "-- None --",
214-
"Select the type of vertex cost map to be displayed. New types "
215-
"will appear here when a new message arrives.",
216-
m_displayType, SLOT(updateVertexCosts()), this);
217-
m_selectVertexCostMap->addOption("-- None --", 0);
218-
219219
m_costUseCustomLimits = new rviz_common::properties::BoolProperty("Use Custom limits", false, "Use custom vertex cost limits",
220220
m_displayType, SLOT(updateVertexCosts()), this);
221+
// Only allow editing of the limits when custom limits are active
222+
m_costUseCustomLimits->setDisableChildrenIfFalse(true);
223+
221224

222225
// custom cost limits
223226
{
@@ -692,11 +695,8 @@ void MeshDisplay::updateDisplayType()
692695
m_vertexCostsRefreshRate->show();
693696
m_selectVertexCostMap->show();
694697
m_costUseCustomLimits->show();
695-
if (m_costUseCustomLimits->getBool())
696-
{
697-
m_costLowerLimit->show();
698-
m_costUpperLimit->show();
699-
}
698+
m_costLowerLimit->show();
699+
m_costUpperLimit->show();
700700
break;
701701
}
702702

0 commit comments

Comments
 (0)