Created
May 2, 2016 16:58
-
-
Save chapulina/ffc9bcc329672c478e8f0ec9bcc140c7 to your computer and use it in GitHub Desktop.
Display model plugins on ModelListWidget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r b3f5de12b2fa gazebo/gui/ModelListWidget.cc | |
--- a/gazebo/gui/ModelListWidget.cc Sat Apr 30 10:19:34 2016 -0700 | |
+++ b/gazebo/gui/ModelListWidget.cc Mon May 02 09:57:31 2016 -0700 | |
@@ -2540,6 +2540,22 @@ | |
this->FillPropertyTree(_msg.link(i), prop); | |
} | |
+ | |
+ for (int i = 0; i < _msg.plugin_size(); ++i) | |
+ { | |
+ QtVariantProperty *prop; | |
+ prop = this->dataPtr->variantManager->addProperty( | |
+ QtVariantPropertyManager::groupTypeId(), tr("plugin")); | |
+ prop->setToolTip(tr(_msg.plugin(i).name().c_str())); | |
+ | |
+ bItem = this->dataPtr->propTreeBrowser->addProperty(prop); | |
+ this->dataPtr->propTreeBrowser->setExpanded(bItem, false); | |
+ | |
+ gzdbg << _msg.plugin(i).DebugString() << std::endl; | |
+ | |
+ // Create FillPropertyTree(const msgs::Plugin &_msg...) | |
+ // this->FillPropertyTree(_msg.plugin(i), prop); | |
+ } | |
} | |
///////////////////////////////////////////////// | |
diff -r b3f5de12b2fa gazebo/msgs/model.proto | |
--- a/gazebo/msgs/model.proto Sat Apr 30 10:19:34 2016 -0700 | |
+++ b/gazebo/msgs/model.proto Mon May 02 09:57:31 2016 -0700 | |
@@ -7,6 +7,7 @@ | |
import "joint.proto"; | |
import "link.proto"; | |
+import "plugin.proto"; | |
import "pose.proto"; | |
import "visual.proto"; | |
import "vector3d.proto"; | |
@@ -29,4 +30,7 @@ | |
/// \brief An array of nested models. | |
repeated Model model = 12; | |
+ | |
+ /// \brief An array of nested models. | |
+ repeated Plugin plugin = 13; | |
} | |
diff -r b3f5de12b2fa gazebo/physics/Model.cc | |
--- a/gazebo/physics/Model.cc Sat Apr 30 10:19:34 2016 -0700 | |
+++ b/gazebo/physics/Model.cc Mon May 02 09:57:31 2016 -0700 | |
@@ -1116,6 +1116,18 @@ | |
{ | |
model->FillMsg(*_msg.add_model()); | |
} | |
+ | |
+ if (this->sdf->HasElement("plugin")) | |
+ { | |
+ sdf::ElementPtr pluginElem = this->sdf->GetElement("plugin"); | |
+ while (pluginElem) | |
+ { | |
+ auto pluginMsg = _msg.add_plugin(); | |
+ pluginMsg->CopyFrom(msgs::PluginFromSDF(pluginElem)); | |
+ | |
+ pluginElem = pluginElem->GetNextElement("plugin"); | |
+ } | |
+ } | |
} | |
////////////////////////////////////////////////// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment