Code Monkey home page Code Monkey logo

dyn-sim's Introduction

Dynamical Simulation Environment

Overview

This repository is a catch-all simulation environment for studying controllers (which may have bandwidth limitations) for dynamical systems.

File Structure

  • dyn_sim - core code
    • ctrl - implemented controllers with subfolders corresponding to each system. General control code lives in the parent folder (e.g. mpc).
      • quad
        • Inner/Outer Loop PD Controller
        • [REFACTORING] Safe Multirate Controller
      • [WIP] segway
    • sim - simulator code
    • dyn_sys - implemented dynamical systems
      • planar - systems that are visualized in the plane
        • [WIP] segway
      • spatial - systems that are visualized in Euclidean space
        • quad
    • util - common utility functions across codebase
  • scripts - scripts for running simulations

Dependencies and Environment Management

Gurobi

This repo uses the optimization package Gurobi, which is a commercial product (but is available to academics for free). This section details (hopefully) headache-free installation of Gurobi for academics. If you are not an academic, wait for alternate free optimizer support (e.g. scipy).

First, register using your academic credentials on the website (instructions for the academic license are linked here).

Second, we will only require the package gurobipy, so we will install that with the requirements file in the next section. However, we must license our installation, so install the license tools package here. Extract the executable file grbgetkey into any directory.

Third, on the Gurobi website, you should be able to view your current licenses. If you click on your License ID, you will come to a page with Installation instructions, which should include a line that looks like:

grbgetkey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Copy this command, and in your terminal, run the command

<full_parent_path>/grbgetkey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

with the correct parent path and license key. Save the license file somewhere logical, such as the home directory. gurobipy should be usable on your machine after its installation via pip.

Dependency Installation

This repo is designed to be run in a conda virtual environment with dependencies managed by pip and versions frozen in a requirements file (versions last frozen May 23, 2022).

To make an environment, make sure you have conda installed and then run the command:

conda create --name <env_name> python=3.10.4

Anytime after initializing the environment, activate before using project files:

conda activate <env_name>

To install the dependencies in the project, after activating the environment for the first time, run

pip install -r requirements.txt

Development

For people developing on the environment, style-checking and static type-checking is performed using pre-commit hooks. Make sure you have pre-commit installed (separate command from dependency installation):

pip install pre-commit
pre-commit install

dyn-sim's People

Contributors

alberthli avatar jplathrop avatar

Watchers

James Cloos avatar Philipp Wu avatar  avatar

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.