Modify simvehicle project


Let’s modify your simvehicle project with Joystick.
Please prepare one usb-connect joystick.

Install SFML 2.3

Install SFML library from http://www.sfml-dev.org/
SFML (Simple and Fast Multimedia Library) is multi platform, multi language, multimedia platform library which includes window manager, audio, system, and gaming device control like joystick.

Download SFML RT component

To download SFMLJoystick RT-component to your “simvehicle” package, just type in console

$ wasanbon-cd simvehicle
$ mgr.py repository clone SFMLJoystick

If your PC is on OSX or Linux, type “./mgr.py” insted “mgr.py”.

To build SFMLJoystick, SFML installed directory must be noticed to build chaines.
If you are on OSX or Windows, set SFML_ROOT environmental variable to be able to find $SFML_ROOT/include/SFML/Window/Joystick.hpp file.

Then,

$ mgr.py rtc build SFMLJoystick

If you need more information on building, add -v option.

If your RTC is successfully built, the SFMLJoystick RTC in added on system. To check it,

$ mgr.py system list_rtc

Python :
  conf_file : /Users/ysuga/Development/rtm/wasanbon/workspace/simvehicle/conf/rtc_py.conf
  rtcd :
    uri            : localhost:2811
    nameservers    : localhost:2809
    installed_rtcs : 
Java :
  conf_file : /Users/ysuga/Development/rtm/wasanbon/workspace/simvehicle/conf/rtc_java.conf
  rtcd :
    uri            : localhost:2812
    nameservers    : localhost:2809
    installed_rtcs : MobileRobotController,MobileRobot,VirtualJoystick
C++ :
  conf_file : /Users/ysuga/Development/rtm/wasanbon/workspace/simvehicle/conf/rtc_cpp.conf
  rtcd :
    uri            : localhost:2810
    nameservers    : localhost:2809
    installed_rtcs : SFMLJoystick

SFMLJoystick RTC is written in C++, so it must be listed on C++ RTCs.

To connect Joystick and MobileRobot, dataset must be translated.
Don’t be afraid. We’ve already have one. Just use SFMLJoystickToVelocity RTC.

$ mgr.py repository clone SFMLJoystickToVelocity
$ mgr.py rtc build SFMLJoystick

To build RT-System, we need to connect RTCs. In wasanbon, two options.
One is RT System Editor (RTSE), another is on console (a bit buggy and limited functions).

To use RTSE, you must install eclipse first,

$ wasanbon-admin.py environment install eclipse

Then, launch eclipse

$ wasanbon-admin.py eclipse launch

Next, you must start nameserver

$ wasanbon-admin.py nameserver start

Next, you must start system.

$ mgr.py system run -p

-p option means “plain” system run. wasanbon will not construct RT-System.
Without -p option, wasanbon will use RT-System profile to build system and activate RTCs, but now we need just RTCs even they are inactive and not connected.

Then, you can construct RT-System with RT-System Editor

REFERENCE:
http://openrtm.org/openrtm/en/node/1420

Save your RT-System Profile with RT-System Editor to your system directory.
Suppose you saved the RTSP with the name “MySystem.xml” on /$your_path_to/simvehicle/system/MySystem.xml.

To confirm your RTSP can be seen,

$ mgr.py system list
- DefaultSystem.xml
- MySystem.xml

Now you can switch default RTSP with

$ mgr.py system switch MySystem.xml

Then, you can start system

$ mgr.py system run

To stop system, press Ctrl + C keys.
To stop nameserver

$ mgr.py nameserver stop