siksal / control

Linear Quadratic Regulator (LQR) control of a ROS 2 AMR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linear Quadratic Regulator (LQR) Optimal Control of a Differential Drive Robot

The LQR control algorithm was used to generate optimal control input to send a Husarion robot to a goal pose by minimizing the state and input cost function. The desired goal was set to (x=1.0, y=1.0, theta=1.57).

Setup

  • Get the robot
mkdir -p ~/robot_ws/src
cd ~/robot_ws/src
git clone -b foxy https://github.com/husarion/rosbot_description.git
  • Get the LQR
cd ~/robot_ws/src
git clone https://github.com/siksal/control.git
  • Build the packages
cd ~/robot_ws
colcon build
source install/setup.bash

Simulation

  • Run the LQR for Rosbot
## Launch robot
ros2 launch rosbot_description rosbot_sim.launch.py

## Run LQR in another terminal/tab (remember to source the new terminal/tab)
ros2 run control lqr

Result:

lqr.mp4

About

Linear Quadratic Regulator (LQR) control of a ROS 2 AMR


Languages

Language:C++ 86.0%Language:CMake 14.0%