Skip to content
Mehul Goel edited this page Apr 9, 2025 · 17 revisions

Controller

Our current controller is based off of the Stanley Controller. An in-depth explanation of the controller can also be found later in this file.

Inputs

At a high level, the controller takes in two different inputs:

  • The state of the buggy at hand, which should include the position in easting, northing, the speed of the buggy, the heading of the buggy, and how the heading rate. These will henceforth be references as $(p_x, p_y, v, \psi, \dot{\psi})$. This should be inputted at 100Hz
  • The trajectory that should be followed. This comes from the path planner, and is a new path generated at 10Hz

Outputs

There is one non-debug output topic from the system, which is the steering command, capped between $-20^\circ, 20^\circ$. It will be later called $\delta$ within documents

Parameters

  1. dist - A parameter which is the initial guess to where we are on the path, is not that important as after the first iteration of the loop, we find a more accurate index
  2. controllerName - tells the ROS node what the name of the node is, i.e. SC_controller, SC_NAND_controller, NAND_controller
  3. traj_name - the name of the initial path we will be following
  4. stateTopic - the ROS topic name of the buggy state input.
  5. trajectoryTopic - the ROS topic name of the trajectory input
  6. controller - which controller we are using, as of right now the only option is Stanley.
  7. useHeadingRate - a boolean flag that if set to false, means that we don't need the input $\dot{\psi}$, and will be further explained in the stanley controller section.

Initialization Check

Before we allow the controller to publish steering outputs, we wait for the init checks. Below is a list of all the possible init checks:

  • Has the controller ever received an odom input
  • Is the covariance of the system relatively small ($<1m^2$), in relation to the easting and northing position
  • Compared to the closest position on the path, are we faced the right direction. This is if the offset between both is in between $[-\pi, \pi]$

Stanley Controller

Clone this wiki locally