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

MSA cleanup #3013

Merged
merged 2 commits into from Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions moveit_setup_assistant/src/widgets/setup_assistant_widget.cpp
Expand Up @@ -448,11 +448,9 @@ void SetupAssistantWidget::highlightGroup(const std::string& group_name)
config_data_->getRobotModel()->getJointModelGroup(group_name);
if (joint_model_group)
{
const std::vector<const moveit::core::LinkModel*>& link_models = joint_model_group->getLinkModels();
// Iterate through the links
for (std::vector<const moveit::core::LinkModel*>::const_iterator link_it = link_models.begin();
link_it < link_models.end(); ++link_it)
highlightLink((*link_it)->getName(), QColor(255, 0, 0));
for (const moveit::core::LinkModel* lm : joint_model_group->getLinkModels())
highlightLink(lm->getName(), QColor(255, 0, 0));
}
}

Expand All @@ -477,12 +475,12 @@ void SetupAssistantWidget::unhighlightAll()
}

// Iterate through the links
for (std::vector<std::string>::const_iterator link_it = links.begin(); link_it < links.end(); ++link_it)
for (const std::string& link : links)
{
if ((*link_it).empty())
if (link.empty())
continue;

robot_state_display_->unsetLinkColor(*link_it);
robot_state_display_->unsetLinkColor(link);
}
}

Expand Down
12 changes: 4 additions & 8 deletions moveit_setup_assistant/src/widgets/start_screen_widget.cpp
Expand Up @@ -395,7 +395,7 @@ bool StartScreenWidget::loadExistingFiles()
QApplication::processEvents();

// Load the SRDF
if (!loadSRDFFile(config_data_->srdf_path_))
if (!loadSRDFFile(config_data_->srdf_path_, config_data_->xacro_args_))
return false; // error occured

// Progress Indicator
Expand Down Expand Up @@ -546,9 +546,7 @@ bool StartScreenWidget::loadNewFiles()
// ******************************************************************************************
bool StartScreenWidget::loadURDFFile(const std::string& urdf_file_path, const std::string& xacro_args)
{
const std::vector<std::string> vec_xacro_args = { xacro_args };

if (!rdf_loader::RDFLoader::loadXmlFileToString(config_data_->urdf_string_, urdf_file_path, vec_xacro_args))
if (!rdf_loader::RDFLoader::loadXmlFileToString(config_data_->urdf_string_, urdf_file_path, { xacro_args }))
{
QMessageBox::warning(this, "Error Loading Files",
QString("URDF/COLLADA file not found: ").append(urdf_file_path.c_str()));
Expand Down Expand Up @@ -592,12 +590,10 @@ bool StartScreenWidget::loadURDFFile(const std::string& urdf_file_path, const st
// ******************************************************************************************
// Load SRDF File to Parameter Server
// ******************************************************************************************
bool StartScreenWidget::loadSRDFFile(const std::string& srdf_file_path)
bool StartScreenWidget::loadSRDFFile(const std::string& srdf_file_path, const std::string& xacro_args)
{
const std::vector<std::string> xacro_args;

std::string srdf_string;
if (!rdf_loader::RDFLoader::loadXmlFileToString(srdf_string, srdf_file_path, xacro_args))
if (!rdf_loader::RDFLoader::loadXmlFileToString(srdf_string, srdf_file_path, { xacro_args }))
{
QMessageBox::warning(this, "Error Loading Files", QString("SRDF file not found: ").append(srdf_file_path.c_str()));
return false;
Expand Down
2 changes: 1 addition & 1 deletion moveit_setup_assistant/src/widgets/start_screen_widget.h
Expand Up @@ -146,7 +146,7 @@ private Q_SLOTS:
bool loadURDFFile(const std::string& urdf_file_path, const std::string& xacro_args);

/// Load SRDF File
bool loadSRDFFile(const std::string& srdf_file_path);
bool loadSRDFFile(const std::string& srdf_file_path, const std::string& xacro_args);

/// Put SRDF File on Parameter Server
bool setSRDFFile(const std::string& srdf_string);
Expand Down