Code Monkey home page Code Monkey logo

vscmg_env's Introduction

Dynamical environmet agent wrapper for Variable Speed Comtrol Moment Gyroscope

HitCount MIT license

Python wrapper for attitude dynamics of VSCMG in pyramid cluster.

For Reinforcement Learning, It is important to have precise environment, responsive to actions taken by agent. Matlab based ODE integrator are easy to implement but slower in performance. Slight improvement in performace with python odeint integrators, since order of magnitude of steps to be performed by a learning agent are in billions. To improve computation speed C++ based dynamical envirnomet is needed This dynamical stepper implemented in C++ has shown significantly large improvements in speed without compromising solution accuracy. To simplify access to envirnoment, python wrapper is implemented to expose VSCMG_ENV stepper.

Binaries

Stable Release (https://github.com/siddharthdeore/VSCMG_ENV/releases/tag/VSCMG_ENV) Copy VSCMG_ENV.pyd inside your_python_root/DLLs directory

Python Usage

Acess library from python.

import numpy as np
import VSCMG_ENV

# create VSCMG satellite object
sat=VSCMG_ENV.Satellite()

# set satellite states with array of(quaternion, body rates, RW velocities, gimbal angles)
IC=np.array([1.0, 0.0, 0.0, 0.0,	0.0, 0.0, 0.0,	1000.0, 1000.0, 1000.0, 1000.0,  0.0, 0.0, 0.0, 0.0])
sat.setState(IC)

# control action array of (4 x RW acerlations, 4 x gimbal rates)
action=np.array([0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0])
t = 0	# time
dt = 0.01	# step size

# take dynamical step of size dt with control action as input
states=sat.step(action,t,dt)

# step without control action
states=sat.stepNull(t,dt) 

# step without control action
states=sat.stepNull(t,dt) 

# Reset to default Orientation and zero kinetic energy
sat.resetState()

# Show Satellite Information
sat.Info()

# Body Inertia
I=np.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
Jg=0.01 # Gimbal Inertia
Jw=0.01 # Reaction Wheel Inertia

# Set body, Gimbal and Reaction wheel Inertia
sat.setInertia(I,Jg, Jw)
sat.Info()

print(states)

Compile Requrements

Visual Studio C++ 2019 (MSVC 14.23)
Python 3.7
Boost 1.72.0 (https://www.boost.org/)
Armadillo 9.850.1 (http://arma.sourceforge.net/)

Visual Studio C++ Project Properties

C/C++ >> Additional Include Directories
	%PYTHON_ROOT%\include;
	%BOOST_ROOT%;
	%ARMADILLO_ROOT%\include;

Linker >> Additional Library Directories
	%PYTHON_ROOT%\libs;
	%BOOST_ROOT%\stage\lib;
	%ARMADILLO_ROOT%\lib_win64;

TODO

CMake Support

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

MIT

vscmg_env's People

Contributors

siddharthdeore avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

chenchunxuan

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.