« Aalto « ELEC « AS

Harjoitustyöympäristö

Current information about this course may be found in the Noppa Portal.


Due to practical issues, all material concerning the robot is written in English.

The download link for the interface is at the very bottom of this page.
Note: The newest interface package is now 1.2! Be sure to use the latest one to avoid problems! (atleast decrease the number of them :).


Robot platform features

Controls

  • Speed and angular speed
  • Drive-by-coordinates
  • Pan-Tilt-Unit (PTU) Control
  • Some state variables
    • Acceleration
    • Bumber behaviour selection

Sensor Outputs

  • Bumber state (as ranging data)
  • 180 Laser Measurements@10Hz (also ranging data)
  • Camera images from the stereo pair
  • Odometry data
  • Simulated 'Gas level' readings
  • SLAM localization
  • Additional camera streams from external sources (Not really 'Robot sensors' though)


Practical issues

General advice

You are dealing with a real, complicated mechanical device that can break. Please respect that! If anything should ever happen, please contact assistants immediately (unless this should happen during night time).

Reserving the robot

There is a calendar in the roboroom (2551). You should always reserve time for your team, as well as respect others' reservations. This means that you should not reserve more than two times three hours in advance (three times two hours is of course also acceptable). If there is no one before or after you, you can test longer.

Power and recharging

Always keep the robot connected to the charger when possible

The robot needs power to operate! If the batteries are run completely empty, they will pretty much die.

The charger has a current limit. The voltage before connecting the plug to the robot should be approximately 29 Volts. The current limit will lower the voltage after you connect the robot to charger. The current limit should not be more than 2 Amps (if the laser is connected the current limit can be 2.5 Amps).

Never turn off the computer from the main switch

The robot runs Linux and in 59/60 times this means that the problem will not be solved just by rebooting the system. If you turn off the computer, you are more likely to do more harm to the file system than any good. So if you feel like rebooting, think again and contact course staff first.

Laser

Remember to take the power off from the laser when you stop working.

The laser is an expensive sensor. The prism has mechanical parts and therefore it has a limited number of cycles of lifetime.

Also, remember to connect the laser when starting to work with the robot. The laser scanner initialization takes about half a minute before it is operable.


The j2b2GIMICtrl Interface library

Introduction to components

UI/main.cpp
This file contains a comprehensive example for using the j2b2GIMICtrl interface. All existing interface functions are demonstrated.
j2b2GIMICtrl
j2b2GIMICtrl is a client side wrapper library used to encapsulate multiple services under one interface. The library wraps the following interfaces:
  • ASRobo Client Library - Robot control and sensor information
  • ImageClient - Reading camera images from robot (ImageServer)
  • PTU-Client - Controlling the Pan-Tilt Unit attached to the robot
  • SLAM - Occupancy grid based ML-SLAM algorithm. The algorithm provides rather reliable position estimate for the J2B2 in its constrained environment.

Getting the example software running (UI/main.cpp)

At the beginning of the 'main.cpp' file, there is a variable 'own_group_id' with a predefined value 'g1'. Modify this line according to your group id (when using Simulator) or with word 'real' when using the real robot. This will cause the software to use correct names with one modification. (This will become clear as you read through the code)

Connecting your software to services:

  • Connecting your client to the GIMnet
This is done by calling the member function 'Connect' from the j2b2GIMICtrl interface with appropriate parameters. If the call is successful, you have a connection to GIMnet.
  • Connecting j2b2GIMICtrl to services
This is done by calling the Initialization member functions, such as the 'InitializeASRobo' from the j2b2GIMICtrl interface with appropriate parameters. If the call is successful, you have reached a service which is now ready to accept ctrl commands or data requests. Connecting other service (PTU, ImageClient) is done in the same way. Just copy it from the example. The example just ignores if any of the services fail, but you should pay attention to the return values because if the modules fail to initialize for some reason, the commands simply won't work :)
  • Connecting SLAM
Instructions for using the SLAM localization module will be updated by the end of this week.

Read through the example software and test it. (See that the robot moves!) You can use the 'main.cpp' as a base for your own code. After this, you're on your own!

Using the J2B2 robot

When you want to start testing your software, you need to configure some parameters for the interface to be able to control the robot.

We have two connection points; one without delay (in port 51002), and one with 720ms delay (in port 51500). While testing your interface, you can use the direct (no delay) connection, but remember that the demostrations will be done over the delayed link.

In the example 'main.cpp' there is a line (in the original file on line 86):

result = ctrl.Connect("asrobo.hut.fi", 51002, "j2b2ctrl_" + own_group_id);

