]> rtime.felk.cvut.cz Git - ert_linux_web.git/commitdiff
Little more information about CAN blocks use with ERT Linux target.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 15 Oct 2014 18:24:38 +0000 (20:24 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 15 Oct 2014 18:24:38 +0000 (20:24 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
can_bus/index.html

index 0fa76b9e287b5b3d137c9fe96a832050af8229c6..e399efa3e56b4ff9b45d1612bef148a7887e481f 100644 (file)
@@ -51,6 +51,7 @@ iface can0 can static
 The later setup works automatic even with CAN-USB converter hotplug.
 </p>
 
+<h2 id="simulink_setup">CANopen PDO Control and Monitoring Robot Arm Demo</h2>
 <p>
 The projects includes blocks library <b>socketcan_lib.slx</b>, simple
 example of provided blocks use <b>cantransmit_ert.slx</b> and more
@@ -66,6 +67,42 @@ is provided as well.
 The CAN-USB converter from 8devices has been used in this case. 
 </p>
 
+<h2 id="simulink_setup">Simulink target Setup</h2>
+<p>
+Download/clone <a href="http://lintarget.sourceforge.net/">ERT Linux</a> target
+and Linux CAN bus toolbox repositories. The example expects the toolbox
+are placed into user local <tt>~/matlab/toolbox</tt> directory.
+Setup Matlab path for thee projects. One option is to use <tt>~/matlab/startup.m</tt>
+file for this porpose:
+</p>
+<pre>
+function startup(AddRem)
+
+disp 'Executing local setup stript ~/matlab/startup.m'
+
+restoredefaultpath
+
+[matlab_startup_dir, matlab_startup_filename, matlab_startup_dir_ext] = fileparts(mfilename('fullpath'));
+
+addpath(fullfile(matlab_startup_dir, 'toolbox/ert_linux/ert_linux'));
+addpath(fullfile(matlab_startup_dir, 'toolbox/socketcan-simulink/blocks'));
+</pre>
+<p>
+Use example model as base for the project or open <b>Simulation</b> &rarr; <b>Model Configuration Parameters</b>
+dialog and select <b>System target file</b> to <tt>ert_linux.tlc</tt> in <b>Code Genration</b> section.
+Check <b>Make command</b>. It should be something like:
+</p>
+<pre>
+make_rtw OPT_OPTS="-O2 -ggdb -Wall -D_BSD_SOURCE"
+</pre>
+<p>
+Use proper <tt>CC</tt> variable definition  in case of cross compilation to some other target.
+See next example for Raspberry Pi:
+</p>
+<pre>
+make_rtw OPT_OPTS="-O2 -ggdb -Wall -D_BSD_SOURCE" CC=arm-rpi-linux-gnueabihf-gcc
+</pre>
+
 <h2 id="links">Links</h2>
 <dl>
   <dt>Linux CAN bus toolbox repository</dt>