34. AGX Control

The AGX Control module contains functionality related to controlling vehicles and machines. Please note that some of the functionality is contained in other C++ namespaces than agxControl::.

34.1. Inverse Kinematics and Inverse Dynamics

Functionality for inverse kinematics and inverse dynamics and some applications such as Computed-Torque-Control are described in the Robotics chapter. This lies in the agxModel namespace but is part of the agxControl module.

34.2. Pure Pursuit

Pure Pursuit is a geometric path tracking algorithm. Given a vehicle of some type, steering information is computed so that the vehicle should reach a target position on a path. As the vehicle moves foward, so does the target position.

The algorithm works in the following way:

  • Given the vehicle’s position relative to the path and a lookahead distance, find the target position further along the path

  • Based on curvature, compute how the vehicle should steer to land on the target position.

How well the vehicle tracks the actual path depends on the path, is it smooth or have sharp turns? The choice of lookahead value also affects the tracking. This lookahead can be a fixed value or be velocity-dependent for the vehicle.

Different kinds of vehicles have different ways to turn. The Pure Pursuit implementation is made in a generic way so that it takes two inputs which provide abstractions for the required functionality: agxControl::PurePursuit(agxControl::PurePursuit::SteeringInformation*, agxControl::PurePursuit::Path*);.

The first argument is an abstraction for the vehicle type. A specialization here can, for example, be agxControl::TrackedVehicleSteeringInformation or agxControl::CarSteeringInformation. For a tracked vehicle with 2 tracks, two velocities are computed, and the difference between left- and right track speed causes the machine to turn. For a car, one value is computed which is the steering angle.

The second argument to PurePursuit is the path representation which has an API for computing the target position. A specialization here is the agxControl::LinearSegmentPath which consists of multiple linear segments.

Note

Pure Pursuit is one possible component for vehicle motion that handles path tracking. It does not control start/stop logic or vehicle speed. For that it has to be combined with additional components or logic.

An example of how this functionality can be used can be seen in python/tutorials/tutorial_purepursuit.agxPy which also shows how to create and provide the vehicle control class with the correct coordinate system.