johbrust / simulink_gym Goto Github PK
View Code? Open in Web Editor NEWGym Interface Wrapper for Simulink Models
Home Page: https://quire.io/w/Simulink_Gym
License: MIT License
Gym Interface Wrapper for Simulink Models
Home Page: https://quire.io/w/Simulink_Gym
License: MIT License
Thank you for this gym wrapper for simulink. However, when I python setup.py install it, and runs the cartpole example, it shows:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from cartpole_simulink import CartPoleSimulink
File /media/lk/disk1/MATLAB/matlab_py/simulink_gym/examples/envs/cartpole_simulink/cartpole_simulink.py:1
----> 1 from simulink_gym import SimulinkEnv, Observation, Observations
2 from gym.spaces import Discrete
3 from pathlib import Path
File /media/lk/disk1/MATLAB/matlab_py/simulink_gym/simulink_gym/__init__.py:7
5 from gym import logger
6 from gym import spaces
----> 7 from .environment import SimulinkEnv
8 from .observations import Observation, Observations
9 from .utils import BlockParam
File /media/lk/disk1/MATLAB/matlab_py/simulink_gym/simulink_gym/environment.py:4
2 import matlab.engine
3 import gym
----> 4 from simulink_gym import logger, SIMULINK_BLOCK_LIB_PATH
5 import threading
6 import numpy as np
ImportError: cannot import name 'SIMULINK_BLOCK_LIB_PATH' from partially initialized module 'simulink_gym' (most likely due to a circular import) (/media/lk/disk1/MATLAB/matlab_py/simulink_gym/simulink_gym/__init__.py)
Compatibility with Stable-Baselines3 and rllib required Gym version 0.21.0. Once (most of) these libraries are compatible with newer version of Gym, this wrapper will also be updated.
I have successfully run the cartpole_simulink.ipynb file. Now I have two questions:
I can successfully run the cartpole_simulink.ipynb. However, I find the sampling interval is 0.02s by checking info['simulation time [s]']. Does the interval depend on the tcp/ip sending frequency or be possible to set manually ? How can set another interval, like 1s. Thank you.
Hello,
I am trying to run a model which uses a variable step solver.
The problem is that at certain time steps, the simulation results are numerically very high/low and then they get back to the expected level in the following simulation steps.
I think that this might have something to do with the fact that python receives states at the exactly same simulation-timestamp and therefore the variable step solving procedure gets mixed up.
Furthermore, I noticed that the output time steps are also mixed up sometimes.
I already set the priority of TCP/In to 1 and TCP/Out to 2.
Running the model with a constant input just within Simulink works well.
Furthermore, I set the sample time of the TCP/In and TCP/Out to inherit, i.e. -1
Do you have any idea how this issue can be solved?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.