Skip to content

Commit

Permalink
Add support for configuring point size in Visualize Lidar GUI plugin (#…
Browse files Browse the repository at this point in the history
…1021)

* add spinbox to configure point size

Signed-off-by: Ian Chen <[email protected]>

* cap letter

Signed-off-by: Ian Chen <[email protected]>

* remove empty line

Signed-off-by: Ian Chen <[email protected]>

Co-authored-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
iche033 and ahcorde authored Oct 6, 2021
1 parent 447e5c2 commit c603710
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/gui/plugins/visualize_lidar/VisualizeLidar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,13 @@ void VisualizeLidar::UpdateType(int _type)
this->dataPtr->lidar->SetType(this->dataPtr->visualType);
}

//////////////////////////////////////////////////
void VisualizeLidar::UpdateSize(int _size)
{
std::lock_guard<std::mutex> lock(this->dataPtr->serviceMutex);
this->dataPtr->lidar->SetSize(_size);
}

//////////////////////////////////////////////////
void VisualizeLidar::OnTopic(const QString &_topicName)
{
Expand Down
4 changes: 4 additions & 0 deletions src/gui/plugins/visualize_lidar/VisualizeLidar.hh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE
/// \param[in] _type Index of selected visual type
public: Q_INVOKABLE void UpdateType(int _type);

/// \brief Set lidar visualization size
/// \param[in] _size Size of lidar visualization
public: Q_INVOKABLE void UpdateSize(int _size);

/// \brief Get the topic list as a string
/// \return Message type
public: Q_INVOKABLE QStringList TopicList() const;
Expand Down
18 changes: 17 additions & 1 deletion src/gui/plugins/visualize_lidar/VisualizeLidar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GridLayout {
columns: 6
columnSpacing: 10
Layout.minimumWidth: 350
Layout.minimumHeight: 300
Layout.minimumHeight: 400
anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10
Expand Down Expand Up @@ -131,4 +131,20 @@ GridLayout {
VisualizeLidar.UpdateType(typeCombo.currentIndex);
}
}

Text {
Layout.columnSpan: 2
id: pointSizeText
color: "dimgrey"
text: "Point Size"
}

IgnSpinBox {
Layout.columnSpan: 2
id: pointSize
maximumValue: 1000
minimumValue: 1
value: 1
onEditingFinished: VisualizeLidar.UpdateSize(pointSize.value)
}
}

0 comments on commit c603710

Please sign in to comment.