Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/rviz/default_plugin/robot_model_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void RobotModelDisplay::clear()
void RobotModelDisplay::reset()
{
Display::reset();
load();
has_new_transforms_ = true;
}

Expand Down
18 changes: 16 additions & 2 deletions src/rviz/mesh_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,22 @@ void loadMaterials(const std::string& resource_path,
{
std::stringstream ss;
ss << resource_path << "Material" << i;
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(
ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
Ogre::MaterialPtr mat;
try
{
mat = Ogre::MaterialManager::getSingleton().create(
ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
}
catch (Ogre::ItemIdentityException& e)
{
// this is already loaded in the scene through a different code path, so we reuse it
// happens when the same robot description is loaded again.
// e.g., RobotDisplay showing RobotA, RobotB, and RobotA again.
mat = Ogre::MaterialManager::getSingleton().getByName(ss.str());
material_table_out.push_back(mat);
continue;
}

material_table_out.push_back(mat);

Ogre::Technique* tech = mat->getTechnique(0);
Expand Down
1 change: 1 addition & 0 deletions src/rviz/visualization_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ VisualizationFrame::VisualizationFrame(QWidget* parent)
reset_button->setContentsMargins(0, 0, 0, 0);
statusBar()->addPermanentWidget(reset_button, 0);
connect(reset_button, &QToolButton::clicked, this, &VisualizationFrame::VisualizationFrame::reset);
reset_button->setShortcut(QKeySequence(QString("Ctrl+Shift+R")));

status_label_ = new QLabel("");
statusBar()->addPermanentWidget(status_label_, 1);
Expand Down
Loading