Using signal values in a block that accepts variables in Simscape Multibody
1 次查看(过去 30 天)
显示 更早的评论
Hi there,
I want to create a frame at the centroid of a bunch of frame origins. I tracked these frames through the Transform Sensor block, and calculated the coordinates of the centroid. Now, I can't seem to figure out how to use these x,y,z coordinates in the rigid transform block (B frame will be connected to the fixed reference) so that F frame is translated in space by x,y,z amounts in the respective directions.
Can't I use these signal inputs in the block (like [x_coord y_coord z_coord] in the place of [0 0 0])?
Any help is highly appreciated. Thank you.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1674121/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1674121/image.png)
0 个评论
回答(1 个)
Sayan
2024-5-3
Hi Siril TD,
This can be done by sending the values of "x_coord", "y_coord", "z_coord" to the base workspace. You can do this by using the "To Workspace" blocks. After finding the x, y, and z coordinates, you can send their value to the "To Workspace" blocks.
If you want to use this value only by name without referring to the single simulation output structure, you need to uncheck the "Single simulation output" option by going to Configuration Parameters -> Data Import/Export.
In this case, you need to ensure the execution order of the "To Workspace" blocks is ahead of the "Rigid Transform" block. On the Debug tab, select Information Overlays > Execution Order to find the execution order of the blocks.
You can find more information on controlling and finding the execution order of the Simulink blocks in this documentation.
Further information on the "To Workspace" blocks can be found in the following documenation.
Hope this answers the query.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!