このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
コード生成
MATLAB®Coder™は、コード生成のサポートが有効になっている Robotics System Toolbox™ の関数およびクラスから、スタンドアロンの C/C++ コードを生成します。ツールボックスとMATLAB Coderを使用すると、ANSI 準拠 C コードまたは MEX 関数を生成できます。
コード生成サポートの完全なリストを表示するには、Functions Supporting Code Generationを参照してください。任意のリファレンス ページの(扩展功能)セクションを表示することもできます。
トピック
- Accelerate Robotics Algorithms with Code Generation
You can generate code for select Robotics System Toolbox algorithms to speed up their execution. Set up the algorithm that supports code generation as a separate function that you can insert into your workflow. To use code generation, you must have aMATLAB Coderlicense. For a list of code generation support in Robotics System Toolbox, seeFunctions Supporting Code Generation.
- Generate Code for Inverse Kinematics Computation Using Robot from Robot Library
这前ample shows how to perform code generation to compute Inverse Kinematics (IK) using robots from the robot library. For this example, you can use an
inverseKinematics
object with an includedrigidBodyTree
robot model usingloadrobot
to solve for robot configurations that achieve a desired end-effector position. - Generate Code for Motion Planning Using Robot Model Imported from URDF
这前ample shows how to perform code generation to plan motion using robot model imported from URDF file. For this example, you use a
manipulatorRRT
object with a importedrigidBodyTree
robot model to find a obstacle-free path between two configurations of the robot. After you verify the algorithm in MATLAB®, use the generated MEX file in the algorithm to visualize the robot movement. - Code Generation from MATLAB Code
Several Robotics System Toolbox functions are enabled to generate C/C++ code. Code generation from MATLAB code requires theMATLAB Coderproduct. To generate code from robotics functions, follow these steps:Using the app, the basic workflow is:For a tutorial, see MATLAB Coder アプリを使用した C コードの生成 (MATLAB Coder).
- コード生成のサポート
Robotics System Toolbox の関数、クラス、または System object が含まれる MATLAB コードからコードを生成するには、MATLAB Coderソフトウェアがなければなりません。