GPSDev Function Unrecognized- ESP32 and GT-U7

조회 수: 7 (최근 30일)
Dara
Dara 2025년 1월 15일
편집: Dara 2025년 1월 16일
When I run the first two code segments I get NaN/NaT or just no output but no error and when I the last two I get the error "Unrecognized function or variable 'gpsdev'. I have tested the set up using the arduinoIDE and I get proper GPS output through that. I have also checked the baud rate, the communication between the esp32 and computer and that there is proper physical connection. Do you know why I am getting this error/no output? What is the best method to trouble shoot these errors? Any tips would be greatly appreciated. Thank you.
Update: Using code 3 I reinstalled the Navigation toolbox and am now getting this error:
"Error using IMUReadings
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS
device to the specified serial port and the configuration of the GPS device."
1.
a = arduino('COM3','ESP32-WROOM-DevKitC','Libraries','Serial')
gps = gpsdev(a)
gpsData = gps.read;
latitude = gpsData.LLA(1);
longitude = gpsData.LLA(2);
gpsTime = gpsData.GPSReceiverTime;
% GPS returns UTC datetime. Convert it into system time zone.
gpsTime.TimeZone = 'local';
if(~isnan(latitude) && ~isnan(longitude))
% plot the position in geographic coordinates
fig = geoplot(latitude,longitude,'Marker',"o",'MarkerSize',6,'Color','red','MarkerFaceColor','red');
% Sets the latitude and longitude limits of the base Map
geolimits([latitude-0.05,latitude+0.05],[longitude-0.05,longitude+0.05]) ;
% Selects the basemap
geobasemap streets;
timeString = strcat("Timestamp: ",string(gpsTime));
2.
a = arduino('COM3','ESP32-WROOM-DevKitC','Libraries','Serial')
gps = gpsdev(a)
[tt,overruns] = read(gps)
3.
gps = gpsdev('COM3','OutputFormat',"timetable")
[tt,overruns] = read(gps)
release(gps)
gps.SamplesPerRead = 2;
read(gps)
4.
s = serialport('COM3', 9600)
gps = gpsdev(s,'OutputFormat',"matrix")
[lla,speed,course,dops,gpsReceiverTime,timestamp,overruns] = read(gps)
%delete(gps);
%clear gps;
%clear a;
*These codes are adapted from MATWORKS references either by staff or other users
  댓글 수: 2
Walter Roberson
Walter Roberson 2025년 1월 15일
gpsdev() passed a port name or serialport() object requires the Navigation Toolbox R2020b or later.
gpsdev() passed an arduino object requires the MATLAB Support Package for Arduino, R2020b or later.
Dara
Dara 2025년 1월 16일
편집: Dara 2025년 1월 16일
The Navigation Toolbox and MATLAB Support Package for Arduino are installed and I am running MATALB R2023a. This is the error I am recieving when using the last two code segments. Do you have any other ideas as to why I am recieving this error or no data? Thank you.
"Error using IMUReadings
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS
device to the specified serial port and the configuration of the GPS device."

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by