Skip to content

Commit

Permalink
Restore names in rviz plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cambel committed Jan 11, 2024
1 parent b9119f6 commit 8ea26d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void PlanningSceneDisplay::renderPlanningScene()
{
ROS_ERROR("Caught %s while rendering planning scene", ex.what());
}
planning_scene_render_->getVisualGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getCollisionGeometryNode()->setVisible(scene_geometry_collision_enabled_property_->getBool());
}

Expand Down Expand Up @@ -467,7 +467,7 @@ void PlanningSceneDisplay::changedSceneGeometryVisualEnabled()
if (planning_scene_render_)
{
// TODO (felixvd): setVisualVisible only seems to do the same thing again? Why does this split exist?
planning_scene_render_->getVisualGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->setVisualVisible(scene_geometry_visual_enabled_property_->getBool());
}
}
Expand Down Expand Up @@ -605,7 +605,7 @@ void PlanningSceneDisplay::onRobotModelLoaded()
{
changedPlanningSceneTopic();
planning_scene_render_ = std::make_shared<PlanningSceneRender>(planning_scene_node_, context_, planning_scene_robot_);
planning_scene_render_->getVisualGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getCollisionGeometryNode()->setVisible(scene_geometry_collision_enabled_property_->getBool());
planning_scene_render_->setVisualVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->setCollisionVisible(scene_geometry_collision_enabled_property_->getBool());
Expand Down Expand Up @@ -667,7 +667,7 @@ void PlanningSceneDisplay::onEnable()
}
if (planning_scene_render_)
{
planning_scene_render_->getVisualGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getGeometryNode()->setVisible(scene_geometry_visual_enabled_property_->getBool());
planning_scene_render_->getCollisionGeometryNode()->setVisible(
scene_geometry_collision_enabled_property_->getBool());
planning_scene_render_->setVisualVisible(scene_geometry_visual_enabled_property_->getBool());
Expand All @@ -688,7 +688,7 @@ void PlanningSceneDisplay::onDisable()
planning_scene_monitor_->stopSceneMonitor();
if (planning_scene_render_)
{
planning_scene_render_->getVisualGeometryNode()->setVisible(false);
planning_scene_render_->getGeometryNode()->setVisible(false);
planning_scene_render_->getCollisionGeometryNode()->setVisible(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class PlanningSceneRender
const RobotStateVisualizationPtr& robot);
~PlanningSceneRender();

Ogre::SceneNode* getVisualGeometryNode()
Ogre::SceneNode* getGeometryNode()
{
return planning_scene_visual_geometry_node_;
return planning_scene_geometry_node_;
}

Ogre::SceneNode* getCollisionGeometryNode()
Expand Down Expand Up @@ -103,7 +103,7 @@ class PlanningSceneRender
void clear();

private:
Ogre::SceneNode* planning_scene_visual_geometry_node_; // Displays the visual geometry of collision objects
Ogre::SceneNode* planning_scene_geometry_node_; // Displays the visual geometry of collision objects
Ogre::SceneNode* planning_scene_collision_geometry_node_; // Displays the collision geometry of collision objects
rviz::DisplayContext* context_;
RenderShapesPtr render_shapes_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace moveit_rviz_plugin
{
PlanningSceneRender::PlanningSceneRender(Ogre::SceneNode* node, rviz::DisplayContext* context,
const RobotStateVisualizationPtr& robot)
: planning_scene_visual_geometry_node_(node->createChildSceneNode())
: planning_scene_geometry_node_(node->createChildSceneNode())
, planning_scene_collision_geometry_node_(node->createChildSceneNode())
, context_(context)
, scene_robot_(robot)
Expand All @@ -56,7 +56,7 @@ PlanningSceneRender::PlanningSceneRender(Ogre::SceneNode* node, rviz::DisplayCon

PlanningSceneRender::~PlanningSceneRender()
{
context_->getSceneManager()->destroySceneNode(planning_scene_visual_geometry_node_);
context_->getSceneManager()->destroySceneNode(planning_scene_geometry_node_);
context_->getSceneManager()->destroySceneNode(planning_scene_collision_geometry_node_);
}

Expand All @@ -78,7 +78,7 @@ void PlanningSceneRender::clear()
void PlanningSceneRender::setVisualVisible(const bool& visible)
{
visual_visible_ = visible;
planning_scene_visual_geometry_node_->setVisible(visual_visible_);
planning_scene_geometry_node_->setVisible(visual_visible_);
}

void PlanningSceneRender::setCollisionVisible(const bool& visible)
Expand Down Expand Up @@ -139,15 +139,15 @@ void PlanningSceneRender::renderPlanningScene(const planning_scene::PlanningScen
const auto& mesh = shapes::createMeshFromResource(object->visual_geometry_mesh_url_,
Eigen::Vector3d(mesh_scaling_factor_, mesh_scaling_factor_,
mesh_scaling_factor_));
render_shapes_->renderShape(planning_scene_visual_geometry_node_, mesh,
render_shapes_->renderShape(planning_scene_geometry_node_, mesh,
object->pose_ * object->visual_geometry_pose_, octree_voxel_rendering,
octree_color_mode, color, alpha);
}
else // Draw collision geometry as visual if no visual geometry was defined
{
for (std::size_t j = 0; j < object->shapes_.size(); ++j)
{
render_shapes_->renderShape(planning_scene_visual_geometry_node_, object->shapes_[j].get(),
render_shapes_->renderShape(planning_scene_geometry_node_, object->shapes_[j].get(),
scene->getWorld()->getGlobalShapeTransform(id, j), octree_voxel_rendering,
octree_color_mode, color, alpha);
}
Expand Down

0 comments on commit 8ea26d9

Please sign in to comment.