Code Monkey home page Code Monkey logo

mpc_ros's Introduction

GitHub issues open GitHub forks GitHub stars GitHub license

Nonlinear Model Predictive Control

Abstract

The goal of this repository is to implement the path tracking algorithm of mobile robot using the Nonlinear Model Predictive Control(NMPC), one of the optimal controllers. The NMPC can provide the poweful and effective performance among existing optimal controllers since it can have the preview ability and easy to regulate constraints. This repository is based on ROS(Robot Operating System). Therefore it supports the local planner plugin and standalone node as well.

Features

  • Nonlinear Model Pridictive Control (through ipopt solver)
  • Wheeled Mobile Robot

Installation

  1. Ubuntu 18.04

  2. Install ROS Melodic.

  3. Install ROS dependencies.

    sudo apt install ros-melodic-costmap-2d \
    ros-melodic-move-base \
    ros-melodic-global-planner \
    ros-melodic-amcl
    
  4. Install Ipopt: Please refer the tutorial in "document/ipopt_install".

  5. Create your own catkin_ws and clone the repositories.

    git clone https://github.com/Geonhee-LEE/mpc_ros.git 
    
    • (optional) If you already have the urdf model, you don't need to clone below
      git clone https://github.com/CzJaewan/servingbot.git
      

    NOTE: you can also refer other models such as ackermann model, holonomic model. you can see it mpc_ros_description

  6. Build (catkin_make) and Try it.

Launch

Run Navigation algorithm with MPC in simulation:

  • It can be selected with DWA, MPC, Pure persuit according to 'controller' argument.
roslaunch mpc_ros nav_gazebo.launch

Run tracking the reference line with MPC

  • Tracking the trajectory such as infinity-shaped, epitrochoid, square using non-linear model predictive control.
roslaunch mpc_ros ref_trajectory_tracking_gazebo.launch

How to use as local planner

  • After building successfully, you should just change the base_local_planner param with mpc_ros/MPCPlannerROS.
<param name="base_local_planner" value="mpc_ros/MPCPlannerROS"/>

Youtube video


Video Label

About us

Contact: [email protected]
Date: 2020/05/02
License: Apache 2.0

Reference

mpc_ros's People

Contributors

czjaewan avatar geonhee-lee avatar harderthan 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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpc_ros's Issues

Error when sending a goal.

I'm trying to use the MPC controller, only I'm having some difficulty.

As soon as I am setting a goal, I am getting this: [move_base-3] process has died [pid 373175, exit code -11, cmd /opt/ros/noetic/lib/move_base/move_base /scan:=/scan_front /cmd_vel:=/idmind_motors/twist __name:=move_base __log:=/home/euroage/.ros/log/980f7870-a6e8-11ed-a1f9-e0d55e204096/move_base-3.log].


!! MPC Obj parameters updated !! 

===== Parameters =====
debug_info: 0
delay_mode: 1
frequency: 1
mpc_steps: 10
mpc_ref_vel: 1
mpc_w_cte: 1000
mpc_w_etheta: 10
max_vel_theta: 1.5
[move_base-3] process has died [pid 373175, exit code -11, cmd /opt/ros/noetic/lib/move_base/move_base /scan:=/scan_front /cmd_vel:=/idmind_motors/twist __name:=move_base __log:=/home/euroage/.ros/log/980f7870-a6e8-11ed-a1f9-e0d55e204096/move_base-3.log].
log file: /home/euroage/.ros/log/980f7870-a6e8-11ed-a1f9-e0d55e204096/move_base-3*.log

Thanks for help

RUNTIME error

  • When launched the launch file, process died abnormally:
    image

I want some help

Hello, I find your project very attractive and I want to learn some knowledge about it. I see that the “zetabot-ros” is “private”, is this a pack about a specific robot? And I wonder if the parts involved can be replaced with others(like turtlebot). Thank you for your help.

process has died

Hello, I found that when the robot started tracking, it would report an error. What is the reason? Thank you very much.
48987de49112bb09ded58795e6e9177

Information about mpc parameters

Hello, Geonhee

I would like to get information about the parameters you use in the scripts in the "param" folder for the epitrochoid, square.... Because I am trying to adapt it to my own robot and to modify them I would like to understand them.
If you could provide me with any documentation on them I would appreciate it.

Thank you, best regards.

ipopt install error

안녕하세요.
설명대로 Ipopt 설치 과정중 ./get.Mumps 이후로 넘어가지가 않습니다
혹시 해결 방법이 있을까요?

mumps

How to make a simulation with dwa?

Hi, I want to compare the simulation results of MPC and DWA.

I completed the simulation with MPC, like this:
lALPDgtYz8IdYAfNAa7NAzY_822_430

But I don't know how to make a simulation with DWA, like the right results in this picture.
lQLPDhssxXjbX1DNAg7NBJCwvNaNuUn4k_wCGgbQ4EC9AA_1168_526

ROS Noetic Branch

Hello, @Geonhee-LEE maintainer.
I follow your README for the demonstration on Noetic.
On while, I fixed some issue to launch your code on noetic.
I would like to contribute new PR, but there is no Noetic branch.
Could you make a branch for this contribution?

IPOPT

hello
when I use mpc_ros local planner plugin, I find a error

