Including multiple actors in Simulink 3D animation with asbQuadcopter model

8 次查看(过去 30 天)
I am using the asbQuadcopter model in Simulink to simulate a parrot minidrone. I want to test obstacle avoidance methods I have built which I test on moving objects. From plotting the data I can see it is working, but I want to export the animation of the drone for a video.
I can't figure out how to add these objects to the animation, and save the animation as a video. Starting with just one moving red sphere, how can I add this to the simulink 3D animation? Secondly, how can I save the animation as a video?
But I am still unsure on how it can be applied to the asbQuadcopter model to add another "actor". Thank you in advance!

采纳的回答

Nishan Nekoo
Nishan Nekoo 2024-10-10
Hi Benjamin,
You can add a Simulation 3D Actor block to your model to get a basic shape such as a red sphere.
In the initialization script, you can use the createShape function to create the sphere and specify its color. There should already be an example in there by default that is commented out for a box shape.
On the Inputs tab of the Simulation 3D Actor, you can specify properties that you would like to create an Inport for such as position or velocity and you can use these to move the red sphere around the scene.
Note that you will need to set the 'Mobility' property of the Actor to sim3d.utils.MobilityTypes.Movable in order to move it around the scene.
To record, unfortunately we don't have any built-in capabilities to record the Viewer yet, though this is an important feature that we are considering for inclusion in a future product release. For now, you will need to screen record to obtain a video.
I hope this helps, and please let me know if you have any additional questions.
Nishan
  4 个评论
Nishan Nekoo
Nishan Nekoo 2024-10-10
You're welcome! Don't hesitate to reach out if you have any additional questions or feedback, I'd love to hear from you.
Nishan

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Aerospace Applications 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by