To be able to control the robot, you must change this line to (The port number varies depending on the wanted setup)

When using the port 51002:

result = ctrl.Connect("turbo.dyndns.tv", 51002, "j2b2ctrl_" + own_group_id);

When using the port 51500 (For delayed link):

result = ctrl.Connect("turbo.dyndns.tv", 51500, "j2b2ctrl500_" + own_group_id);

The delayed interface works now correctly when using the newest available interface package (>= 1.1)

After this change, you are connecting to the correct GIMnet. (where the J2B2 robot is connected to)

Now, because we are using a delayed link, we must configure the Interface to take this into account. Find line (In the original file, line 28):

static int linkStaticDelay = 0; // The known delay of the link (Default to Zero)

and change it to:

static int linkStaticDelay = 720; // The known delay of the link (Default to Zero)

This configures the interface to use 720ms as a static link delay per direction. (This allows timeouts to be extended by the correct amount)

Leave the other parameters alone, as these are required to be like this when connecting to the robot:

static std::string own_group_id = "real";
...
result = ctrl.InitializeASRobo("ASRobo_" + own_group_id);
...
result = ctrl.InitializePTU("PTU_" + own_group_id);
...
result = ctrl.InitializeImageClient("ImageServer_" + own_group_id);

for those using the external cameras (moonbase monitors), you will have to use the ImageClient interface as follows:

static std::string own_group_id = "real";
// For initialization
int onboardcamera = ctrl.InitializeImageClientEx("ImageServer_" + own_group_id);
int moonbasecamera = ctrl.InitializeImageClientEx("moon_base_stream");

// For reading the images (Camera number #0 from both image sources)
TBitmap bimg;
... ctrl.IC_GetImage(0, &bimg, onboardcamera);
... ctrl.IC_GetImage(0, &bimg, moonbasecamera);

After these settings, you can test your software. Remember that the software must be run inside the laboratory network, so if you have a laptop with TUAS-WLAN for example, it won't work. If you want to use your own computer for testing, ask Antti Maula for a temporary IP on the network.

Interface documentation

The documentation for the j2b2GIMICtrl interface can be read starting from file 'doc.html' located under the UI subdirectory, or online:
Interface documentation for j2b2GIMICtrl 0.9.10-17
Interface documentation for j2b2GIMICtrl 0.9.11-18
Interface documentation for j2b2GIMICtrl 0.9.12-19

Notes about the interface

  • The MCL interface is not available in this exercise, use the SLAM module instead. (It provides more reliable position but it doesn't provide global world coordinates)
  • External cameras can be connected by using the 'InitializeImageClientEx(...)' function
  • There is one special "virtual" driver for the UI-course: 'UI_GetCurrentGasLevel()'
  • The ASRobo supports coordinatedrive in Differential mode only. To use the coordinate driving feature, you must first enable the behavior. (See the example 'main.cpp' for example sequence)

Testing the GasLevel feature

We have created a simple software for simulating the GasLevel input. If you wish to test it, you can run program 'UI_GasCtrl' from the console (On the course provided computer). (It requires graphics context, but displays nothing in it :)

The software takes a few commandline parameters ('UI_GasCtrl -h' displays all), but one is more important than the other:

  • '-t target' - To specify your client softwares name. Probably default ('j2b2ctrl_real') is OK but if you change it, you must specify the new name here.

Using the software is easy: after you have started it, you can press numbers from 0 to 9 to change the Gas level reading. Space resets zero. The software also supports reading the values from joystick so if you have one available you can change the level with it.

Interface download

Latest version of the interface packet is available from the link below. If you want to develop on some other machine, download the interface package and extract it. The package should work on all Linux architectures. In case you have any problems with the package or environment in general, please contact Antti Maula.

Download UI-package-v1.0.tar.bz2 (UI-package version 1.0)
Download UI-package-v1.1.tar.bz2 (UI-package version 1.1)
Download UI-package-v1.2.tar.bz2 (UI-package version 1.2)

Changelog

  • Package v1.2
    • Fixed ImageClient-interface; There was a problem using multiple camera providers at the same time.
    • Fixed indirect bug in j2b2GIMICtrl. GIMI didn't correctly handle timeouts with delayed links in all situations.
  • Package v1.1
    • Added support for accessing external ImageServers.
    • Added support for Differential coordinate drive in ASRobo
    • Added support for clearing Coordinates from ASRobo
    • Improved documentation for SLAM and Coordinate Drive.

Problems

If you have any problems with the project software or hardware, contact Antti Maula.

There is also an IRC channel in IRCnet, #AS843147 which can be used for realtime questions.