RoPod/Tutorials/ExpSimulinkonRobot: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
(Created page with 'For this tutorial it is assumed that a controller has been made in Simulink which should now be tested on the actual ropod. Previously installed compilers build C-code and an exe…')
 
No edit summary
Line 1: Line 1:
For this tutorial it is assumed that a controller has been made in Simulink which should now be tested on the actual ropod. Previously installed compilers build C-code and an executable that the ropod can run. In Simulink, CTRL+D preforms a diagnostic test and CTRL+B builds the code. If everything works correctly, the compiler creates a file in the working directory that has the same name as the model, but without extension. That is the executable which the ropod can run.
For this tutorial it is assumed that a controller has been made in Simulink which should now be tested on the actual ropod. Previously installed compilers build C-code and an executable that the ropod can run. In Simulink, CTRL+D preforms a diagnostic test and CTRL+B builds the code. If everything works correctly, the compiler creates a file in the working directory that has the same name as the model, but without extension. That is the executable which the ropod can run.


Switch the ropod on using the big manual switch and '''always''' keep the remote in hand. At first, make sure the red button on top is pushed in. When pushed in, the wheels will never have torque on them and thus can be used in emergencies. So obviously, when you want to run your program the red button has to be pushed out, else the ropod will not do anything.
Switch the ropod on using the big manual switch and '''always''' keep the remote in hand. At first, make sure the red button on top is pushed in. When pushed in, the wheels will never have torque on them and thus can be used in emergencies. So obviously, when you want to run your program the red button has to be pushed out, else the ropod will not do anything. When switched on, the ropod should have some flashing green lights.


Now we are going to log on to the ropod using the existing network of the Robotics Lab, put the just created executable on the ropod and use the console (terminal) to command the robot. In Ubuntu, connect to the WiFi
Now we are going to log on to the ropod using the existing network of the Robotics Lab, put the just created executable on the ropod and use the console (terminal) to command the robot. In Ubuntu, connect to the WiFi network 'ROPOD', note that you still have internet. To get the password of the network, contact one of the supervisors. The password is the same for everything related to the ropod.
 
Note that for the coming steps you will need the Secure Shell network protocol, install it on the terminal using
<pre>
$ sudo apt install openssh-server
</pre>
 
Now open a terminal and connect to the ropod with
<pre>
$ ssh ropod@192.168.44.90
</pre>
192.168.44.90 is the static ip-address of (one) the ropods. You are now in the ropod you can use the ''$ ls'' command to list all fies. Use ''$ cd Dekstop/'' to go to the Desktop folder and create a folder for yourself using ''$ mkdir Klaas'' (where Klaas is your own name) for convenience. In that folder you can work on the ropod (''cd Klaas/'')
 
Put your own controller (the executable that we have previously created) in that dir using the scp command (scp stands for Securely Copy)
<pre>
$ scp klaas@192.168.44.119:/path/to/executable_file ./
</pre>
where:
* klaas
:is your own username.
* 192.168.44.119
:is your own local ip-address, get it using ''$ ip addr show''. That command will, among other things, show something like ''inet 192.168.44.119/24'', 192.168.44.119 is then the value you want.
* /path/to/executable_file
:is the absolute path to your executable file (note that the file can obviously be differently named as executable_file)
* ./
:means to put it "here" in the current folder.
 
Give the file the necessary permissions with
<pre>
$ sudo setcap 'CAP_NET_RAW+ep CAP_SYS_NICE+eip' executable_file
</pre>
 
The file is now on the ropod, push the red button on the remote out and run the program
<pre>
./executable_file
<pre>
 
'''Always be ready to push in the red button if anything goes awry'''

Revision as of 15:38, 25 April 2019

For this tutorial it is assumed that a controller has been made in Simulink which should now be tested on the actual ropod. Previously installed compilers build C-code and an executable that the ropod can run. In Simulink, CTRL+D preforms a diagnostic test and CTRL+B builds the code. If everything works correctly, the compiler creates a file in the working directory that has the same name as the model, but without extension. That is the executable which the ropod can run.

Switch the ropod on using the big manual switch and always keep the remote in hand. At first, make sure the red button on top is pushed in. When pushed in, the wheels will never have torque on them and thus can be used in emergencies. So obviously, when you want to run your program the red button has to be pushed out, else the ropod will not do anything. When switched on, the ropod should have some flashing green lights.

Now we are going to log on to the ropod using the existing network of the Robotics Lab, put the just created executable on the ropod and use the console (terminal) to command the robot. In Ubuntu, connect to the WiFi network 'ROPOD', note that you still have internet. To get the password of the network, contact one of the supervisors. The password is the same for everything related to the ropod.

Note that for the coming steps you will need the Secure Shell network protocol, install it on the terminal using

$ sudo apt install openssh-server

Now open a terminal and connect to the ropod with

$ ssh ropod@192.168.44.90

192.168.44.90 is the static ip-address of (one) the ropods. You are now in the ropod you can use the $ ls command to list all fies. Use $ cd Dekstop/ to go to the Desktop folder and create a folder for yourself using $ mkdir Klaas (where Klaas is your own name) for convenience. In that folder you can work on the ropod (cd Klaas/)

Put your own controller (the executable that we have previously created) in that dir using the scp command (scp stands for Securely Copy)

$ scp klaas@192.168.44.119:/path/to/executable_file ./

where:

  • klaas
is your own username.
  • 192.168.44.119
is your own local ip-address, get it using $ ip addr show. That command will, among other things, show something like inet 192.168.44.119/24, 192.168.44.119 is then the value you want.
  • /path/to/executable_file
is the absolute path to your executable file (note that the file can obviously be differently named as executable_file)
  • ./
means to put it "here" in the current folder.

Give the file the necessary permissions with

$ sudo setcap 'CAP_NET_RAW+ep CAP_SYS_NICE+eip' executable_file

The file is now on the ropod, push the red button on the remote out and run the program

./executable_file

Always be ready to push in the red button if anything goes awry