Java in simulink code - EV3
Ältere Kommentare anzeigen
Hello,
I am using this MATLAB toolkit: https://wiki.qut.edu.au/display/cyphy/QUT+EV3+MATLAB+toolkit to program an EV3 robot. My problem is that I am trying to access a part of this code simply by saying:
"b = Brick('ioType','wifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')" but if I try to run it I first got an error about varagin not being allowed here but I went around that problem and now it tells me:
"Import statements are currently unsupported.
Function 'wfBrickIO.m' (#72.2759.2765), line 74, column 13: "import"".
The part of code that causes problem in wfBrickIO.m is:
% import the required java libraries
import java.io.*;
import java.net.*;
% add the java path to the class path
javaaddpath .
% open the brick IO connection
brickIO.handle = Socket(brickIO.addr, brickIO.port);
% set the input stream
brickIO.inputStream = DataInputStream(brickIO.handle.getInputStream);
% set the output stream
brickIO.outputStream = OutputStreamSend();
% connection message to the brick
wmsg = ['GET /target?sn=' brickIO.serialNum ' VMTP1.0' char(10) 'Protocol: EV3'];
if brickIO.debug > 0
fprintf('Sent: [ %s ]\n',char(wmsg));
end
% send the connection message
brickIO.write(wmsg);
% receive the reply
rmsg = brickIO.read;
if brickIO.debug > 0
fprintf('Returned: [ %s ]\n',char(rmsg));
end
What could I do ? I tried to say "coder.extrinsic('Brick')" but then I got an error saying that Code Generation needed 'Brick'. I tried "coder.extrinsic('wfBrickIO')" but then it tells me that: "Code generation does not support class properties of mxArray type."
1 Kommentar
Sharmila Raghu
am 29 Dez. 2016
Please contact the author of the third party Toolkit, that you are using for assistance regarding this error.
Antworten (0)
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!