This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Get Transform

Get transform between body frames

  • Library:
  • Robotics System Toolbox / Manipulator Algorithms


The Get Transform block returns the homogeneous transformation between body frames on the Rigid body tree robot model. Specify a RigidBodyTree object for the robot model, and select a source and target body in the block.

The block uses Config, the robot configuration (joint positions) input, to calculate the transformation from the source body to the target body. This transformation is used to convert coordinates from the source to the target body. To convert to base coordinates, use the base body name as the Target body parameter.



expand all

Robot configuration, specified as a vector of positions for all nonfixed joints in the robot model, as set by the Rigid body tree parameter. You can also generate this vector for a complex robot using the homeConfiguration or randomConfiguration functions inside a Constant or MATLAB Function block.


expand all

Homogeneous transform, returned as a 4-by-4 matrix.


expand all

Robot model, specified as a RigidBodyTree object. You can also import a robot model from an URDF (Unified Robot Description Formation) file using importrobot.

The default robot model, twoJointRigidBodyTree, is a robot with revolute joints and two degrees of freedom.

Target body name, specified as a body name from the robot model specified in Rigid body tree. To access body names from the robot model, click Select body. The target frame is the coordinate system you want to transform points into.

Source body name, specified as a body name from the robot model specified in Rigid body tree.To access body names from the robot model, click Select body. The source frame is the coordinate system you want points transformed from.

  • Interpreted execution — Simulate model using the MATLAB® interpreter. This option shortens startup time but has a slower simulation speed than Code generation. In this mode, you can debug the source code of the block.

  • Code generation — Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time, but the speed of the subsequent simulations is comparable to Interpreted execution.

Tunable: No

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2018a