Giter VIP home page Giter VIP logo

segway_sim's Introduction

segway_sim

This is a ROS-based C++ simulation environment for a two-wheeled inverted pendulum (Segway) robot. It currently has two branches, a Model Predictive Control (MPC) branch that uses a Mixed Observable Markov Decision Process (MOMDP) planner for high-level planning, and uses the MPC for trajectory generation and control. The other branch is a Control Barrier Function (CBF) branch that guarantees that the system stays in a "safe" subset of the state space, regardless of the inputs given to the system from the user.

Prerequisites

Eigen is required. If Eigen is not installed, or you want to run the version of Eigen that runs on the Segway, use the Eigen_embedded folder and replace all instances of Eigen_embedded with Eigen.

The OSQP solver is used for both branches, and can be found here

The MPC branch requires the following library for MPC, as well as the following ROS package for its message structure.

CBF branch installation coming soon.

Description

The robot

The simulation is based on the Ninebot Elite used in the AMBER lab link. The code run in this simulation environment has been used directly on the hardware, as evidenced in this video

How to run

After intalling the MPC and OSQP libraries listend in the above Prerequisites section follows the following steps:

  • Run the main.py file in the folder /segway_sim/src/pyFun. It should save a .pkl object in the /segway_sim/src/pyFun/data/Qug_1 folder
  • Download the ambercorted_ros pakage from here
  • Checkout the dev branch in the ambercorted_ros package
  • Build your catkin workspace
  • Open the launch file main.launch. At the bottom of the launch file enter the folder where you would like to save your bag file
  • Run roslaunch segway_sim main.launch
  • In a new terminal run rosservice call /segway_sim/integrator/ui "cmd: 1"
  • After the simulation run the file readNewBag.py in the /segway_sim/plotUtils folder (it is needed to change the path where the bag file has been saved)

Results

Coming soon

References

This code is based on the following:

(CBF)

  • Gurriet, T., Singletary, A., Reher, J., Ciarletta, L., Feron, E., & Ames, A. (2018, April). Towards a framework for realizable safety critical control through active set invariance. In 2018 ACM/IEEE 9th International Conference on Cyber-Physical Systems (ICCPS) (pp. 98-106). IEEE. PDF
  • U. Rosolia and A. D. Ames, "Multi-Rate Control Design Leveraging Control Barrier Functions and Model Predictive Control Policies," in IEEE Control Systems Letters, vol. 5, no. 3, pp. 1007-1012, July 2021, PDF

segway_sim's People

Contributors

urosolia avatar drewsingletary avatar

Stargazers

 avatar Ahmed Hanie avatar  avatar Nandagopan K avatar Yoshinari Takayama avatar  avatar  avatar Manasvi Saxena avatar Yanze Liu avatar onewall avatar  avatar youshaoze avatar Zack avatar  avatar James Usevitch avatar Berk Tosun avatar  avatar Nathan Boyd avatar Weijie Wang avatar Changyu Lee avatar Satrajit Chatterjee avatar  avatar Xiao Tan avatar Sagar Rajendran avatar Kaustav Ghosh avatar

Watchers

James Cloos avatar  avatar  avatar

segway_sim's Issues

Status of CBF Branch

Hi guys,

I could not find the CBF related part in the source. I am guessing it is contained in the up-coming CBF branch, is there any updates on that?

Great work, thanks for sharing it with us!

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.