parameters: (self, target)
return_statement: return places
docstring: Generate places (place locations), based on
          https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
          baxter_pick_place/src/block_pick_place.cpp
docstring_summary: Generate places (place locations), based on
          https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
          baxter_pick_place/src/block_pick_place.cpp
docstring_tokens: Generate places ( place locations ) based on https : // github . com / davetcoleman / baxter_cpp / blob / hydro - devel / baxter_pick_place / src / block_pick_place . cpp
function: def _generate_places(self, target):
          """
          Generate places (place locations), based on
          https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
          baxter_pick_place/src/block_pick_place.cpp
          """
  
          # Generate places:
          places = []
          now = rospy.Time.now()
          for angle in numpy.arange(0.0, numpy.deg2rad(360.0), numpy.deg2rad(1.0)):
              # Create place location:
              place = PlaceLocation()
  
              place.place_pose.header.stamp = now
              place.place_pose.header.frame_id = self._robot.get_planning_frame()
  
              # Set target position:
              place.place_pose.pose = copy.deepcopy(target)
  
              # Generate orientation (wrt Z axis):
              q = quaternion_from_euler(0.0, 0.0, angle )
              place.place_pose.pose.orientation = Quaternion(*q)
  
              # Generate pre place approach:
              place.pre_place_approach.desired_distance = self._approach_retreat_desired_dist
              place.pre_place_approach.min_distance = self._approach_retreat_min_dist
  
              place.pre_place_approach.direction.header.stamp = now
              place.pre_place_approach.direction.header.frame_id = self._robot.get_planning_frame()
  
              place.pre_place_approach.direction.vector.x =  0
              place.pre_place_approach.direction.vector.y =  0
              place.pre_place_approach.direction.vector.z = 0.2
  
              # Generate post place approach:
              place.post_place_retreat.direction.header.stamp = now
              place.post_place_retreat.direction.header.frame_id = self._robot.get_planning_frame()
  
              place.post_place_retreat.desired_distance = self._approach_retreat_desired_dist
              place.post_place_retreat.min_distance = self._approach_retreat_min_dist
  
              place.post_place_retreat.direction.vector.x = 0
              place.post_place_retreat.direction.vector.y = 0
              place.post_place_retreat.direction.vector.z = 0.2
  
              # Add place:
              places.append(place)
  
          # Publish places (for debugging/visualization purposes):
          self._publish_places(places)
  
          return places
function_tokens: def _generate_places ( self , target ) : # Generate places: places = [ ] now = rospy . Time . now ( ) for angle in numpy . arange ( 0.0 , numpy . deg2rad ( 360.0 ) , numpy . deg2rad ( 1.0 ) ) : # Create place location: place = PlaceLocation ( ) place . place_pose . header . stamp = now place . place_pose . header . frame_id = self . _robot . get_planning_frame ( ) # Set target position: place . place_pose . pose = copy . deepcopy ( target ) # Generate orientation (wrt Z axis): q = quaternion_from_euler ( 0.0 , 0.0 , angle ) place . place_pose . pose . orientation = Quaternion ( * q ) # Generate pre place approach: place . pre_place_approach . desired_distance = self . _approach_retreat_desired_dist place . pre_place_approach . min_distance = self . _approach_retreat_min_dist place . pre_place_approach . direction . header . stamp = now place . pre_place_approach . direction . header . frame_id = self . _robot . get_planning_frame ( ) place . pre_place_approach . direction . vector . x = 0 place . pre_place_approach . direction . vector . y = 0 place . pre_place_approach . direction . vector . z = 0.2 # Generate post place approach: place . post_place_retreat . direction . header . stamp = now place . post_place_retreat . direction . header . frame_id = self . _robot . get_planning_frame ( ) place . post_place_retreat . desired_distance = self . _approach_retreat_desired_dist place . post_place_retreat . min_distance = self . _approach_retreat_min_dist place . post_place_retreat . direction . vector . x = 0 place . post_place_retreat . direction . vector . y = 0 place . post_place_retreat . direction . vector . z = 0.2 # Add place: places . append ( place ) # Publish places (for debugging/visualization purposes): self . _publish_places ( places ) return places