Skip to content

Commit

Permalink
Don't allow world as child link
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <[email protected]>
  • Loading branch information
Nate Koenig committed Dec 8, 2021
1 parent 1b3798f commit b5f3778
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ void ComponentInspectorEditor::Update(const UpdateInfo &_info,

// Get available links for the model.
this->dataPtr->modelLinks.clear();
this->dataPtr->modelLinks.append("world");
_ecm.EachNoCache<
components::Name,
components::Link,
Expand Down Expand Up @@ -1327,7 +1326,15 @@ void ComponentInspectorEditor::SetModelLinks(const QStringList &_modelLinks)
}

/////////////////////////////////////////////////
QStringList ComponentInspectorEditor::ModelLinks() const
QStringList ComponentInspectorEditor::ModelParentLinks() const
{
QStringList result = this->dataPtr->modelLinks;
result.append("world");
return result;
}

/////////////////////////////////////////////////
QStringList ComponentInspectorEditor::ModelChildLinks() const
{
return this->dataPtr->modelLinks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,15 @@ namespace gazebo

/// \brief Type
Q_PROPERTY(
QStringList modelLinks
READ ModelLinks
WRITE SetModelLinks
QStringList modelParentLinks
READ ModelParentLinks
NOTIFY ModelLinksChanged
)

/// \brief Type
Q_PROPERTY(
QStringList modelChildLinks
READ ModelChildLinks
NOTIFY ModelLinksChanged
)

Expand Down Expand Up @@ -392,9 +398,15 @@ namespace gazebo
const QString &_parentLink,
const QString &_childLink);

/// \brief Return the list of availabe links if a model is selected.
/// \brief Return the list of availabe links that are suitable for
/// parent links in joints if a model is selected.
/// \return List of available links.
public: Q_INVOKABLE QStringList ModelParentLinks() const;

/// \brief Return the list of availabe links that are suitable for
/// child links in joints if a model is selected.
/// \return List of available links.
public: Q_INVOKABLE QStringList ModelLinks() const;
public: Q_INVOKABLE QStringList ModelChildLinks() const;

/// \brief Set the list of availabe links when a model is selected.
/// \param[in] _modelLinks List of available links.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Rectangle {
}
ComboBox {
id: parentBox
model: ComponentInspectorEditor.modelLinks
model: ComponentInspectorEditor.modelParentLinks
currentIndex: 0
}
Text {
Expand All @@ -214,7 +214,7 @@ Rectangle {
}
ComboBox {
id: childBox
model: ComponentInspectorEditor.modelLinks
model: ComponentInspectorEditor.modelChildLinks
currentIndex: 1
}
}
Expand Down

0 comments on commit b5f3778

Please sign in to comment.