Skip to content
Merged
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
6 changes: 6 additions & 0 deletions rviz_plugin_tutorials/src/plant_flag_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ int PlantFlagTool::processMouseEvent( rviz::ViewportMouseEvent& event )
// This is a helper function to create a new flag in the Ogre scene and save its scene node in a list.
void PlantFlagTool::makeFlag( const Ogre::Vector3& position )
{
if( rviz::loadMeshFromResource( flag_resource_ ).isNull() )
{
ROS_ERROR( "PlantFlagTool: failed to load model resource '%s'.", flag_resource_.c_str() );
return;
}

Ogre::SceneNode* node = scene_manager_->getRootSceneNode()->createChildSceneNode();
Ogre::Entity* entity = scene_manager_->createEntity( flag_resource_ );
node->attachObject( entity );
Expand Down