Grab object in Simulink 3D to adjust conditions

조회 수: 1 (최근 30일)
Brian Munguia
Brian Munguia 2012년 7월 30일
I have been attempting to make changes to the bouncing ball example for Simulink 3D. I want to be able to grab the ball in order to adjust the initial height (say on the range from 0 to 20) and have everything adjust accordingly. In my VRML file I have a planesensor called Grab and a transform called Ball, and I used the command "ROUTE Grab.translation_changed TO Ball.set_translation" to feed the user input to the ball's initial translation. However, whenever I move the ball then start the simulation, it returns to its original position of 20 (the translation I set in V-Realm Builder). Does anyone have any input as to how I can adjust the ball's initial position by grabbing it during or outside of simulation? I would prefer to know how to do it during (it is more applicable to my specific research application) but I would appreciate any information. Thank you.

답변 (3개)

Sumit Tandon
Sumit Tandon 2012년 7월 30일
In the documentation for Simulink 3D Animation, there is a demo called "Portal Crane with Control Panel". It has a control panel in the scene with you can set position of crane while the model is simulating.
It uses the VR Source block to bring data from virtual world to Simulink model. See http://www.mathworks.com/help/releases/R2012a/toolbox/sl3d/vrsource.html:
Hope this helps.

Jan Danek
Jan Danek 2012년 8월 14일
Hi Brian,
If you want to adjust the initial position outside of simulation, you can use this:
ROUTE Grab.translation_changed TO Ball.set_translation
, but then you have to save the virtual world to the file to reflect the change (File - Save in the Viewer). At the beginning of each simulation, the world gets reloaded from the file...
Jan

Jan Danek
Jan Danek 2012년 8월 14일
Have a look also at the "vrmaglev" example.

카테고리

Help CenterFile Exchange에서 Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by