How to create a fixed user who receives GNSS signals within a map made from 3D plot?
https://kr.mathworks.com/help/nav/ug/simulate-gnss-multipath-effects-on-uav-flying-in-urban-environment.html
I would like to refer to the example of matlab above to create a user who is statically fixed in the middle of the map, not a user who moves along the trajectory.
So I modified it a little bit and wrote the code, and when I run it, the figure comes out well, but there’s an unknown error, so I need some help.
Error using fusion.internal.GPSSensorBase/validateInputsImpl (line 302)
Expected input to be an array with number of columns equal to 3.
Error in deepseek_v01 (line 31)
[lla, velocity] = gps(position, zeros(1,3));
^^^^^^^^^^^^^^^^^^^^^^^^^
I’m getting this error, and I’m curious about the solution. I’m also curious if there’s any problem even if I ignore the error and use it.
The .osm file I use is not attached, so you can use the .osm file that Matlab supports by default.
referenceLocation = [37.498759 127.027487 0];
scene = uavScenario(‘ReferenceLocation’, referenceLocation, ‘UpdateRate’, 10, ‘StopTime’, Inf);
buildingColor = [0.8 0.8 0.8];
if isfile(‘gangnam_11exit.osm’)
addMesh(scene, ‘buildings’, {‘gangnam_11exit.osm’, [-250 250], [-250 250], ‘auto’}, buildingColor);
else
addMesh(scene, ‘buildings’, {‘random’, [-150 150], [-150 150], [10 50]}, buildingColor);
end
user = uavPlatform(‘User’, scene, ‘ReferenceFrame’, ‘ENU’, ‘InitialPosition’, [0 0 80]);
gps = gpsSensor(‘UpdateRate’, 10, …
‘ReferenceLocation’, referenceLocation, …
‘HorizontalPositionAccuracy’, 1.6, …
‘VerticalPositionAccuracy’, 3.0, …
‘VelocityAccuracy’, 0.1);
fig = figure(‘Name’,’Static GNSS User’);
ax = show3D(scene);
hold(ax, ‘on’);
axis(ax, ‘equal’);
grid(ax, ‘on’);
view(ax, 3);
plot3(ax, 0, 0, 80, ‘ro’, ‘MarkerSize’, 12, ‘MarkerFaceColor’, ‘r’);
setup(scene);
while ishandle(fig)
[position, orientation] = user.read();
[lla, velocity] = gps(position, zeros(1,3));
fprintf(‘[ENU Position] X: %.2fm, Y: %.2fm, Z: %.2fmn’, position(1), position(2), position(3));
fprintf(‘[GPS Coordinates] Lat: %.6f°, Lon: %.6f°, Alt: %.2fmnn’, lla(1), lla(2), lla(3));
show3D(scene, ‘Parent’, ax, ‘FastUpdate’, true);
drawnow limitrate;
advance(scene);
endhttps://kr.mathworks.com/help/nav/ug/simulate-gnss-multipath-effects-on-uav-flying-in-urban-environment.html
I would like to refer to the example of matlab above to create a user who is statically fixed in the middle of the map, not a user who moves along the trajectory.
So I modified it a little bit and wrote the code, and when I run it, the figure comes out well, but there’s an unknown error, so I need some help.
Error using fusion.internal.GPSSensorBase/validateInputsImpl (line 302)
Expected input to be an array with number of columns equal to 3.
Error in deepseek_v01 (line 31)
[lla, velocity] = gps(position, zeros(1,3));
^^^^^^^^^^^^^^^^^^^^^^^^^
I’m getting this error, and I’m curious about the solution. I’m also curious if there’s any problem even if I ignore the error and use it.
The .osm file I use is not attached, so you can use the .osm file that Matlab supports by default.
referenceLocation = [37.498759 127.027487 0];
scene = uavScenario(‘ReferenceLocation’, referenceLocation, ‘UpdateRate’, 10, ‘StopTime’, Inf);
buildingColor = [0.8 0.8 0.8];
if isfile(‘gangnam_11exit.osm’)
addMesh(scene, ‘buildings’, {‘gangnam_11exit.osm’, [-250 250], [-250 250], ‘auto’}, buildingColor);
else
addMesh(scene, ‘buildings’, {‘random’, [-150 150], [-150 150], [10 50]}, buildingColor);
end
user = uavPlatform(‘User’, scene, ‘ReferenceFrame’, ‘ENU’, ‘InitialPosition’, [0 0 80]);
gps = gpsSensor(‘UpdateRate’, 10, …
‘ReferenceLocation’, referenceLocation, …
‘HorizontalPositionAccuracy’, 1.6, …
‘VerticalPositionAccuracy’, 3.0, …
‘VelocityAccuracy’, 0.1);
fig = figure(‘Name’,’Static GNSS User’);
ax = show3D(scene);
hold(ax, ‘on’);
axis(ax, ‘equal’);
grid(ax, ‘on’);
view(ax, 3);
plot3(ax, 0, 0, 80, ‘ro’, ‘MarkerSize’, 12, ‘MarkerFaceColor’, ‘r’);
setup(scene);
while ishandle(fig)
[position, orientation] = user.read();
[lla, velocity] = gps(position, zeros(1,3));
fprintf(‘[ENU Position] X: %.2fm, Y: %.2fm, Z: %.2fmn’, position(1), position(2), position(3));
fprintf(‘[GPS Coordinates] Lat: %.6f°, Lon: %.6f°, Alt: %.2fmnn’, lla(1), lla(2), lla(3));
show3D(scene, ‘Parent’, ax, ‘FastUpdate’, true);
drawnow limitrate;
advance(scene);
end https://kr.mathworks.com/help/nav/ug/simulate-gnss-multipath-effects-on-uav-flying-in-urban-environment.html
I would like to refer to the example of matlab above to create a user who is statically fixed in the middle of the map, not a user who moves along the trajectory.
So I modified it a little bit and wrote the code, and when I run it, the figure comes out well, but there’s an unknown error, so I need some help.
Error using fusion.internal.GPSSensorBase/validateInputsImpl (line 302)
Expected input to be an array with number of columns equal to 3.
Error in deepseek_v01 (line 31)
[lla, velocity] = gps(position, zeros(1,3));
^^^^^^^^^^^^^^^^^^^^^^^^^
I’m getting this error, and I’m curious about the solution. I’m also curious if there’s any problem even if I ignore the error and use it.
The .osm file I use is not attached, so you can use the .osm file that Matlab supports by default.
referenceLocation = [37.498759 127.027487 0];
scene = uavScenario(‘ReferenceLocation’, referenceLocation, ‘UpdateRate’, 10, ‘StopTime’, Inf);
buildingColor = [0.8 0.8 0.8];
if isfile(‘gangnam_11exit.osm’)
addMesh(scene, ‘buildings’, {‘gangnam_11exit.osm’, [-250 250], [-250 250], ‘auto’}, buildingColor);
else
addMesh(scene, ‘buildings’, {‘random’, [-150 150], [-150 150], [10 50]}, buildingColor);
end
user = uavPlatform(‘User’, scene, ‘ReferenceFrame’, ‘ENU’, ‘InitialPosition’, [0 0 80]);
gps = gpsSensor(‘UpdateRate’, 10, …
‘ReferenceLocation’, referenceLocation, …
‘HorizontalPositionAccuracy’, 1.6, …
‘VerticalPositionAccuracy’, 3.0, …
‘VelocityAccuracy’, 0.1);
fig = figure(‘Name’,’Static GNSS User’);
ax = show3D(scene);
hold(ax, ‘on’);
axis(ax, ‘equal’);
grid(ax, ‘on’);
view(ax, 3);
plot3(ax, 0, 0, 80, ‘ro’, ‘MarkerSize’, 12, ‘MarkerFaceColor’, ‘r’);
setup(scene);
while ishandle(fig)
[position, orientation] = user.read();
[lla, velocity] = gps(position, zeros(1,3));
fprintf(‘[ENU Position] X: %.2fm, Y: %.2fm, Z: %.2fmn’, position(1), position(2), position(3));
fprintf(‘[GPS Coordinates] Lat: %.6f°, Lon: %.6f°, Alt: %.2fmnn’, lla(1), lla(2), lla(3));
show3D(scene, ‘Parent’, ax, ‘FastUpdate’, true);
drawnow limitrate;
advance(scene);
end matlab, gnss, gps, optimization, error MATLAB Answers — New Questions