Including multiple actors in Simulink 3D animation with asbQuadcopter model

6 vues (au cours des 30 derniers jours)
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!

Réponse acceptée

Nishan Nekoo
Nishan Nekoo le 10 Oct 2024
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 commentaires
Benjamin Campbell
Benjamin Campbell le 10 Oct 2024
You're a hero, that works perfectly, thanks so much Nishan!
Nishan Nekoo
Nishan Nekoo le 10 Oct 2024
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Aerospace Applications dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by