Insert waypoints into a simulink model

27 ビュー (過去 30 日間)
Islam Elnady
Islam Elnady 2018 年 1 月 19 日
コメント済み: Benjamin Alessio 2021 年 11 月 24 日
I'm guiding an UAV to land at a specific point on the ground. I have used some waypoints algorithm to create a set of waypoints (x,y) between the starting and ending points. I need to send these waypoints one by one to the flight Simulink model so that the model could switch to the next waypoint once the current one is reached. Any tips how I can do that ?
  3 件のコメント
Islam Elnady
Islam Elnady 2018 年 1 月 19 日
@birdman
Yes
Benjamin Alessio
Benjamin Alessio 2021 年 11 月 24 日
was this ever resolved?

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

回答 (1 件)

Birdman
Birdman 2018 年 1 月 19 日
One approach would be using To Workspace block in Simulink. I don't know how you configured and set your model but the usage of To Workspace block is as follows:
Consider your x and y data as 1000x1 vectors respectively. To be able to provide data to Simulink, you need to provide it with a time data which will imitate Simulink's simulation time. Therefore if we again consider x and y data to be a column vector, also consider that your time vector is a column vector as well and have same number of rows with your datas, in this case, construct the array as follows:
data=[time x y];
After you do this, write data to your block and separate the output of the To Workspace block with a Demux having an output of 2, to be able to use your x and y data.
Hope this helps.
  1 件のコメント
Islam Elnady
Islam Elnady 2018 年 1 月 19 日
編集済み: Islam Elnady 2018 年 1 月 19 日
Hi Birdman, Thank you for your answer. Do you mean From Workspace block? Yes I tried to to this, I created an array of xy and time but I couldn't synchronize it with Simulink model. For example, I need to take data[1,:] and send it to Simulink, and blocks any other data until data[1,:] is reached, and after that switch to data[2,:].

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

Community Treasure Hunt

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

Start Hunting!

Translated by