Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring point size in Visualize Lidar GUI plugin #1021

Merged
merged 8 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 18 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,21 @@ 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)
}

iche033 marked this conversation as resolved.
Show resolved Hide resolved
}