> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Visual Servoing 

The `VisualServoing` class provides core functionality for this module.

<ResponseField name="class VisualServoing()">
  <ResponseField name="use_local" type="boolean" default>
    If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to True.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  <ResponseField name="rgbimage" type="np.ndarray" required="True">
    None
  </ResponseField>

  <ResponseField name="Returns" type="np.ndarray">
    The predicted output.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.navigation.visualservoing import VisualServoing
  car = AirGenCar()

  # We will be capturing an image from the AirGen simulator 
  # and run model inference on it.

  img =  car.getImage("front_center", "rgb").data

  model = VisualServoing(use_local = True)
  delta_yaw, velocity = model.run(
      (100, 100),
      {
          "width": 640,
          "height": 480,
          "fov": 90,
          "camera_orientation_euler_pry": (0, 0, 0),
      },
  )
  print(f"delta_yaw: {delta_yaw}, velocity: {velocity}")
  ```
</RequestExample>

<Tabs>
  <Tab title="License">
    This code is licensed under the Apache 2.0 License.
  </Tab>

  <Tab title="Source">
    No credits provided.
  </Tab>
</Tabs>
