Giter Site home page Giter Site logo

quanser-sim's Introduction

Quanser Qube - Servo2 sim

For more information about the Qube click here

Simulator structure

├── README.md
├── render_qube.py
├── qube_simulator.py
└── requirements.txt

reset_down()

Info:

  • Reset starts the pendulum from the bottom (at rest).
  • The task is to flip up the pendulum and hold it upright.
  • Episode ends once the theta angle is greater than 90 degrees.
  • Reward should be a function of the angles theta (arm angle) and alpha (pendulum), and the alpha angular velocity.
    • Encourages the the arm to stay centered, the pendulum to stay upright, and to stay stationary.

reset_up()

Info:

  • Reset starts the pendulum from the top (flipped up/inverted).
  • The task is to hold the pendulum upright.
  • Episode ends once the alpha angle is greater the 20 degrees or theta angle is greater than 90 degrees.
  • Reward should be a function of the angles theta (arm angle) and alpha (pendulum), and the alpha angular velocity.
    • Encourages the the arm to stay centered, the pendulum to stay upright, and to stay stationary.

Action

action = Vm

States

state = [theta, alpha, theta_dot, alpha_dot]

Usage

    qube = QubeSimulator(frequency=250)

    ## LQR benchmark controller gains
    #K = np.array([-2.0, 35.0, -1.5, 3.0])
    
    for episode in range(2):
        # Optional config
        config = {
            # Parameters
            "Lp": 0.129,
            "mp": 0.024,
            # Initial Conditions
            "theta": random.randint(0, 360) * 2 * np.pi / 360,
            "alpha": 0 + np.random.randn() * 0.05, # make sure pi if reset_down
            "theta_dot": 0 + np.random.randn() * 0.05,
            "alpha_dot": 0 + np.random.randn() * 0.05
        }

        print('episode: ', episode)
        state = qube.reset_up(config)
        
        for i in range(2048):
            action = random.uniform(-3, 3)
            #action = K.dot(state)
            state = qube.step(action)
            qube.view()

quanser-sim's People

Contributors

andpol5 avatar journeyman-msft avatar kirill5pol avatar leeredden avatar polzounov avatar rsundarbrt avatar

Forkers

ascortez

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.