pysimCoder icon indicating copy to clipboard operation
pysimCoder copied to clipboard

Issues using Tests

Open eve-wils opened this issue 3 years ago • 2 comments

Hello! I am trying to run your tests to try generating C-code, but there are errors when I try to run any test file. They are different depending on the test. I would appreciate any help in resolving these issues! This is using the docker image with the web-based NVC viewer.

Here are a few of the errors. I have a suspicion that I am doing something wrong.

/pysimCoder/Tests/ControlDesign/BallOnWheel

BoWRT.dgm image BoWRTfix.dgm image

BoWsim.dgm image

/pysimCoder/Tests/ControlDesign/Disks

disk_sim.dgm image

diskRT1.dgm image

eve-wils avatar Feb 22 '22 17:02 eve-wils

Hi @eve-wils. I don't think you are doing something wrong, the problem seems to be in including a python parameter script. Those steps should provide a workaround for diskRT1.dgm example.

enter Tests/ControlDesign/Disks/disk1.py rewrite line 38: x1 = np.loadtxt('MOT1'); to the full path, for me it was x1 = np.loadtxt('/home/michal/Michal/GIT/pysimCoder/Tests/ControlDesign/Disks/MOT1'); enter Settings in pysimCoder GUI (the screwdrivers right next to the compilation button) replace disk1.py with the full path to the file, so for me it was /home/michal/Michal/GIT/pysimCoder/Tests/ControlDesign/Disks/disk1.py then you can compile the example. I think the process will be similar for other examples.

You also need to compile the C part of the pysimCoder based on the target hardware you are going to use. This needs to be done prior to the code generation from pysimCoder GUI. So for example enter CodeGen/LinuxRT/devices and execute make command. Similar process is for other supported targets.

I am currently not sure why the short version of the path is not working @robertobucher.

michallenc avatar Feb 22 '22 21:02 michallenc

The problem is probably related to the path of the files for code generation. The simplest method to corret it is to open the parameters dialog and "BROWSE" the file again. This will correct the path with the right one. I've checked some files and I had my "personal" path into the configuration. Another possible problem is related to the environment variables: lease check that you have the right lines in your .bash file: export PYSUPSICTRL=/home/bucher/CACSD/pysimCoder export PYEDITOR=emacs export PYTHONPATH=/home/bucher/Documents/PYTHON:/home/bucher/CACSD/pysimCoder/resources/blocks/rcpBlk

where /home/bucher should be fit your installation.

I've reinstalled some files to correct another problem related to the new "dlqr" command that now is available in the python-control toolbox.

robertobucher avatar Feb 23 '22 07:02 robertobucher