class_docstr: A high level game controller class.
  
  The class allows interacting with DMLab environment using high level actions,
  such as look at specific direction, move to specific coordinates etc.
class_docstr_tok: ["A","high","level","game","controller","class",".","The","class","allows","interacting","with","DMLab","environment","using","high","level","actions",",","such","as","look","at","specific","direction",",","move","to","specific","coordinates","etc","."]
docstr: Move the player to the target location.
docstr_tok: ["Move","the","player","to","the","target","location","."]
code: def move_to(self, target_x, target_y, max_steps=2000, max_speed=None):
      """Move the player to the target location."""
      pos = self.position
      target = np.array([target_x, target_y, pos[2]])
  
      if max_speed is None:
          max_speed = float("inf")
  
      direction = (target - pos)[:2]
      last_pos = np.array([float("inf"), float("inf"), float("inf")])
      target_orientation = np.degrees(
          np.arctan2(direction[1], direction[0])
      )
      self.look_at_2d(target_orientation)
  
      blocked_frames_count = 0
      for _ in six.moves.range(max_steps):
          move_action_value = 1
          pos = self.position
          direction = (target - pos)[:2]
          distance = np.linalg.norm(direction)
          speed = np.linalg.norm(self.velocity[:2])
  
          if distance < _SLOW_MOVE_DISTANCE:
              if speed > 0.0:
                  self.stop()
          elif speed > max_speed:
              move_action_value = 0
  
          if distance < _INTERNAL_POSITION_TOLERANCE:
              break
  
          if np.linalg.norm(last_pos - pos) < 0.1:
              blocked_frames_count += 1
              if blocked_frames_count > 10:
                  raise PathBlockedError(
                      "Failed to reach target. The path might be blocked."
                  )
          else:
              blocked_frames_count = 0
          last_pos = pos
  
          target_orientation = np.degrees(
              np.arctan2(direction[1], direction[0])
          )
          rotation_speed = self._rotation_speed(
              math_utils.delta_angle_degrees(
                  self.orientation[1], target_orientation
              ),
              steps=1,
          )
          actions = self._get_empty_actions()
          self._set_action_value(
              actions, _TURN_ACTION_NAME, rotation_speed
          )
          self._set_action_value(
              actions, _MOVE_ACTION_NAME, move_action_value
          )
          self._step(actions, 1)
      else:
          raise AssertionError("Failed to reach target in max steps.")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  from python.tests.utils import math_utils
label_desc: Use image node_id 4 for calling the GameController obj's underlying member method code with example usage: obj.move_to(target_x, target_y, max_steps, max_speed) without return types