48 const RobotStateVisualizationPtr& robot)
49 : planning_scene_geometry_node_(node->createChildSceneNode()), context_(context), scene_robot_(robot)
51 render_shapes_ = std::make_shared<RenderShapes>(context);
75 const Ogre::ColourValue& default_env_color,
76 const Ogre::ColourValue& default_attached_color,
90 std_msgs::msg::ColorRGBA color;
91 color.r = default_attached_color.r;
92 color.g = default_attached_color.g;
93 color.b = default_attached_color.b;
94 color.a = default_attached_color.a;
96 scene->getKnownObjectColors(color_map);
97 scene_robot_->update(moveit::core::RobotStateConstPtr(rs), color, color_map);
100 const std::vector<std::string>& ids = scene->getWorld()->getObjectIds();
101 for (
const std::string&
id : ids)
104 Ogre::ColourValue color = default_env_color;
105 double alpha = default_scene_alpha;
106 if (scene->hasObjectColor(
id))
108 const std_msgs::msg::ColorRGBA& c = scene->getObjectColor(
id);
115 for (std::size_t j = 0; j <
object->shapes_.size(); ++j)
117 render_shapes_->renderShape(planning_scene_geometry_node_, object->shapes_[j].get(),
118 object->global_shape_poses_[j], octree_voxel_rendering, octree_color_mode, color,
void renderPlanningScene(const planning_scene::PlanningSceneConstPtr &scene, const Ogre::ColourValue &default_scene_color, const Ogre::ColourValue &default_attached_color, OctreeVoxelRenderMode voxel_render_mode, OctreeVoxelColorMode voxel_color_mode, double default_scene_alpha)
std::map< std::string, std_msgs::msg::ColorRGBA > ObjectColorMap
A map from object names (e.g., attached bodies, collision objects) to their colors.