Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpc

Model-predictive path-tracking controller for differential-drive ground robots, as a ROS 2 (Humble) Python package.

The node subscribes to a waypoint path and the robot's pose, solves a short-horizon MPC problem with do-mpc, and publishes geometry_msgs/Twist velocity commands. It is the ground-robot controller used by MIGHTY.

Installation

Normally you don't install this directly — MIGHTY pulls it in via mighty.repos:

vcs import src < src/mighty/mighty.repos
colcon build --packages-select mpc

Standalone:

cd ~/your_ws/src
git clone https://github.com/kotakondo/mpc.git
cd .. && colcon build --packages-select mpc

Requires do-mpc (pip install do-mpc) plus rclpy, tf2_ros, nav_msgs, geometry_msgs, sensor_msgs, message_filters, and dynus_interfaces.

Usage

ros2 launch mpc mpc.launch.py

MIGHTY launches it automatically for ground robots — see onboard_mighty.launch.py, which selects config/mpc_sim.yaml in simulation and config/mpc.yaml on hardware.

Configuration

Parameter Meaning
path_topic, cmd_vel_topic input path and output velocity topics
tracking_frame, base_frame TF frames used for pose lookup
use_tf_pose take pose from TF instead of a pose topic
control_rate_hz, dt controller rate and MPC step
v_min, v_max, w_max linear and angular velocity limits
max_linear_accel linear acceleration limit
goal_tolerance distance at which the goal counts as reached

Acknowledgments

The MPC controller was originally developed by Lucas Jia (@lucas-yyy000).

License

BSD 3-Clause — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages