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}")

The VisualServoing class provides core functionality for this module.

This code is licensed under the Apache 2.0 License.

class VisualServoing()
use_local
boolean
default:true

If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to True.

def run()
rgbimage
np.ndarray
required

None

Returns
np.ndarray

The predicted output.

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}")