simpleio

✏️ Edit this page on GitHub

#contents

This sample is included with the C++, Python, and Java editions of OpenRTM-aist.

Overview

This sample demonstrates the use of InPorts and OutPorts.

Start the ConsoleIn and ConsoleOut components. When the ports are connected, numbers entered on the ConsoleIn side are displayed on the ConsoleOut side.

Ports can be connected either using RTSystemEditor or by executing rtshell commands.

Startup Screens

SimpleIO Execution Example (RTSystemEditor Connection Screen)
ConsoleIn and ConsoleOut Component Execution Example

Usage

The SimpleIO sample sends numbers entered in ConsoleIn to ConsoleOut through a data port and displays the same numbers in ConsoleOut.

Enter a number in the ConsoleIn window. The same number will then be displayed in the ConsoleOut window.

  • Procedure

    • Start OpenRTP and open RTSystemEditor. For details on using RTSystemEditor, refer to RTSystemEditor.

    • Start both the ConsoleIn and ConsoleOut components.

      The startup method depends on the operating system and the OpenRTM-aist language edition. Refer to the table below.

Windows Linux
ConsoleIn Component ConsoleOut Component ConsoleIn Component ConsoleOut Component
C++ Edition ConsoleIn.bat ConsoleOut.bat ConsoleInComp ConsoleOutComp
Python Edition ConsoleIn.bat ConsoleOut.bat ConsoleIn.py ConsoleOut.py
Java Edition ConsoleIn.bat ConsoleOut.bat ConsoleIn.sh ConsoleOut.sh
  • Both components will appear in the Name Service View of RTSystemEditor. Drag them onto the SystemEditor.

  • Connect the ports of the two components. (Refer to the SimpleIO execution example above.)

  • Right-click either component and select [Activate Systems].

  • The prompt “Please input number:” will appear in the ConsoleIn window. Enter a number.

  • The same number will be displayed in the ConsoleOut window.