Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

ROS アプリケーションの例

ROS および Gazebo のアプリケーションをシミュレートし、TurtleBot® ハードウェアに接続

以下の例では、ROS、実際のロボットおよびシミュレーター用に、特定のアプリケーションを作成する方法を説明します。これらを使用して、物理的ハードウェアおよびソフトウェア シミュレーション システムの要件について学習します。ロボットの設定情報については、Gazebo およびシミュレートされた TurtleBot の入門およびGet Started with a Real TurtleBotを参照してください。

トピック

ROS アプリケーション

Feedback Control of a ROS-Enabled Robot

Use Simulink® to control a simulated robot running in a separate ROS-based simulator.

Feedback Control of a ROS-Enabled Robot Over ROS 2

This example shows you how to use Simulink® to control a simulated robot running in a Gazebo® robot simulator over ROS 2 network.

Fusion of Radar and Lidar Data Using ROS

Perform track-level sensor fusion on recorded lidar sensor data for a driving scenario recorded on a rosbag. This example uses the same driving scenario and sensor fusion as the Track-Level Fusion of Radar and Lidar Data (Sensor Fusion and Tracking Toolbox) example, but uses a prerecorded rosbag instead of the driving scenario simulation.

Automated Parking Valet with ROS in MATLAB

This example shows how to distribute the Automated Parking Valet (Automated Driving Toolbox) application among various nodes in a ROS network. Depending on your system, this example is provided for ROS and ROS 2 networks using either MATLAB® or Simulink® . The example shown here uses ROS and MATLAB. For the other examples, see:

Sign Following Robot with ROS in MATLAB

This example shows you how to use MATLAB® to control a simulated robot running on a separate ROS-based simulator over a ROS network. It then shows how to generate a ROS node for the control algorithm and deploy it to the remote device running ROS. The example shown here uses ROS and MATLAB for simulation, and MATLAB Coder™ for code generation and deployment. For the other examples with ROS 2 or Simulink®, see:

Generate a Standalone ROS Node from MATLAB®

This example shows how to generate C++ code for a standalone ROS node from a MATLAB function. It then shows how to build and run the ROS node on a Windows® machine.

MATLAB Programming for Code Generation

This example shows the recommended workflow for generating a standalone executable from MATLAB® code that contains ROS interfaces.

Gazebo

Gazebo およびシミュレートされた TurtleBot の入門

この例では、Gazebo® シミュレーター エンジンの設定方法を説明します。

Add, Build, and Remove Objects in Gazebo

This example explores more in-depth interaction with the Gazebo® Simulator from MATLAB®. Topics include creating simple models, adding links and joints to models, connecting models together, and applying forces to bodies.

Apply Forces and Torques in Gazebo

This example illustrates a collection of ways to apply forces and torques to models in the Gazebo® simulator. First, application of torques is examined in three distinct ways using doors for illustration. Second, two TurtleBot® Create models demonstrate the forcing of compound models. Finally, object properties (bounce, in this case) are examined using basic balls.

Test Robot Autonomy in Simulation

This example explores MATLAB® control of the Gazebo® Simulator.

TurtleBot

Get Started with a Real TurtleBot

This example shows how to connect to a TurtleBot® using the MATLAB® ROS interface. You can use this interface to connect to a wide range of ROS-supported hardware from MATLAB. If you are using a TurtleBot in Gazebo® refer to the Gazebo およびシミュレートされた TurtleBot の入門 example.

Gazebo およびシミュレートされた TurtleBot の入門

この例では、Gazebo® シミュレーター エンジンの設定方法を説明します。

Communicate with the TurtleBot

This example introduces the TurtleBot® platform and the ways in which MATLAB® users can interact with it. Specifically, the code in this example demonstrates how to publish messages to the TurtleBot (such as velocities) and how to subscribe to topics that the TurtleBot publishes (such as odometry).

Explore Basic Behavior of the TurtleBot

This example helps you to explore basic autonomy with the TurtleBot®. The described behavior drives the robot forward and changes its direction when there is an obstacle. You will subscribe to the laser scan topic and publish the velocity topic to control the TurtleBot.

Control the TurtleBot with Teleoperation

This example shows keyboard control of the TurtleBot® through the use of the ExampleHelperTurtleBotCommunicator class. The instructions describe how to set up the object and how to start the keyboard control. Instructions on how to use keyboard control are displayed when the function is launched. To change parameters of the function, edit the exampleHelperTurtleBotKeyboardControl function or the ExampleHelperTurtleBotKeyInput class. For an introduction to using the TurtleBot with MATLAB®, see the getting started examples (Get Started with a Real TurtleBot or Gazebo およびシミュレートされた TurtleBot の入門)

Obstacle Avoidance with TurtleBot and VFH

This example shows how to use a TurtleBot® with Vector Field Histograms (VFH) to perform obstacle avoidance when driving a robot in an environment. The robot wanders by driving forward until obstacles get in the way. The controllerVFH (Navigation Toolbox) object computes steering directions to avoid objects while trying to drive forward.

Track and Follow an Object

In this example, you explore autonomous behavior that incorporates the Kinect® camera. This algorithm involves the TurtleBot® looking for a blue ball and then staying at a fixed distance from the ball. You incorporate safety features, such as bump and cliff sensing.