Пример #1
0
void
insula::overlay::object::render(
	scene::render_pass::object const &)
{
	sge::renderer::state::scoped scoped_state(
		renderer_,
		sge::renderer::state::list
			// We don't care about culling
		 	(sge::renderer::state::cull_mode::off)
			// ...and depth stuff, too
		 	(sge::renderer::state::depth_func::off));

	graphics::shader::scoped scoped_shader_(
		quad_shader_);

	sge::renderer::scoped_vertex_buffer const scoped_vb_(
		renderer_,
		vb_);

	renderer_->render(
		sge::renderer::first_vertex(
			0),
		sge::renderer::vertex_count(
			vb_->size()),
		sge::renderer::nonindexed_primitive_type::triangle);
}
void OmplRosIKSampleableRegion::sampleGoals(const unsigned int &number_goals,
                                            std::vector<arm_navigation_msgs::RobotState> &sampled_states_vector) const
{
  arm_navigation_msgs::RobotState seed_state,solution_state;
  seed_state = seed_state_;
  solution_state = solution_state_; 
  ompl::base::ScopedState<ompl::base::CompoundStateSpace> scoped_state(state_space_);
  unsigned int ik_poses_counter = 0;
  for(unsigned int i=0; i < number_goals; i++)
  {    
    //sample a state at random
    scoped_state.random();
    ompl_ros_interface::omplStateToRobotState(scoped_state,
                                              ompl_state_to_robot_state_mapping_,
                                              seed_state);    
    int error_code;
    if(kinematics_solver_->getPositionIK(ik_poses_[ik_poses_counter].pose,
                                         seed_state.joint_state.position,
                                         solution_state.joint_state.position,
					 error_code))
    {
      sampled_states_vector.push_back(solution_state);
      ik_poses_counter++;
      ik_poses_counter = ik_poses_counter%ik_poses_.size();
    }
  }
}