Skip to content

Commit

Permalink
added changes to have parent and child links for joints drop down menus
Browse files Browse the repository at this point in the history
  • Loading branch information
swhart115 committed Apr 1, 2016
1 parent 61e7f40 commit f916110
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions urdf_editor/src/joint_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,13 @@ namespace urdf_editor
type_item_ = manager_->addProperty(QtVariantPropertyManager::enumTypeId(), tr("Type"));
type_item_->setAttribute(Common::attributeStr(EnumNames), QStringList() << tr("Unknown") << tr("Revolute") << tr("Continuous") << tr("Prismatic") << tr("Floating") << tr("Planar") << tr("Fixed"));

parent_item_ = manager_->addProperty(QVariant::String, tr("Parent"));
parent_item_->setAttribute(Common::attributeStr(ReadOnly), true);
parent_item_ = manager_->addProperty(QtVariantPropertyManager::enumTypeId(), tr("Parent"));
parent_item_->setAttribute(Common::attributeStr(EnumNames), link_names_);

child_item_ = manager_->addProperty(QtVariantPropertyManager::enumTypeId(), tr("Child"));
child_item_->setAttribute(Common::attributeStr(EnumNames), link_names_);


origin = joint_->parent_to_joint_origin_transform;
p_norm = origin.position.x * origin.position.x;
p_norm += origin.position.y * origin.position.y;
Expand Down Expand Up @@ -665,10 +666,14 @@ namespace urdf_editor
loading_ = true;
name_item_->setValue(QString::fromStdString(joint_->name));
type_item_->setValue(joint_->type);
parent_item_->setValue(QString::fromStdString(joint_->parent_link_name));

parent_item_->setAttribute(Common::attributeStr(EnumNames), link_names_);
parent_item_->setValue(link_names_.indexOf(QString::fromStdString(joint_->parent_link_name)));

child_item_->setAttribute(Common::attributeStr(EnumNames), link_names_);
child_item_->setValue(link_names_.indexOf(QString::fromStdString(joint_->child_link_name)));


if (origin_property_)
origin_property_->loadData();

Expand Down Expand Up @@ -788,7 +793,7 @@ namespace urdf_editor
}
else if (name == "Parent")
{
joint_->parent_link_name = val.toString().toStdString();
joint_->parent_link_name = link_names_[val.toInt()].toStdString();
}
else if (name == "Child")
{
Expand Down

0 comments on commit f916110

Please sign in to comment.