Main Content

ネットワーク接続と調査

ROS ネットワークを設定して操作する

ROS に接続してロボット工学アプリケーションを試作し、ROS ネットワーク経由でロボット工学ハードウェアまたはシミュレーターにアクセスします。MATLAB® を使用して独自の ROS ネットワークを作成したり、既存の ROS ネットワークに接続することができます。ROS ネットワークを設定するには、まず rosinit を呼び出します。ROS 2 ネットワークの場合は、ros2node を参照してください。

関数

すべて展開する

rosinitROS ネットワークへの接続
rostopicRetrieve information about ROS topics
rosmsgRetrieve information about ROS messages and message types
rosnodeRetrieve information about ROS network nodes
rosparamAccess ROS parameter server values
rosshutdownShut down ROS system
getGet ROS parameter value
hasCheck if ROS parameter name exists
searchSearch ROS network for parameter names
setSet value of ROS parameter or add new parameter
delDelete a ROS parameter
rosdeviceConnect to remote ROS device
runNodeStart ROS node
stopNodeStop ROS node
runCoreStart ROS core
stopCoreStop ROS core
isNodeRunningDetermine if ROS node is running
isCoreRunningDetermine if ROS core is running
ros2Retrieve information about ROS 2 network
ros2messageCreate ROS 2 message structures

オブジェクト

すべて展開する

CoreCreate ROS Core
NodeStart ROS node and connect to ROS master
ParameterTreeAccess ROS parameter server
ros2nodeCreate a ROS 2 node on the specified network

ブロック

すべて展開する

Blank Message指定されたメッセージ タイプを使用した空白メッセージの作成
Current TimeRetrieve current ROS time or system time
Set ParameterSet values on ROS parameter server
Blank MessageCreate blank ROS 2 message using specified message type

トピック

ROS

ROS 入門

Robot Operating System (ROS) は、ロボット システムのさまざまな部分が相互に検出し、これらの間でデータを送受信できるようにする通信インターフェイスです。

ROS ネットワークへの接続

ROS ネットワークは、1 つの "ROS マスター" と複数の "ROS ノード" で構成されます。

Access the ROS Parameter Server

This example explores how to add and retrieve parameters on the ROS parameter server. The parameter server usually runs on the same device that launches the ROS master. The parameters are accessible globally over the ROS network and can be used to store static data such as configuration parameters. Supported data types include strings, integers, doubles, logicals, and cell arrays.

ROS Network Setup

Summary of ROS network setup and information required for connection.

ROS 2

Get Started with ROS 2

Robot Operating System 2 (ROS 2) is the second version of ROS, which is a communication interface that enables different parts of a robot system to discover, send, and receive data. MATLAB® support for ROS 2 is a library of functions that allows you to exchange data with ROS 2 enabled physical robots or robot simulators such as Gazebo®. ROS 2 is built on Data Distribution Standard (DDS) which is an end-to-end middleware that provides features such as discovery, serialization and transportation. These features align with the design principles of ROS 2 such as distributed discovery and control over different "Quality of Service" options for transportation. DDS uses Real Time Publish-Subscribe (RTPS) protocol which provides communication over unreliable network protocols such as UDP. For more information, see RTPS.

Connect to a ROS 2 Network

A ROS 2 network consists of a multiple ROS 2 nodes. Unlike ROS where the ROS master facilitates the communication by keeping track of all active ROS entities, ROS 2 is based on Data Distribution Standard (DDS) which is an end-to-end middleware that provides features such as discovery, serialization, and transportation. These features align with the design principles of ROS 2 such as distributed discovery and control over different "Quality of Service" options for transportation.

Using ROS Bridge to Establish Communication between ROS and ROS 2

ROS 2 is newer version of ROS with different architecture. Both the networks are separate and there is no direct communication between the nodes in ROS and ROS 2. The ros1_bridge package provides a network bridge which enables the exchange of messages between ROS and ROS 2. The bridge manages all the conversion required and sends messages across both the networks. For more information, see ros1_bridge. This example uses a virtual machine which may be downloaded by following the instructions in Gazebo およびシミュレートされた TurtleBot の入門. The ros1_bridge package is installed on this virtual machine.