本文整理汇总了C++中planning_scene::PlanningSceneConstPtr::getWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ PlanningSceneConstPtr::getWorld方法的具体用法?C++ PlanningSceneConstPtr::getWorld怎么用?C++ PlanningSceneConstPtr::getWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类planning_scene::PlanningSceneConstPtr
的用法示例。
在下文中一共展示了PlanningSceneConstPtr::getWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderPlanningScene
void PlanningSceneRender::renderPlanningScene(const planning_scene::PlanningSceneConstPtr &scene,
const rviz::Color &default_env_color,
const rviz::Color &default_attached_color,
OctreeVoxelRenderMode octree_voxel_rendering,
OctreeVoxelColorMode octree_color_mode,
float default_scene_alpha)
{
if (!scene)
return;
clear();
if (scene_robot_)
{
robot_state::RobotState *rs = new robot_state::RobotState(scene->getCurrentState());
rs->update();
std_msgs::ColorRGBA color;
color.r = default_attached_color.r_;
color.g = default_attached_color.g_;
color.b = default_attached_color.b_;
color.a = 1.0f;
planning_scene::ObjectColorMap color_map;
scene->getKnownObjectColors(color_map);
scene_robot_->update(robot_state::RobotStateConstPtr(rs), color, color_map);
}
const std::vector<std::string> &ids = scene->getWorld()->getObjectIds();
for (std::size_t i = 0 ; i < ids.size() ; ++i)
{
if (show_object_.find(ids[i]) != show_object_.end() && !show_object_[ids[i]])
continue;
collision_detection::CollisionWorld::ObjectConstPtr o = scene->getWorld()->getObject(ids[i]);
rviz::Color color = default_env_color;
float alpha = default_scene_alpha;
if (scene->hasObjectColor(ids[i]))
{
const std_msgs::ColorRGBA &c = scene->getObjectColor(ids[i]);
color.r_ = c.r; color.g_ = c.g; color.b_ = c.b;
alpha = c.a;
}
for (std::size_t j = 0 ; j < o->shapes_.size() ; ++j)
render_shapes_->renderShape(planning_scene_geometry_node_, o->shapes_[j].get(), o->shape_poses_[j],
octree_voxel_rendering, octree_color_mode, color, alpha);
}
}