// ****************************************************************************************** // Called from Double List widget to highlight joints // ****************************************************************************************** void ROSControllersWidget::previewSelectedJoints(std::vector<std::string> joints) { // Unhighlight all links Q_EMIT unhighlightAll(); for (const std::string& joint : joints) { const robot_model::JointModel* joint_model = config_data_->getRobotModel()->getJointModel(joint); // Check that a joint model was found if (!joint_model) { continue; } // Get the name of the link const std::string link = joint_model->getChildLinkModel()->getName(); if (link.empty()) { continue; } // Highlight link Q_EMIT highlightLink(link, QColor(255, 0, 0)); } }
// ****************************************************************************************** // Called from Double List widget to highlight joints // ****************************************************************************************** void PassiveJointsWidget::previewSelectedJoints( std::vector<std::string> joints ) { // Unhighlight all links Q_EMIT unhighlightAll(); for(int i = 0; i < joints.size(); ++i) { const robot_model::JointModel *joint_model = config_data_->getRobotModel()->getJointModel( joints[i] ); // Check that a joint model was found if( !joint_model ) { continue; } // Get the name of the link const std::string link = joint_model->getChildLinkModel()->getName(); if( link.empty() ) { continue; } // Highlight link Q_EMIT highlightLink( link ); } }
// ****************************************************************************************** // Called from Double List widget to highlight a group // ****************************************************************************************** void ROSControllersWidget::previewSelectedGroup(std::vector<std::string> groups) { // Unhighlight all links Q_EMIT unhighlightAll(); for (const std::string& group : groups) { // Highlight group Q_EMIT highlightGroup(group); } }
// ****************************************************************************************** // Preview whatever element is selected // ****************************************************************************************** void DefaultCollisionsWidget::previewClicked( int row, int column ) { // Get list of all selected items QList<QTableWidgetItem*> selected = collision_table_->selectedItems(); // Check that an element was selected if( !selected.size() ) return; // Unhighlight all links Q_EMIT unhighlightAll(); // Highlight link Q_EMIT highlightLink( selected[0]->text().toStdString() ); Q_EMIT highlightLink( selected[1]->text().toStdString() ); }
// ****************************************************************************************** // Highlight the currently selected link // ****************************************************************************************** void KinematicChainWidget::itemSelected() { QTreeWidgetItem* item = link_tree_->currentItem(); if (item != nullptr) { Q_EMIT unhighlightAll(); std::string name = item->text(0).toStdString(); // Don't try to highlight empty links! if (name.empty()) return; // Check that item is not empty Q_EMIT highlightLink(item->text(0).toStdString(), QColor(255, 0, 0)); } }
// ****************************************************************************************** // Preview whatever element is selected // ****************************************************************************************** void EndEffectorsWidget::previewClicked( int row, int column ) { // Get list of all selected items QList<QTableWidgetItem*> selected = data_table_->selectedItems(); // Check that an element was selected if( !selected.size() ) return; // Find the selected in datastructure srdf::Model::EndEffector *effector = findEffectorByName( selected[0]->text().toStdString() ); // Unhighlight all links Q_EMIT unhighlightAll(); // Highlight group Q_EMIT highlightGroup( effector->component_group_ ); }