Install rtshell

OpenRTM-aist provides a tool called rtshell as a tool for operating RTC on the command line. rtshell is a tool that can manage RT components registered on the name server, You can activate/deactivate/reset components and connect ports. You can also manage the RT system. This section describes how to install the software and how to check the operation. Please refer to rtshell for usage other than installation.

How to Install

To install rtshell, you need to install OpenRTM-aist-Python because rtshell is a Python program. Therefore, to use rtshell, it is required to install OpenRTM-aist-Python and Python execution environment before installing rtshell. (The bulk installation script for Linux installs Python in the script, but in the case of Windows the msi install needs to be installed beforehand. The supported Python version is 3.7, 3.6, 3.5, 2.7.)

Installation on Windows

Please install OpenRTM-aist by msi installer. Please refer to the following page for the procedure.
OpenRTM-aist 1.2 installation (Windows, using msi installer)

Check rtcwd command

Check if the rtcwd command can be executed on the command line.

 > rtcwd
 'rtcwd' is not recognized as an internal or external command,
 operable program or batch file.

If you see this message, run rtshell_post_install.

 > rtshell_post_install -n
If Python is installed under Program Files, execute the command prompt as an administrator.

 > rtcwd
 rtcwd: Invalid CORBA naming service: localhost
This message is not a problem because Start Name Server described in Operation check (Windows) is not executed.

Installation on Linux environment

Use bulk installation script to install rtshell with using "-l c++", "-l python" and "-l rtshell" options and then execute rtshell_post_install.

Ubuntu 18.04 case:

Move to the directory where the bulk installation script is downloaded and type in:

 $ sudo sh pkg_install_ubuntu.sh -l c++ -l python -l rtshell --yes
 $ sudo rtshell_post_install

Close the terminal once.

Raspbian case:

Move to the directory where the bulk installation script is downloaded and type in:

 $ sudo sh pkg_install_raspbian.sh -l c++ -l python -l rtshell --yes
 $ sudo rtshell_post_install

Close the terminal once.

Currently, there is an issue with rtshell_post_install on Raspbian. The following method can make you avoid the problem. Before closing the terminal, execute rtshell_post_install without "sudo" prefix. And answer N to the first and the 2nd question. Then answer Y to the 3rd question like following:

 Link man pages? n
 Link documentation? n
 Add shell support to .bashrc? y

Operation Check (On Windows)

Operation check environment

The following explanation is based on the environment where OpenRTM-aist is installed to the Windows OS environment by using the msi installer with the default options.

We use the sample component set SimpleIO to check if rtshell was installed correctly.

About sample RTC set (SimpleIO)

Use a sample set consisting of the RT components ConsoleIn and ConsoleOut. ConsoleIn is a component that outputs the numerical values ​​input from the console from OutPort, and ConsoleOut is a component that displays the numerical values ​​input to InPort on the console. These are samples to show simple I/O (input/output) operations. It works by connecting from ConsoleIn's OutPort to ConsoleOut's InPort and activating these two components.

Start Name Server

First, start Name Server by the following procedure.
  • Enter "start naming service" in [Type here to search] at the bottom left of the screen.
  • Click [Start Naming Service].
    rtshell6_en.png
    Start Naming Service
  • The following screen will be displayed.
    rtshell5.png
    Name service screen output

Start sample component

Start the sample component.

In the case of Windows 10, enter "Python_Examples" in the "Search here by typing here" on the lower right, and open Explorer in the directory of the startup file of the sample component.

rtm8-2_en.png
Sample component startup file

Double-click "ConsoleIn.bat" and "ConsoleOut.bat" to start the two components. When started, two console screens as shown below will open. Also, since the sample components are usually installed under the following directory, you can start them directly with Explorer from there.
  • C: \ Program Files \ OpenRTM-aist \ 1.2. & Color (blue) {x}; \ Components \ Python
    rtm9-2.png
    ConsoleIn and ConsoleOut components

If the component does not start

If the component does not start, there are several possible causes.

Console screen opens and disappears immediately

There are cases where there is a problem with the settings of rtc.conf and it cannot start. Open the Examples\SimpleIO\rtc.conf file under the directory where the above sample startup file is located, and check the settings. For example, if settings such as corba.endpoint/corba.endpoints are mismatched with the host address of the currently running PC, CORBA will terminate abnormally.

Please re-write the line to the following minimum rtc.conf line and try again.

 corba.nameservers: localhost

omniORBpy is not installed.

The msi installer provided by openrtm.org includes omniORBpy, but if you choose a custom installation, you can install OpenRTM-aist-Python without installing omniORBpy. Also, if you have installed it manually, you may not have omniORBpy installed, so check if omniORBpy is installed.

The association of py files is different

The file that starts ConsoleIn and ConsoleOut is

C:\Program Files\OpenRTM-aist\1.2. &Color(blue){x};\Components\Python\Examples\SimpleIO\ConsoleIn.py & br; C:\Program Files\OpenRTM-aist\1.2. &Color(blue){x};\Components\Python\Examples\SimpleIO\ConsoleOut.py

So double click on these files. If it does not start well, the file association is wrong.

Other

There are cases where the startup does not work due to problems with the hostname and the address settings. In that case, if you give omniNames.exe the IP address of the PC you are using, it may work. Set the environment variable OMNIORB_USEHOSTNAME as follows (the example below is assumed that the IP address of the local host is 192.168.0.11).

 Variable name (N): OMNIORB_USEHOSTNAME  Variable value (V): 192.168.0.11

