Skip to content

About

Duckietown Fall 2025 Final Project - Control

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Duckietown Fall 2025 - Final Project - Control

We aim to do map-free lane following in this project. We change the existing Duckietown lane following stack by introducing trajectory generation and a pure pursuit controller.

To test the code, first clone the project GitHub repository.

git clone git@github.com:kumaradityag/fp-control

These instructions assume you have the following:

  • A duckietown-shell. You can verify that you have sucessfully installed it using dts --version. If that’s not the case, please follow the instructions here
  • You have created your virtual duckiebot. You can verify that your virtual duckie exists with the command dts duckiebot virtual start vbot and then dts fleet discover. vbot is the name of our virtual duckie, but feel free to replace it with your own virtual duckie name
  • You have your real life duckiebot setup. This step is only required if you want to test the demo in real life. If you want to get your duckie hardware, see the official documentation here

Understanding the project architecture

The most important directories of our projects are packages/trajectory_planner and packages/pure_pursuit_control, which are where our trajectory generation code and our pure pursuit code live.

Virtual and physical duckiebot can behave slightly differently because of real-world physics, so they respond to the same parameters differently. Additionally, in our current setup, driving in the inner or outter lane also require different parameters. Therefore, you will probably need to tune your parameters for your own duckiebot.

The configs for the trajectory planner and the pure pursuit controller can be found respectively inside packages/trajectory_planner/config/trajectory_planner_node/default.yaml and packages/pure_pursuit_control/config/pure_pursuit_control_node/default.yaml. Additional config information is present at the bottom.

Setup

You will need at least three terminals to spin and view everything needed. Replace <duckie_name> with your duckiebot name.

Preliminaries (in every terminal):

# Set robot name
export ROBOT_NAME=<duckie_name>

Preliminaries for the matrix (if needed):

dts matrix run --standalone --map ./assets/duckiematrix/map/loop/
dts matrix attach $ROBOT_NAME map_0/vehicle_0

All these other commands need to run from the project repository:

In terminal 1:

dts devel build -H $ROBOT_NAME -f

In terminal 2:

# To view the debug images
dts duckiebot image_viewer $ROBOT_NAME

In terminal 3:

# For emergency stop
dts duckiebot keyboard_control $ROBOT_NAME

In terminal 4:

# If you want to manually change some of the param values
ssh duckie@<duckie_name>.local
# After logging into your duckiebot:
docker exec -it ros-interface bash
rosparam list | grep <param_search_query>
rosparam set <param_name> <value>

Run the carrot approach

In terminal 1:

# For physical duckie
dts devel run -H $ROBOT_NAME -L lane-following-carrot-physical-outer
dts devel run -H $ROBOT_NAME -L lane-following-carrot-physical-inner

# For virtual duckie
dts devel run -H $ROBOT_NAME -L lane-following-carrot-virtual-outer
dts devel run -H $ROBOT_NAME -L lane-following-carrot-virtual-inner

Run the tangent approach

# For physical duckie
dts devel run -H $ROBOT_NAME -L lane-following-tangent-physical-outer
dts devel run -H $ROBOT_NAME -L lane-following-tangent-physical-inner

# For virtual duckie
dts devel run -H $ROBOT_NAME -L lane-following-tangent-virtual-outer
dts devel run -H $ROBOT_NAME -L lane-following-tangent-virtual-inner

Config Descriptions

The trajectory planner node has the following config parameters:

  • min_forward: minimum distance at which we consider trajectory points
  • max_forward: maximum distance at which we consider trajectory points
  • n_samples: number of samples used for ransac
  • lane_width: width of the lane in meters
  • epsilon: error around lane width
  • yellow_pts_threshold: minimum points in the trajectory for the yellow lane to be valid
  • white_pts_threshold: minimum points in the trajectory for the white lane to be valid
  • default_mode: relying on WHITE/YELLOW lane
  • ransac_max_iterations: number of iterations for ransac to compute inliers
  • ransac_distance_threshold: max error to separate inliers from outliers (in m)
  • poly_degree: polynomial degree for ransac
  • buffer_size: number of previous trajectory saved in buffer
  • buffer_smooth_alpha: float number between 0-1 used to smooth out current trajectory based on the previous one
  • buffer_theta_threshold: theta angle threshold for heading change in degrees

The pure pursuit control node has the following config parameters:

  • lookahead_distance: distance at which the pure pursuit controller look ahead (in cm)
  • v_bar: linear velocity
  • v_bar_max: maximal linear velocity
  • v_bar_min: minimal linear velocity
  • width: chassis width of the duckie. Should stay 0.1
  • omega_factor: how hard we want the duckie to turn

About

Duckietown Fall 2025 Final Project - Control

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages