Skip to content

UVA-BezzoRobotics-AMRLab/cbf_tracking

Repository files navigation

CBF Tracker: A Soft Actor-Critic-based Control Barrier Adaptation Scheme

Note: As I have just released this repository, I will continue to work to improve the installation and training pipeline processes (time permitting)!

Citation

@misc{mohammad2025softactorcriticbasedcontrolbarrier,
      title={Soft Actor-Critic-based Control Barrier Adaptation for Robust Autonomous Navigation in Unknown Environments}, 
      author={Nicholas Mohammad and Nicola Bezzo},
      year={2025},
      eprint={2503.08479},
      archivePrefix={arXiv},
      primaryClass={cs.RO},
      url={https://arxiv.org/abs/2503.08479}, 
}

Installation

Since there are several required pacakges and solvers needed to support everything in this repository, it is suggested to install with Docker as everything will be done automatically (with the exception of simulation nodes, since Gazebo is not easy to setup in Docker).

To build the image, run the following command in the top level directory of this repository:

docker build --tag=cbf_tracking .

To run the trajectory generation nodes, you will need to get a WLS Gurobi license file from the Gurobi Web License Manager. Place the gurobi.lic file in the top level directory of the repository and then execute the following command to spin up a container:

docker run --volume=$PWD/gurobi.lic:/opt/gurobi/gurobi.lic --network=host -it amr_ros_planner

Although this MPC code was designed to run with this specific planner, you can hook up your own so long as it publishes a JointTrajectory message to the /reference_trajectory topic.

Running Nodes

To run the planner, simply run the following launch file:

roslaunch cbf_tracking planner_gurobi.launch

The planner will wait until an occupancy map is provided to the /map topic and an initial start value is published to /gmapping/odometry.

To run the MPC tracker, run:

roslaunch cbf_tracking jackal_mpc_track.launch

There are 2 primary MPC implementations for the CBF that can be run. The first is track_acc_nlopt, which is the MPC used in the paper and works the best when using the CBF. The second is track_acc_ipopt, which works the best when NOT using the CBF. Although the track_acc_ipopt does also support the CBFs, IPOPT does not work super well with external SDFs so it can be a bit finicky.

There is also a trajectory tracking MPC which operates with velocity as input instead of acceleration, track_vel_ipopt, but it doesn't command as smooth of motion as track_vel_ipopt.

Training

If you are interested in training a model to adapt the CBF at runtime, the script ./train/gazebo_run.py can be used. I ran all of my training using the BARN dataset, so that will need to be installed to use the script out of the box. Alternatively, you can change the logic in run_sim() to run any launch file you wish to start up your simulations so long as it is in Gazebo.

Training:

python gazebo_run.py --train

Evaluation:

python gazebo_run.py --eval

You can also optionally use the --world_idx to pass in a world number for a specific training setup. All training parameters can be found in train.yaml.

Adjusting Parameters

There are several knobs than can be tuned for the trajectory planning process, and they can be found in planner.yaml.

About

Dynamic, Soft Actor-Critic-based Control Barrier Function Trajectory Tracker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors