Skip to content

Nonlinear Model Predictive Control for Self-Driving Vehicles based on Local Sequential Quadratic Programming by recursively calling ProxQP solver.

License

Notifications You must be signed in to change notification settings

simone-contorno/mynmpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyNMPC

European Master on Advanced RObotics (EMARO+)

Nonlinear Model Predictive Control (NMPC) for Self-Driving Vehicles


ROSbot 2R Example

The following steps are provided for a ROSbot 2R with ROS 1 installed and for which, as consequence, it is necessary the ROS 1 bridge.

  1. Install the ROS 1 bridge choosing the branch corresponding to your ROS 2 version.
  2. Go into the mynmpc folder and change branch:
    git checkout rosbot
  3. Go into the root folder of your ROS 2 workspace and re-build it:
    colcon build --packages-select mynmpc

After having connected to your ROSbot through the same wifi connection, open 4 different shells and respectively follow these instructions:

  1. First shell:
    1. Source ROS 1 installation:
      source /opt/ros/$ROS_1_DISTRO$/setup.bash
    2. Run the core:
      roscore
  2. Start the ROSbot.
  3. Second shell:
    1. Source ROS 1 installation:
      source /opt/ros/$ROS_1_DISTRO$/setup.bash
    2. Source ROS 2 workspace:
      source ~/$ROS_2_WS_WITH_BRIDGE$/install/setup.bash
    3. Run the ROS 1 bridge:
      ros2 run ros1_bridge dynamic_bridge
  4. Third shell:
    1. Source ROS 2 installation:
      source /opt/ros/$ROS_2_DISTRO$/setup.bash
    2. Source ROS 2 workspace:
      source ~/$ROS_2_WS$/install/setup.bash
    3. Launch the simulation:
      ros2 launch mynmpc simulation.launch.py
  5. Fourth shell:
    1. Source ROS 2 installation:
      source /opt/ros/$ROS_2_DISTRO$/setup.bash
    2. Source ROS 2 workspace:
      source ~/$ROS_2_WS$/install/setup.bash
    3. Run the controller:
      ros2 run mynmpc controller

Hints

  • Since you will need to source different shells with different ROS distributions, make sure of not having an automatic source command in your .bashrc file, and (personal suggestion) create and alias to run commands faster.
  • If the dynamic bridge does not correctly map all the needed ROS 1 topics to ROS 2, run it with this additional option:
    ros2 run ros1_bridge dynamic_bridge --bridge-all-1to2-topics
    This will map all the ROS 1 topics to ROS 2.
If you have doubts or are still encountering problems, try to consult this guide.

About

Nonlinear Model Predictive Control for Self-Driving Vehicles based on Local Sequential Quadratic Programming by recursively calling ProxQP solver.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published