rtshell Operations

  • Open a command-line console.
  • Execute the command rtls from the command-line as shown below, and check that the display is as follows.
     C: \ Users \ openrtm> rtls -R 127.0.0.1
     .:
     ConsoleIn0.rtc ConsoleOut0.rtc
  • Connect the ConsoleIn and ConsoleOut components.
     rtcon /localhost/ConsoleIn0.rtc:out /localhost/ConsoleOut0.rtc:in
  • Activate the ConsoleIn and ConsoleOut components.  rtact /localhost/ConsoleIn0.rtc /localhost/ConsoleOut0.rtc
  • The ConsoleIn and the ConsoleOut consoles will change as follows, and "Please Input number:" will be displayed on the ConsoleIn side console.
    rtm9-3.png
  • Enter a number (within a 16-bit integer range) from the ConsoleIn console and press Enter.
  • Confirm that the value entered on the ConsoleIn console is displayed on the ConsoleOut console. If the same number is displayed, the operation was confirmed.
  • Enter as follows to deactivate.
     rtdeact /localhost/ConsoleIn0.rtc /localhost/ConsoleOut0.rtc
    At this time, enter the numerical value on the console of ConsoleIn.py and press the Enter key to cancel the waiting state. afterwards
     rtexit /localhost/ConsoleIn0.rtc
     rtexit /localhost/ConsoleOut0.rtc
    And confirm that the console closes.

Operation Check (On Linux)

After successful installation, test the operation with the attached sample. Samples are usually located at:

  • /usr/share/openrtm-1.2/components/python/<sample component set name>

Check that OpenRTM-aist is built and installed correctly using the sample component set SimpleIO.

Sample component set SimpleIO

This is a sample set consisting of RT components ConsoleIn and ConsoleOut. ConsoleIn is a component that outputs numerical values ​​input from the console from OutPort, and ConsoleOut is a component that displays numerical values ​​input to InPort on the console. These are samples to show simple I/O (input/output) operations. It works by connecting ConsoleIn's OutPort to ConsoleOut's InPort and activating these two components.

The samples are under /usr/share/openrtm-1.2/components/python/SimpleIO, and the description is described assuming that the search path is set in the executable file of Python itself.

Operation check using sample

Start name server

  • Start the name server. It can be started with the following command.
     $ rtm-naming
  • In the environment where OpenRTM-aist(C++) is not installed, it is prepared so that it can be started by the following script.
     $ python /usr/lib/python2.7/dist-packages/OpenRTM_aist/utils/rtm-naming/rtm-naming.py
           or
     $ python3 /usr/lib/python3/dist-packages/OpenRTM_aist/utils/rtm-naming/rtm-naming.py

Here, {Python2.7|python3} changes depending on the version of Python that was installed in the Linux environment. If Python 2.7 was installed with OpenRTM-aist-Python, it is "Python2.7".
(The default for Ubuntu 18.04 is Python 2.7. However the version of Python is now "End of Support", then it might be changed.)

The following screen will be displayed.

startnameservice002.png
Name server screen

Start sample component

  • Open a terminal.
  • In the terminal, change the current directory to /usr/share/openrtm-1.2/components/python/SimpleIO/ or <source directory> / OpenRTM_aist / examples / SimpleIO if the source is built. For example
     $ cd /usr/share/openrtm-1.2/components/python/SimpleIO
  • Start the ConsoleIn component with the following command.
     $ python ConsoleIn.py
  • Open another terminal.
  • Set the current directory to the same location as above.
  • Start the ConsoleOut component with the following command.
     $ python ConsoleOut.py

Check name on name service

  • Open another terminal
  • Using the following command, check the name as follows.
     $ rtls -R localhost
     .:
     ConsoleIn0.rtc ConsoleOut0.rtc

Connecting sample components

  • Connect the ConsoleIn0 component and ConsoleOut0 with the following commands.
     $ rtcon /localhost/ConsoleIn0.rtc:out /localhost/ConsoleOut0.rtc:in

Activate sample component

  • In the above terminal
     $ rtact /localhost/ConsoleIn0.rtc /localhost/ConsoleOut0.rtc

Then, the screen of the terminal that started Consolein.py and ConsoleOut.py will be displayed, and the terminal will change to the prompt “Please input number:” on the terminal that started ConsoleIn.py.

simpleio_ubuntu.png
Terminal screen of ConsoleIn and ConsoleOut components after activation

  • Enter an appropriate number (within the range of short int: 32767 or less) and press the Enter key.
  • The same value as the entered value is displayed on the ConsoleOut.py terminal screen. You can see that the data has been transferred from the ConsoleIn component to the ConsoleOut component.

Deactivate and terminate sample components

  • Deactivate with the following command.
     $ rtdeact /localhost/ConsoleIn0.rtc /localhost/ConsoleOut0.rtc
  • The ConsoleIn.py terminal is waiting for input, so enter a suitable number: 32767 or less and press Enter.
  • Enter the following command and confirm that ConsoleIn.py and ConsoleOut.py have finished executing in each terminal.
     $ rtexit /localhost/ConsoleIn0.rtc
     $ rtexit /localhost/ConsoleOut0.rtc

This concludes the confirmation of the basic operation of the component using the command line.