Can we use custom markers to plot trajectory

19 ビュー (過去 30 日間)
Sourav Sinha
Sourav Sinha 2020 年 12 月 23 日
コメント済み: Ravi 2024 年 5 月 30 日
Is there a way I can use a figure as custom marker to represent the trajectory of an unamanned aerial system. I also need it to represent the orientation of the UAS at any point on the trajectory.
I have attached examples that I found in some papers.

回答 (1 件)

Milan Padhiyar
Milan Padhiyar 2020 年 12 月 28 日
Hello Sourav,
Please find here example code to use the custom marker in the MATLAB plots.
x = [1 2 3 4 5 6 7 8 9 10]; % x data
y = [2 7 8 4 10 3 5 9 6 1]; % y data
marker = imread('aeroplane.png'); % read image file
markerSize = [1,1]; % The size of marker is expressed in axis units, NOT in pixels
x_L = x - markerSize(1)/2; % left edge of marker
x_R = x + markerSize(1)/2; % right edge of marker
y_B = y - markerSize(2)/2; % bottom edge of marker
y_T = y + markerSize(2)/2; % top edge of marker
for index = 1:length(x)
imagesc([x_L(index) x_R(index)], [y_T(index) y_B(index)], marker) % warn range of the marker. It is reverse Top to Bottom. Not Bottom to Top
hold on
end
axis([0 11 0 11]) % set axis limit
axis equal
ax = gca;
ax.YDir = 'normal'; % reverse the y axis
plot(x,y)
grid minor;
grid on;
We can use "imread" function to import the marker and for plotting we can use "imagesc" and "plot" functions.
Thanks
  3 件のコメント
Sam Chak
Sam Chak 2024 年 5 月 30 日
I guess you want use a custom 3D object marker where its orientation (attitude) is relative to a fixed reference frame (XYZ). In that case, you must also provide the attitude data that correspond to the position data points.
Since the 3D object is relatively large, you should only plot the markers every few position points.
Ravi
Ravi 2024 年 5 月 30 日
thanks, could you provide some example like for the question which was asked for aircraft

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by