Interact with rigid body tree robot models
The interactiveRigidBodyTree
object creates a figure that
displays a robot model using a rigidBodyTree
object and enables you to
directly modify the robot configuration using an interactive marker. The
rigidBodyTree
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 choosing Set body as marker body.
To save the current configuration of the robot model, use the addConfiguration
object function. The StoredConfigurations property 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 the addConstraint
object function. For a list of available constraint objects, see Robot
Constraints in Inverse Kinematics.
creates an interactive rigid body tree object and associated figure for the specified
robot model. The viztree
= interactiveRigidBodyTree(robot
)robot
argument sets the RigidBodyTree
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.
addConfiguration | Store current configuration |
addConstraint | Add inverse kinematics constraint |
removeConfigurations | Remove configurations from StoredConfigurations
property |
removeConstraints | Remove inverse kinematics constraints |
showFigure | Show interactive rigid body tree figure |
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.
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.