Simulink-OROCOS error

Hi all, I really would like to know if somebodu could help me with
component generator using Simulink Real Time Work Shop. I made tha
example proposed on UserManual at http://www.orocos.org/simulink but I
got some errors posted below:

Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 51 Column: 65
Unable to find tMassMatrixLocalIrType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 52 Column: 65
Unable to find tMassMatrixLocalJcType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 53 Column: 69
Unable to find tMassMatrixLocalPrAddrType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 69 Column: 61
Unable to find tMassMatrixLocalIr within the GlobalScope scope
### Real-Time Workshop build procedure for model: 'OrocosTestDouble'
aborted due to an error.

Any help would be great!!!

Thanks,

Breno

Simulink-OROCOS error

On Thu, Aug 6, 2009 at 3:29 AM, Breno<breno [..] ...> wrote:
> Hi all, I really would like to know if somebodu could help me with
> component generator using Simulink Real Time Work Shop. I made tha
> example proposed on UserManual at http://www.orocos.org/simulink but I
> got some errors posted below:
>
>
>
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 51 Column: 65
> Unable to find tMassMatrixLocalIrType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 52 Column: 65
> Unable to find tMassMatrixLocalJcType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 53 Column: 69
> Unable to find tMassMatrixLocalPrAddrType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 69 Column: 61
> Unable to find tMassMatrixLocalIr within the GlobalScope scope
> ### Real-Time Workshop build procedure for model: 'OrocosTestDouble'
> aborted due to an error.
>
>
> Any help would be great!!!

Please provide more info. What versions (orocos, matlab, ...) are you
using, when _exactly_ do you get this error, ...?

Simulink-OROCOS error

Klaas Gadeyne wrote:
> On Thu, Aug 6, 2009 at 3:29 AM, Breno<breno [..] ...> wrote:
>
>> Hi all, I really would like to know if somebodu could help me with
>> component generator using Simulink Real Time Work Shop. I made tha
>> example proposed on UserManual at http://www.orocos.org/simulink but I
>> got some errors posted below:
>>
>>
>>
>> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 51 Column: 65
>> Unable to find tMassMatrixLocalIrType within the GlobalScope scope
>> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 52 Column: 65
>> Unable to find tMassMatrixLocalJcType within the GlobalScope scope
>> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 53 Column: 69
>> Unable to find tMassMatrixLocalPrAddrType within the GlobalScope scope
>> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 69 Column: 61
>> Unable to find tMassMatrixLocalIr within the GlobalScope scope
>> ### Real-Time Workshop build procedure for model: 'OrocosTestDouble'
>> aborted due to an error.
>>
>>
>> Any help would be great!!!
>>
>
> Please provide more info. What versions (orocos, matlab, ...) are you
> using, when _exactly_ do you get this error, ...?
>
Hi Klaas an folks, my environment is set with Orocos-RTT-v1.8.4,
Orocos-OCL-v1.8.1and OROCOS-KDL1.0.0. I think that those are the latest
versions of all tools.

I have a Matlab 7.7.0 R2008b.

I made some mdl on simulink and on configuration window (Crtl+E) I
set: *Solver*: Fixed-step; *RealTime Workshop*: orocos.tlc , C++,
make_rtw, orocos.tmf. That's all!!! Everything else I have left as default.

