def render(env, pos, mode='rgb'):
  """
  pos = (x, y, z, yaw) in coord
  mode could be rgb, depth, etc
  Return img of size (h, w, c).
  """
  env.cam.pos.x = pos[0]
  env.cam.pos.y = pos[1]
  env.cam.pos.z = pos[2]
  env.cam.yaw = pos[3]
  env.cam.updateDirection()
  img = env.render(mode=mode)
  return img