By installing the development environment on Raspberry Pi, it is possible to develop by self-compiling on Raspberry Pi. (On embedded Linux boards of this size, development by cross compiling is usually usual.)
Therefore, you can compile and execute the RT component code generated by RTC Builder on PC on Raspberry Pi. Unfortunately it seems difficult to install Eclipse and use it at practical speed.
In this section we will install the necessary packages to develop RT components.
OpenRTM-aist can be installed using apt-get. First, modify sources.list.
$ sudo vi /etc/apt/sources.list
Add the following line to source list.
deb http://openrtm.org/pub/Linux/raspbian/ wheezy main
Next, install according to the following procedure.
# apt-get update # apt-get -y --force-yes install gcc g++ make uuid-dev # apt-get -y --force-yes install libomniorb4-dev omniidl omniorb-nameserver # apt-get -y --force-yes install openrtm-aist openrtm-aist-dev openrtm-aist-example # apt-get -y --force-yes install openrtm-aist-python openrtm-aist-python-example
After installing OpenRTM-aist, start the sample component and check whether OpenRTM-aist was installed correctly.
As shown below, execute the name server and ConsoleOut component on the PC side with the name server and ConsoleIn component, Raspberry Pi side. By default, the component connects to the localhost name server, so you can use it to easily access the component without setting up a specific name server in rtc.conf. In the RTSystemEditor on the PC, connect to the PC's name server and the name server on Raspberry Pi and connect the ConsoleIn component and the ConsoleOut component.
After connecting to Raspberry Pi with TeraTerm etc., start the component. Launch ConsoleOut after starting the naming service.
$ rtm-naming $ /usr/share/OpenRTM-x.y/examples/ConsoleOutComp or $ python /usr/share/OpenRTM-x.y/examples/python/SimpleIO/ConsoleOutComp.py
When installing omniorb-nameserver above, omniORB naming service is started automatically at system startup. However, depending on the startup timing of the name service and startup timing of the network interface, it may not be able to access the name server correctly from the outside. In that case, you may be able to deal with the problem by restarting the name server with the rtm-naming command.
First, start the name server. In Windows, start from "Start Naming Service" under "OpenRTM-aist x.y" > "C++" > "tools" from the start menu. Also, start RTSystemEditor.
Next, start ConsoleIn. Click "ConsoleOut" under "OpenRTM-aist x.y" > "C++" > "examples" to start the ConsoleOut component.
Click the outlet icon in NameService View on the left side of RTSystemEditor and connect to the name server. First, connect to the name server of the local host. Enter localhost in the connection dialog.
Next, connect to the name server of Raspberry Pi. Click on the connection icon of NameService View again and enter the host name of Raspberry Pi+.local in the dialog.
The name service view shows the status of the two name servers and you should see two components, ConsoleIn0 and ConsoleOut0, under each name server. Click on the online editor icon (icon marked ON) on the RTSystemEditor menu bar to open SystemEditor. Drag and drop ConsoleIn0 and ConsoleOut0 from NameService View onto SystemEditor and connect InPort and OutPort respectively.
Click the green play button on the menu bar to activate the two components and to the state shown above.
Enter the appropriate number from the window of the ConsoleIn component on the PC side.
Then, the numerical value entered in ConsoleIn appears on the display of ConsoleOut on Raspberry Pi side as shown below.
Depending on the network environment and PC settings, the above procedure may not work. Please refer to the troubleshooting below and solve the problem.
In addition, if there are two or more network interfaces such as Raspberry Pi's wired LAN and wireless LAN etc., there are cases to resolve by using only one network used for connection with PC.
Also, if there are two or more network interfaces such as Raspberry Pi's wired LAN and wireless LAN, there are cases to solve by using only one network used for connection with PC.
Check the IP address of the PC with ipconfig from the command prompt and set the IP address of the one used for rtc.conf as follows.
corba.endpoints: 192.168.11.20
However, in Vista and later Windows, files below C:\Program Files can not be edited easily. Take action by copying (or newly creating) ConsoleIn.exe and rtc.conf in an appropriate directory such as C:\tmp.
corba.endpoints: 192.168.11.21
cmake can be installed using apt-get. Install as a user with root authority.
$ sudo apt-get update $ sudo apt-get install cmake
In the CMake-based RT component project, it is set to generate documents by using doxygen by default. However, installing doxygen will install LaTeX and others at the same time, which puts pressure on the capacity of the SD card, so we will not install Doxygen in this tutorial.
To suppress document generation by doxygen in CMake based RTC project, at the top level CMakeLists.txt,
option(BUILD_DOCUMENTATION "Build the documentation" ON) ↓ option(BUILD_DOCUMENTATION "Build the documentation" OFF)
Change it as follows.
If the SD card has enough capacity doxygen can be installed with apt-get as follows.
$ sudo apt-get install doxygen
It will take about ten minutes before Doxygen installation is complete.
It is recommended to install subversion / git because it is used frequently to acquire the source code from the outside.
$ sudo apt-get install subversion git
I will test whether the component can be compiled. There are components for mobile robot Kobuki in the following repository, so check it out and compile it.
Let's check out the source code.
$ svn co http://svn.openrtm.org/components/trunk/mobile_robots/kobuki : Omission A kobuki/libkobuki/doc/CMakeLists.txt A kobuki/libkobuki/License.rtf A kobuki/libkobuki/CMakeLists.txt A kobuki/rtc.conf A kobuki/CMakeLists.txt Checked out revision 2. $
kobuki directory How the source code has been checked out, create a build directory, build and install within it.
$ cd kobuki $ mkdir build $ cd build $ cmake -DCMAKE_INSTALL_PREFIX=/usr .. $ make $ cd src $ make install
kobuki directory How the source code has been checked out, create a build directory, build and install within it....