When I press build, I got:
***************************************************************************************************
### Starting Real-Time Workshop build procedure for model: OrocosTestDouble
### Generating code into build directory:
/home/breno/OrocosTestDouble_orocos
Warning: The model 'OrocosTestDouble' does not have continuous states,
hence using the
solver 'FixedStepDiscrete' instead of solver 'ode3'. You can disable
this diagnostic
by explicitly specifying a discrete solver in the solver tab of the
Configuration
Parameters dialog, or setting 'Automatic solver parameter selection'
diagnostic to
'none' in the Diagnostics tab of the Configuration Parameters dialog.
Warning: Input port 1 of 'OrocosTestDouble/DataPort<double>' is not
connected.
Warning: Output port 1 of 'OrocosTestDouble/DataPort<double>1' is not
connected.
Warning: Unable to determine a fixed step size based on the sample times
in the model
'OrocosTestDouble', because the model does not have any discrete sample
times.
Picking a fixed step size of (0.2) based on simulation start and stop
times. You can
disable this diagnostic by explicitly specifying a fixed step size in
the Solver pane
of the Configuration Parameters dialog box, or setting the 'Automatic
solver parameter
selection' diagnostic to 'none' in the Solver group on the Diagnostics
pane of the
Configuration Parameters dialog box.
### Invoking Target Language Compiler on OrocosTestDouble.rtw
tlc
-r
/home/breno/OrocosTestDouble_orocos/OrocosTestDouble.rtw
/opt/matlab/rtw/c/orocos/orocos.tlc
-O/home/breno/OrocosTestDouble_orocos
-I/opt/matlab/rtw/c/orocos
-I/home/breno/OrocosTestDouble_orocos/tlc
-I/opt/matlab/rtw/c/tlc/mw
-I/opt/matlab/rtw/c/tlc/lib
-I/opt/matlab/rtw/c/tlc/blocks
-I/opt/matlab/rtw/c/tlc/fixpt
-I/opt/matlab/stateflow/c/tlc
-aEnforceIntegerDowncast=1
-aFoldNonRolledExpr=1
-aInlineInvariantSignals=0
-aInlineParameters=0
-aLocalBlockOutputs=1
-aRollThreshold=5
-aZeroInternalMemoryAtStartup=1
-aZeroExternalMemoryAtStartup=1
-aInitFltsAndDblsToZero=1
-aForceBlockIOInitOptimize=0
-aGenerateReport=0
-aGenCodeOnly=0
-aRTWVerbose=1
-aIncludeHyperlinkInReport=0
-aLaunchReport=0
-aGenerateTraceInfo=0
-aForceParamTrailComments=0
-aGenerateComments=1
-aIgnoreCustomStorageClasses=1
-aIncHierarchyInIds=0
-aMaxRTWIdLen=31
-aShowEliminatedStatements=0
-aIncDataTypeInIds=0
-aInsertBlockDesc=0
-aIgnoreTestpoints=0
-aSimulinkBlockComments=1
-aInlinedPrmAccess="Literals"
-aTargetFcnLib="ansi_tfl_tmw.mat"
-aIsPILTarget=0
-aLogVarNameModifier="rt_"
-aGenerateFullHeader=1
-aGenerateTraceInfo=0
-aIgnoreTestpoints=0
-p10000

Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 51 Column: 65
Unable to find tMassMatrixLocalIrType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 52 Column: 65
Unable to find tMassMatrixLocalJcType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 53 Column: 69
Unable to find tMassMatrixLocalPrAddrType within the GlobalScope scope
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 69 Column: 61
Unable to find tMassMatrixLocalIr within the GlobalScope scope
### Real-Time Workshop build procedure for model: 'OrocosTestDouble'
aborted due to an error.

**************************************************************************************************************************

Simulink pop up a window saying :

message:

Error using ==> tcl_new
Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 70 Column: 61
Unable to find tMassMatrixLocalIr within the GlobalScope scope

I don't have Matlab for windows and I rarely use it. Is there any
differences of functionality on OS?

Thanks for all,

Breno

Simulink-OROCOS error

On Thu, Aug 6, 2009 at 2:41 PM, Breno<breno [..] ...> wrote:
[...]
> I have a Matlab 7.7.0 R2008b.
>
> I made some mdl on simulink  and on configuration window (Crtl+E)  I set:
>  *Solver*: Fixed-step; *RealTime Workshop*: orocos.tlc , C++, make_rtw,
> orocos.tmf. That's all!!! Everything else I have left as default.

> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 51 Column: 65
> Unable to find tMassMatrixLocalIrType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 52 Column: 65
> Unable to find tMassMatrixLocalJcType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 53 Column: 69
> Unable to find tMassMatrixLocalPrAddrType within the GlobalScope scope
> Error: File: /opt/matlab/rtw/c/tlc/mw/globalsetup.tlc Line: 69 Column: 61
> Unable to find tMassMatrixLocalIr within the GlobalScope scope

Have you already tried generating RTW code for your model without
setting the orocos target (e.g. using the GRT target)?

Is the "tMassMatrixLocalIrType" something from _your_ model (since I
can't find it in our matlab 2008B install)?

Klaas

Simulink-OROCOS error

>> I haven't got access to matlab at home, but from looking at the
>> screenshot I would say two things:
>> - Your target language should probably be set to C (not C++)
>
> I also tried with C, but doesn't change the messages errors.
>
>> - You probably don't need the -r option (did I post something like
>> that on the forum/mailing list?)
>
> You didn't post anything like that. Without -r option I got the error:
> Unable to find tMassMatrix... mentioned before.

Also with the small posted on the forum?

> Is there a way to find out whether RTW is working properly?

Try running a demo

Klaas

Simulink-OROCOS error

On Thu, Aug 6, 2009 at 11:17 PM, <breno [..] ...> wrote:
> Hi Klaas, sorry send you another e-mail but do you have the mdl from
> Simulink-OROCOS tutorial available? Case yes, could you send me for test?

I haven't :-(

> Where the code on page 6 is supposed to be?

You don't need that at this point in time I guess??

