Please contact the author of the third party Toolkit, that you are using for assistance regarding this error.
Java in simulink code - EV3
2 次查看(过去 30 天)
显示 更早的评论
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."
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!