Documentation

Code Generation

Generate C/C++ code and MEX functions for algorithm acceleration and standalone ROS nodes

MATLAB®Coder™generates standalone C/C++ code from Robotics System Toolbox™ functions and classes that have been enabled to support code generation. Using the toolbox withMATLAB Coder, you can generate ANSI-compliant C code or MEX functions.

Also, you can generate C++ code for a standalone ROS node from a Simulink®model. You can then transfer and run the generated C++ code in a Linux ROS environment, which is built and run independent of Simulink. SeeGenerate a Standalone ROS Node from Simulink®for an example generating a standalone ROS node.

The listed functions, classes, and blocks support code generation with Robotics System Toolbox.

Functions

axang2quat Convert axis-angle rotation to quaternion
axang2rotm Convert axis-angle rotation to rotation matrix
axang2tform Convert axis-angle rotation to homogeneous transformation
eul2quat Convert Euler angles to quaternion
eul2rotm Convert Euler angles to rotation matrix
eul2tform Convert Euler angles to homogeneous transformation
quat2axang Convert quaternion to axis-angle rotation
quat2eul Convert quaternion to Euler angles
quat2rotm Convert quaternion to rotation matrix
quat2tform Convert quaternion to homogeneous transformation
rotm2axang Convert rotation matrix to axis-angle rotation
rotm2eul Convert rotation matrix to Euler angles
rotm2quat Convert rotation matrix to quaternion
rotm2tform Convert rotation matrix to homogeneous transformation
tform2axang Convert homogeneous transformation to axis-angle rotation
tform2eul Extract Euler angles from homogeneous transformation
tform2quat Extract quaternion from homogeneous transformation
tform2rotm Extract rotation matrix from homogeneous transformation
tform2trvec Extract translation vector from homogeneous transformation
angdiff Difference between two angles
cart2hom Convert Cartesian coordinates to homogeneous coordinates
hom2cart Convert homogeneous coordinates to Cartesian coordinates
trvec2tform Convert translation vector to homogeneous transformation
transformScan Transform laser scan based on relative pose

Classes

robotics.InverseKinematics Create inverse kinematic solver
robotics.GeneralizedInverseKinematics 创建多约束的逆运动学解算器
robotics.PurePursuit Create controller to follow set of waypoints
robotics.RigidBodyTree Create tree-structured robot
robotics.VectorFieldHistogram Avoid obstacles using vector field histogram

Blocks

Blank Message Create blank message using specified message type
Get Parameter Get values from ROS parameter server
Publish Send messages to ROS network
Pure Pursuit Linear and angular velocity control commands
Set Parameter Set values on ROS parameter server
Subscribe Receive messages from ROS network
Vector Field Histogram Avoid obstacles using vector field histogram

Topics

Generate a Standalone ROS Node from Simulink®

This example shows you how to generate and build a standalone ROS node from a Simulink model.

Code Generation from MATLAB Code

Several Robotics System Toolbox functions are enabled to generate C/C++ code.

Code Generation Support, Usage Notes and Limitations

To generate code from MATLAB code that contains Robotics System Toolbox functions, classes, or System objects, you must have theMATLAB Codersoftware.

Accelerate Robotics Algorithms with Code Generation

You can generate code for select Robotics System Toolbox algorithms to speed up their execution.

Enable External Mode for Robotics System Toolbox Models

External mode enables Simulink on your host computer to communicate with a deployed model on your robotics hardware during runtime.

调整参数和查看信号部署机器人Models Using External Mode

External mode enables Simulink models on your host computer to communicate with a deployed model on your robot hardware during runtime.

Was this topic helpful?