Klaas

Simulink-OROCOS

Hi Klaas, at long last I could get generated a code from Matlab but I had
to run it on Windows version in my University lab.

Anyway, I did my .mdl attached and then make the build process. Now I have
the .cpp and .h files and other files also but, sorry for my ignorance, I
don't know what to do with them. My question about the code on page 6 at
the Orocos-Simulink manual still remains.

What exactly could I do with all those code?

Is there really useful use Simulink for code generation? I read the .c
file and realized that it's really enormous.

Thanks for any support,

Breno

Simulink-OROCOS error

> On Thu, Aug 6, 2009 at 11:17 PM, <breno [..] ...> wrote:
>> Hi Klaas, sorry send you another e-mail but do you have the mdl from
>> Simulink-OROCOS tutorial available? Case yes, could you send me for
>> test?
>
> I haven't :-(
>
>> Where the code on page 6 is supposed to be?
>
> You don't need that at this point in time I guess??
>
> Klaas
>
Hi Klaas, that's odd!!! I got no errors running the same application in
Matlab for Windows. Unfortunately I can't use it at my workplace because
we are forbidden to use windows without license. :\

Could be any configuration in Matlab for Linux, don't you think? Do you
run it on Linux? I use Ubuntu LTS 7.04.3!!! Is there any configuration
that have to be done besides the default ones done during installation of
Matlab on Unix systems?

Regards,

Breno

Simulink-OROCOS error

[please keep the ML in cc:; private support is only possible via klaas [..] ... ;-)]

On Fri, 7 Aug 2009, Breno wrote:
[...]
> Hi Klaas, once and again!!! I got some improvements on my attempts. With the
> mdl attached, Matlab returned an error:
>
> ### Processing Template Makefile: /opt/matlab/rtw/c/orocos/orocos.tmf
> ### Creating orocostest.mk from /opt/matlab/rtw/c/orocos/orocos.tmf
> ### Building orocostest: /opt/matlab/bin/glnx86/gmake -f orocostest.mk
> GENERATE_REPORT=0 MODELLIB=orocostestlib.a RELATIVE_PATH_TO_ANCHOR=..
> MODELREF_TARGET_TYPE=NONE
> gcc -c -DRT -DUSE_RTMODEL -DOROCOS_TARGET=gnulinux
> -I/usr/local/orocos/orocos-rtt-1.8.4/include -Wall -fPIC -DDBGPRT -O2
> -DMODEL=orocostest -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DUNIX -DRT_MALLOC
> -DMT=0 -DOCL_DLL_EXPORT -I. -I.. -I/opt/matlab/simulink/include
> -I/opt/matlab/extern/include -I/opt/matlab/rtw/c/src
> -I/opt/matlab/rtw/c/libsrc -I/opt/matlab/rtw/c/orocos/devices
> -I/home/breno/Diversos/OROCOS/orocostest_orocos -I/home/breno/Diversos/OROCOS
> "-I/opt/matlab/rtw/rtwdemos/EmbeddedCoderOverview/CodeMetricFiles/PCG_Eval_CodeMetrics_1"
> -I/opt/matlab/rtw/c/orocos/include -ffast-math orocostest.c
> orocostest.c: In function ‘orocostest’:
> orocostest.c:400: error: parse error before ‘*’ token
> gmake: *** [orocostest.o] Error 1
> ### Real-Time Workshop build procedure for model: 'orocostest' aborted due to
> an error.
>
> Have you ever seen this before?

Might be, but if I can't see the line, I'm not sure. I guess you ran into a "known issue". Try uncommenting the line and please post the line and report back wether that solves the problem. If my assumption is correct, we should put that in bugzilla asap.

best regards,

Klaas

Simulink-OROCOS error

