Arduino Engineering kit final challenge mobile rover 5.9

조회 수: 1 (최근 30일)
mario bergognoni
mario bergognoni 2019년 6월 12일
댓글: Mihai Cebotari 2021년 6월 2일
Hi
I'm trying to transmit from Matlab to Simulink a matrix waypoints ( 3x2 double ) over wifi and then start the mobile rover in AEK.
I used to start the code deployed on arduino mkr1000 an enabled subsystem and start fine, but don't follow the waypoints spin around on itself.
From matllab i send a simple test code over wifi sending a vector 1x6 to simulink and I noticed using a serial transmit like feedback that work fine so i don't understand what's wrong.
Not using wifi but embedding the matrix waypoints in simulink the rover work fine
Here test code:
clear;
close all;
clc;
Waypoints=[10 10; 30 40; 10 60];
%Send Waypoints
t = tcpip('192.168.1.10',25000);
t.ByteOrder = 'littleEndian';
fopen(t);
vector=Waypoints(1,:);
for ii=2:(size(Waypoints,1));
vector=[vector,Waypoints(ii,:)]
end
% Sending vector of Waypoints
fwrite(t,vector,'double');
fclose(t);
%Start subsystem
t1 = tcpip('192.168.1.10',25001);
t1.ByteOrder = 'littleEndian';
% Sending Flag for subsystem starting
fopen(t1);
setFlag = 1;
resetFlag = 0;
fwrite(t1,resetFlag,'double');
fwrite(t1,setFlag,'double');
fclose(t1);
Here the Simullink code deployed on the rover
rover.jpg
Thank you for any advice
Mario
  댓글 수: 1
Mihai Cebotari
Mihai Cebotari 2021년 6월 2일
Hello Mario,
Did you manage to make it work ?
Thank you in advance.
Best regards,
Mihai C.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by