Rigid Body Tree Visualization
The sl3dex_rigidbodytree example demonstrates the functionality of the Simulink® 3D Animation™ VR RigidBodyTree block.
The VR RigidBodyTree block inserts visual representation of a Robotics System Toolbox™ RigidBodyTree object in the virtual world and displays it in the virtual reality viewer. During simulation, the rigid body tree is subsequently animated according to the configuration defined in the Config input.
In this example, the manipulator configuration is provided by the Robotics System Toolbox Inverse Kinematics block. You can use the sliders to change the robot end-effector position and orientation about one axis.
After inserting the robot, the virtual world can be saved using the viewer Save As... menu option. If you leave the "Always use robot definition from the RigidBodyTree object" checkbox unchecked, in subsequent simulations the VR RigidBodyTree block doesn't insert the robot from the RigidBodyTree object in the workspace, but instead uses the robot instance previously saved in the virtual world file. This allows further changes to the robot visual appearance and functionality in the 3D World Editor (any changes that preserve the robot structure and link names are allowed - adjusting link colors, changing individual link shapes, adding collision sensors, etc.).
The VR RigidBodyTree block functionality assumes that the 3D graphics properties are defined in the RigidBodyTree object.
This example requires Robotics System Toolbox.