Code Generation
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
Classes
robotics.BinaryOccupancyGrid |
Create occupancy grid with binary values |
robotics.InverseKinematics |
Create inverse kinematic solver |
robotics.GeneralizedInverseKinematics |
Create multiconstraint inverse kinematics solver |
robotics.OccupancyGrid |
Create occupancy grid with probabilistic values |
robotics.ParticleFilter |
Create particle filter state estimator |
robotics.PurePursuit |
Create controller to follow set of waypoints |
robotics.PRM |
Create probabilistic roadmap path planner |
robotics.RigidBodyTree |
Create tree-structured robot |
robotics.VectorFieldHistogram |
Avoid obstacles using vector field histogram |
Blocks
Blank Message | Create blank message using specified message type |
Coordinate Transformation Conversion | Convert to a specified coordinate transformation representation |
Get Parameter | Get values from ROS parameter server |
Publish | Send messages to ROS network |
Pure Pursuit | Linear and angular velocity control commands |
Read Image | Extract image from ROS Image message |
Read Point Cloud | Extract point cloud from ROS PointCloud2 message |
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.
Accelerate Robotics Algorithms with Code Generation
You can generate code for select Robotics System Toolbox algorithms to speed up their execution.
Generate Code to Manually Deploy a ROS Node from Simulink
This example shows you how to generate C++ code from a Simulink model to deploy as a standalone ROS node.
Enable External Mode for Robotics System Toolbox Models
外部模式使仿真软件万博1manbetxyour 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.
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.