The Simulated Experiments consist of the following experiments:
- loopback
- massspring
- truck
- twomassspring
- twotone
The contents of mlsimScripts_usr_local
is to be placed in: /usr/local
.
It consists of:
- experiment (used for real experiments with Ebox)
- loopback
- massspring
- truck
- twomassspring
- twotone
The contents of libec_usr_lib
is to be placed in: /usr/lib
. It consists of a set of libraries for Ethercat, where
libec.so
libec.so.1
libec.so.1.0
-> experimentlibec_0.so
libec_0.so.1
libec_0.so.1.0
-> loopbacklibec_1.so
libec_1.so.1
libec_1.so.1.0
-> massspringlibec_2.so
libec_2.so.1
libec_2.so.1.0
-> trucklibec_3.so
libec_3.so.1
libec_3.so.1.0
-> twomassspringlibec_4.so
libec_4.so.1
libec_4.so.1.0
-> twotone
The contents of Matlab_sim_exp
is to be placed in: /home/ebox/svn/trunk/E-box/Apps/sim_exp/
. It consists of 5 Matlab scripts. These scripts that have to be added to the path in Matlab in order for the simulated experiments to be loaded independent of the current working directory. The scripst are:
/home/ebox/svn/trunk/E-box/Apps/sim_exp/loopback.m
/home/ebox/svn/trunk/E-box/Apps/sim_exp/massspring
/home/ebox/svn/trunk/E-box/Apps/sim_exp/truck
/home/ebox/svn/trunk/E-box/Apps/sim_exp/twomassspring
/home/ebox/svn/trunk/E-box/Apps/sim_exp/twotone
The Ebox experiments require an Ebox to be connected through the ethernet cable of the computer. The Operating System (OS) has to have given the name of the ethernet port either eth0
, eth1
or eth2
. If named differently (e.g. eth4
, the computer won't connect to the Ebox. The name of the ethernet port can be manually modified in the file /etc/udev/rules.d/70-persistent-net.rules
. When changing the name, the OS has to be restarted. There is a Bash script that modifies the ethernet port name automatically if the name is not within the set {eth0
, eth1
, eth2
}. This script is located at /home/ebox/svn/trunk/src/E-box/eth_port/eth_check.sh
. Note that for the RobotArm the ethernet port name has to be eth2.
The script that loads the experiment is the Matlab script qs.m
located at /home/ebox/svn/trunk/E-box/Apps/E-Scope/guiv25/qs.m
. This file has to be added to the Matlab path in order to be exectuted from any directory in Matlab. The qs.m
file loads the quadscope guim. Prior to doing this, it goes through the following steps:
- Checks if a file exists called "sim_indicator" (this is used for the simulated experiments).
- If the file doesn't exist:
- The experiment mlsim script is compiled to be in experiment mode. This is done by running
/usr/local/simexp/experiment/mlsim > /dev/null 2>&1
. - The name of the Ethernet port is verified and changed if not in the set{eth0, eth1, eth2}. If the ethernet port name is changed, the OS has to be restarted.
- The quadscope gui is .
The simulated experiments don't require an Ebox to be connected to the computer. The simulated experiments can however be loaded if an Ebox is connected. The simulated experiments are executed from the Matlab scripts within /home/ebox/svn/trunk/E-box/Apps/sim_exp/
(see Matlab_sim_exp above). The directory has to be added to the Matlab path for the scripts to be executed from any directory.
The simulated scripts are executed by running one of the following scripts from the Command Line: loopback.m
, massspring.m
, truck.m
, twomassspring.m
or twotone.m
. These scripts go through the following steps:
- Create a file called "sim_indicator" in the directory
/home/ebox/svn/trunk/src/E-box/Apps/sim_exp
. Theqs.m
script checks if this file exists to verify if the experiment mode has to be compiled or not. - Compile the simulated experiment executable, e.g.
/usr/local/simexp/loopback/mlsim > /dev/null 2>&1
. - Run the
qs.m
file. As the "sim_indicator" file is present, the experiment mode executable will not be compiled. - Remove the "sim_indicator" file.