interactiveRigidBodyTree
Interact with rigid body tree robot models
Description
TheinteractiveRigidBodyTree
object creates a figure that displays a robot model using arigidBodyTree
object and enables you to directly modify the robot configuration using an interactive marker. TherigidBodyTree
object defines the geometry of the different connected rigid bodies in the robot model and the joint limits for these bodies.
To compute new configurations using inverse kinematics, click and drag the interactive marker in the figure. The marker supports dragging of the center marker, linear motion along specific axes, and rotation about each axes. You can change the end effector by right-clicking a different body and choosingSet body as marker body.
To save the current configuration of the robot model, use theaddConfiguration
object function. TheStoredConfigurationsproperty contains the saved configurations.
By default, the joint limits of the robot model are the only constraint on the robot. To add additional constraints, use theaddConstraint
object function. For a list of available constraint objects, seeRobot ConstraintsinInverse Kinematics.
Creation
Syntax
Description
creates an interactive rigid body tree object and associated figure for the specified robot model. Theviztree
= interactiveRigidBodyTree(robot
)robot
argument sets theRigidBodyTree
property. To interact with the model, click and drag the interactive marker in the figure.
turns off the frame axes plotted for each joint in the robot model.viztree
= interactiveRigidBodyTree(robot
,'Frames','off')
sets properties using one or more name-value pair arguments in addition to any of the input argument combinations in previous syntaxes. Enclose each property name in quotes. For example,viztree
= interactiveRigidBodyTree(___,Name,Value)'RigidBodyTree',robot
creates an interactive rigid body tree object with the specified robot model.
Properties
Object Functions
addConfiguration |
Store current configuration |
addConstraint |
Add inverse kinematics constraint |
removeConfigurations |
Remove configurations fromStoredConfigurations property |
removeConstraints |
Remove inverse kinematics constraints |
showFigure |
Show interactive rigid body tree figure |
Examples
Limitations
If the
interactiveRigidBodyTree
object is deleted while the figure is still open, the interactivity of the figure is disabled and the title of the figure is updated.
Tips
To maximize performance when visualizing complex robot models with complex meshes, ensure you enable hardware-accelerated OpenGL. By default, MATLAB®uses hardware-accelerated OpenGL if your graphics hardware supports it. For more information, see the
opengl
function.