src/mpc_ros/mpc_ros/include/cppad/utility/error_handler.hpp:206:
 static void CppAD::ErrorHandler::Default(bool, int, const char*, const char*, const char*): Assertion `false' failed.

please tell me how to handle it
thanks

csv

hello,i have a question:
in the source code,you open the csv, so where is the csv?how can i get it?
Thanks!

Test on real robot

What are the requirements if I want to test the package on a real wheeled robot?
Do I need to install wheels encoders and IMU?

After this, how should I define the path to track?

Issue with building on branch 'local_planner_plugin' and suggested fix.

Currently building on Ubuntu 20.04 (ROS Noetic) on local_planner_plugin branch. I get the following error messages:

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/navMPC.cpp:19:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/mpc_plannner.cpp:19:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/MPC.cpp:21:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

                 from /home/john/catkin_ws/src/mpc_ros/mpc_ros/src/trackRefTraj.cpp:20:
/usr/include/coin/IpSmartPtr.hpp:18:4: error: #error "don't have header file for stddef"
   18 | #  error "don't have header file for stddef"

...

One way to fix said errors is to adopt the fix suggested by this Stack Overflow answer,
where I add the following define headers to navMPC.cpp, mpc_plannner.cpp, MPC.cpp, trackRefTraj.cpp :

#define HAVE_CSTDDEF
#include <cppad/ipopt/solve.hpp>
#undef HAVE_CSTDDEF

ref_trajectory_tracking_gazebo.launch doesn't launch Gazebo

Hello Geonhee,
We solved the error we told you few days ago. It was due to some servingbot libraries when I was doing the catkin_make.
But, now, launching roslaunch mpc_ros ref_trajectory_tracking_gazebo.launch opens rviz, but does not open Gazebo.
Error: Could not find the 'robot' element in the xml fil at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp

Thank you very much in advance.

ROS2 implementation timeline

Hi, great work. Just managed to get it to work on my machine in a docker container.

I saw you have planned to implement your work in ROS2 and just wanted to ask what the progress on that is?

Thank you!

Cannot launch node

Hello,
We are a group of robotic engineering students from Spain.

We are developing a project related to the model predictive control

We have implemented the "servingbot" model following all the steps indicated. We have installed ubuntu 18.04 together with ROS Melodic, we have installed the dependencies of ROS, IPOPT and cloned the repositories in our own catkin.

After that, We get errors when launching some nodes. Attached is a screenshot:

When launching mpc_ros nav_gazebo.launch
I have an error:

cannot launch node of type [mpc_ros/nav_mpc]: Cannot locate node of type [nav_mpc] in package [mpc_ros]. Make sure file exists in package path and permission is set to executable (chmod +x)
When I try to search for the mpc_ros file in my directory I can't find it.

When launching roslaunch mpc_ros ref_trajectory_tracking_gazebo.launch
I have an error:

cannot launch node of type [mpc_ros/tracking_reference_trajectory]: Cannot locate node of type [tracking_reference_trajectory] in package [mpc_ros]. Make sure file exists in package path and permission is set to executable (chmod +x)
This file also does not exist in my directory

The question is: Do I have to create those files? If so, how do I do it?
How can I reference the robot?

I await your response, anything could be helpful.

Thank you so much.

TF error

Thanks for your code.
I tried to reimplement it, but the robot didn't move at all.
It seems like a tf problem. Could you give me any advice?

Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist. canTransform: source_frame base_link does not exist.. canTransform returned after 98.075 timeout was 0.1.

Thanks and regards.

Replacement solver

Hello, the ipopt solver seems to be unable to work under the arm architecture. May I ask what part of work should be done if you want to change the solution? Thank you.

Difference between mpc_ros global_planner and navigation stack global_planner?

Hi @Geonhee-LEE

I have tried out your mpc_ros in the gazebo. I found that there's additional global_planner in the package. May i know what's the difference between your mpc_ros global_planner and navigation stack global_planner? Because i have written the highway costmap plugins. But it can only work with the navigation stack global_planner, so i couldn't get it to work with your mpc_ros global_planner.

Best,
Samuel

The Robot isn't moving

I launch the launch file (ref_trajectory_tracking_gazebo.launch).
But, the robot isn't moving.

image

I think this issue is same as #5.
How to connect /map frame with /odom frame?

image

Does the algorithm only use MPC for path tracking

Does the algorithm only use MPC for path tracking, or is it also used for local path planning? I read some source codes and found that it seems to track the trajectory generated by global plan。

how to change model

I have gotten the ackermann model and I want to know how to replace the diff model in the servingbot ,in other words,what orders I should change in the bag.
thanks for your help!

The global status error

Excuse me! I have a question ,Follow the README.md, and I run the mpc_ros nav_gazebo.launch, the RVIZ has an error .
The global status error ,Fixed Frame [map] does not exist.Can you help me to solve it ? Thank you .

error

Hello, when I run our program, I get the following error:
a27665fa62e3f48e5d872162d142fa3
How can I solve it? Thank you.

ipopt install error

안녕하세요.
ipopt 설치과정중에 ./get.Mumps 이후로 넘어가지가 않습니다.
해결방법이 있을까요?
mumps

csv

Hello,I have some questions:
I read the source code, there is a csv file loaded in it, and how does cte and eteta get in the csv file?

thanks!

some detail about NMPC

Hello, could you give some material about NMPC about nonlinear unicycle model ? Thank you.

Description update

For using clearly, we should arrange or prepare more detailed description or readme.

Use mpr_ros with a different Robot model

Hi, would be possible to use this mpc package with another differential drive robot model? I'd need to use it for my model with the libgazebo_ros_diff_drive.so plugin, so I wonder if I could change the servingbot model for it.

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.