parameters: (description)
return_statement: return perception
docstring: Create perception from description
docstring_summary: Create perception from description
docstring_tokens: Create perception from description
function: def init_perception(description):
      """
      Create perception from description
      """
      perception = PerceptionObstacle()
      perception.id = description["id"]
      perception.position.x = description["position"][0]
      perception.position.y = description["position"][1]
      perception.position.z = description["position"][2]
      perception.theta = description["theta"]
      perception.velocity.CopyFrom(get_velocity(
          description["theta"], description["speed"]))
      perception.length = description["length"]
      perception.width = description["width"]
      perception.height = description["height"]
      perception.polygon_point.extend(generate_polygon(perception.position,
                                                       perception.theta,
                                                       perception.length,
                                                       perception.width))
      perception.tracking_time = description["tracking_time"]
      perception.type = PerceptionObstacle.Type.Value(description["type"])
      perception.timestamp = cyber_time.Time.now().to_sec()
  
      return perception
function_tokens: def init_perception ( description ) : perception = PerceptionObstacle ( ) perception . id = description [ "id" ] perception . position . x = description [ "position" ] [ 0 ] perception . position . y = description [ "position" ] [ 1 ] perception . position . z = description [ "position" ] [ 2 ] perception . theta = description [ "theta" ] perception . velocity . CopyFrom ( get_velocity ( description [ "theta" ] , description [ "speed" ] ) ) perception . length = description [ "length" ] perception . width = description [ "width" ] perception . height = description [ "height" ] perception . polygon_point . extend ( generate_polygon ( perception . position , perception . theta , perception . length , perception . width ) ) perception . tracking_time = description [ "tracking_time" ] perception . type = PerceptionObstacle . Type . Value ( description [ "type" ] ) perception . timestamp = cyber_time . Time . now ( ) . to_sec ( ) return perception