Giter VIP home page Giter VIP logo

mpc_tracker_ros's Introduction

mpc_tracker_ros

Motion Controller for trajectory tracking Using Nonlinear Model Predictive Control (MPC) with C/GMRES Method.

Control target: two-wheel differential drive mobile robot

Outputted control input: twist.x and twist.yaw

Requirements

  • Ubuntu 18.04 or 20.04
  • gcc 7.50 or higher
  • cmake 3.0.2 or higher
  • ROS Melodic or Noetic

Third Party

Pre-Installation

sudo apt update

sudo apt install libeigen3-dev

sudo apt install -y python-catkin-pkg python-rosdep ros-$ROS_DISTRO-catkin

sudo apt install -y python3-colcon-common-extensions

sudo apt install python3-matplotlib, python3-numpy

How to Build

mkdir ~catkin_ws/src -p

cd catkin_ws/src

git clone [email protected]:kohonda/mpc_tracker_ros.git

cd ..

rosdep update

rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release 

How to test by offline simulation

cd catkin_ws/src

./mpc_tracker_ros/scripts/offline_simulation.sh

Then, start simulation with real-time plot and get the simulation result at mpc_tracker_ros/simulation/simulation_result/result.csv after termination.

offline_simulation_movie_sinwave

How to launch ROS node

cd catkin_ws

source install/setup.bash

roslaunch mpc_tracker mpc_tracker.launch

I/O

Node [/mpc_tracker]
Publications: 
 * /twist_cmd [geometry_msgs/Twist] : calculated control input (twist.yaw, twist.x)
 * /mpc_tracker/F_norm [std_msgs/Float32] : Deviation from KKT conditions
 * /mpc_tracker/calculation_time [std_msgs/Float32]
 * /mpc_tracker/cmd_twist_x [std_msgs/Float32] : for visualization
 * /mpc_tracker/cmd_twist_yaw [std_msgs/Float32] : : for visualization
 * /mpc_tracker/predictive_pose [visualization_msgs/MarkerArray] : for visualization
 * /mpc_tracker/robot_twist_x [std_msgs/Float32] : for visualization
 * /mpc_tracker/robot_twist_yaw [std_msgs/Float32] : for visualization
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /odom [nav_msgs/Odometry] : observed Twist of the robot
 * /reference_path [nav_msgs/Path] : reference path in map coordinate
 * /tf [tf2_msgs/TFMessage] : observed Pose of the robot in map coordinate

mpc_tracker_ros's People

Contributors

kohonda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mpc_tracker_ros's Issues

How to use the MPC tracker

Hi there, I am quite new to this topic. So I was wondering, how to get the map? Or should I create my own map?

Thank you in advance.

MPC is not solved

Hello, I have met some questions, could you please answer them for me? Thank you very much.
屏幕截图 2023-02-01 16:55:18

MPC output value is very small in simulation

Hello, I encountered a problem. When calling your code, I passed in a trajectory. This trajectory includes 10 x, y coordinates and can be visualized in rviz.

But after publishing the trajectory to /reference_path, I used rostopic echo /twist_cmd and found that the speed and angular speed changed from 0 to about 0.05, and the simulation model did not move.

The simulation model uses turtlebot3. The above text is translated using Google. There may be some expression problems. Please forgive me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.