Klaas Gadeyne wrote:
> [please keep the ML in cc:; private support is only possible via
> klaas [..] ... ;-)]
>
> On Fri, 7 Aug 2009, Breno wrote:
> [...]
>> Hi Klaas, once and again!!! I got some improvements on my attempts.
>> With the mdl attached, Matlab returned an error:
>>
>> ### Processing Template Makefile: /opt/matlab/rtw/c/orocos/orocos.tmf
>> ### Creating orocostest.mk from /opt/matlab/rtw/c/orocos/orocos.tmf
>> ### Building orocostest: /opt/matlab/bin/glnx86/gmake -f
>> orocostest.mk GENERATE_REPORT=0 MODELLIB=orocostestlib.a
>> RELATIVE_PATH_TO_ANCHOR=.. MODELREF_TARGET_TYPE=NONE
>> gcc -c -DRT -DUSE_RTMODEL -DOROCOS_TARGET=gnulinux
>> -I/usr/local/orocos/orocos-rtt-1.8.4/include -Wall -fPIC -DDBGPRT -O2
>> -DMODEL=orocostest -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DUNIX
>> -DRT_MALLOC -DMT=0 -DOCL_DLL_EXPORT -I. -I..
>> -I/opt/matlab/simulink/include -I/opt/matlab/extern/include
>> -I/opt/matlab/rtw/c/src -I/opt/matlab/rtw/c/libsrc
>> -I/opt/matlab/rtw/c/orocos/devices
>> -I/home/breno/Diversos/OROCOS/orocostest_orocos
>> -I/home/breno/Diversos/OROCOS
>> "-I/opt/matlab/rtw/rtwdemos/EmbeddedCoderOverview/CodeMetricFiles/PCG_Eval_CodeMetrics_1"
>> -I/opt/matlab/rtw/c/orocos/include -ffast-math orocostest.c
>> orocostest.c: In function ‘orocostest’:
>> orocostest.c:400: error: parse error before ‘*’ token
>> gmake: *** [orocostest.o] Error 1
>> ### Real-Time Workshop build procedure for model: 'orocostest'
>> aborted due to an error.
>>
>> Have you ever seen this before?
>
> Might be, but if I can't see the line, I'm not sure. I guess you ran
> into a "known issue". Try uncommenting the line and please post the
> line and report back wether that solves the problem. If my assumption
> is correct, we should put that in bugzilla asap.
>
> best regards,
>
> Klaas
Hi Klass, first of all I reinstalled the Matlab on my machine so then
some initial errors were solved.
Bu it's been pretty hard to get some others thing through to me.... The
Matlab gmake command don't set the path of .h files correctly and so I
did it by myself and force g++ command as you can see on attached file
gambi.sh. It worth notice that all include's path are set on
component.mk file....
But I get solved most of my problems...

Now I have another error that came up after attempt of compilation
posted below:

oot@breno-HP:/home/breno/Diversos/OROCOS/component_orocos# ./gambi.sh
component.h: In member function ‘virtual bool
Example::ModelUser::configureHook()’:
component.h:1263: error: no matching function for call to
‘Example::ModelUser::connectPorts(RTT::TaskContext*&,
Example::ModelUser* const)’
/usr/local/orocos/orocos-rtt-1.8.4/include/rtt/TaskContext.hpp:188:
note: candidates are: virtual bool
RTT::TaskContext::connectPorts(RTT::TaskContext*)
component.cpp: In function ‘rtModel_component* component()’:
component.cpp:648: error: expected `)' before ‘*’ token
component.cpp:648: error: expected `)' before ‘*’ token
component.cpp:648: error: expected initializer before ‘*’ token
component.cpp:727: error: ‘RTWSfcnInfo’ was not declared in this scope
component.cpp:727: error: ‘sfcnInfo’ was not declared in this scope
component.cpp:727: error: expected primary-expression before ‘)’ token
component.cpp:727: error: expected `;' before ‘malloc’
component.cpp:730: error: ‘rtssSetErrorStatusPtr’ was not declared in
this scope
component.cpp:731: error: ‘rtssSetNumRootSampTimesPtr’ was not declared
in this scope
component.cpp:732: error: ‘rtssSetTPtrPtr’ was not declared in this scope
component.cpp:733: error: ‘rtssSetTStartPtr’ was not declared in this scope
component.cpp:734: error: ‘rtssSetTFinalPtr’ was not declared in this scope
component.cpp:735: error: ‘rtssSetTimeOfLastOutputPtr’ was not declared
in this scope
component.cpp:736: error: ‘rtssSetStepSizePtr’ was not declared in this
scope
component.cpp:737: error: ‘rtssSetStopRequestedPtr’ was not declared in
this scope
component.cpp:739: error: ‘rtssSetDerivCacheNeedsResetPtr’ was not
declared in this scope
component.cpp:741: error: ‘rtssSetZCCacheNeedsResetPtr’ was not declared
in this scope
component.cpp:742: error: ‘rtssSetBlkStateChangePtr’ was not declared in
this scope
component.cpp:743: error: ‘rtssSetSampleHitsPtr’ was not declared in
this scope
component.cpp:745: error: ‘rtssSetPerTaskSampleHitsPtr’ was not declared
in this scope
component.cpp:746: error: ‘rtssSetSimModePtr’ was not declared in this scope
component.cpp:747: error: ‘rtssSetSolverInfoPtr’ was not declared in
this scope

I don't intend to use Simulink and Orocos anymore but if it could be
solved then can really help someone else!!!

Btw I'm using gcc version 4.1.3 20080308. Is that ok?

Thanks for all,

Breno