Vdemo

Vdemo is a program used to easily start complex demos with many components on different machines. Vdemo uses screen and a shared key environment to start the components.

To write your own vdemo script checkout [source:software/vdemo_scripts/trunk] and take a look at the existing scripts. Vdemo is configured via the scripts that have no vdemo at the beginning of the file name. The scripts are then processed via a makefile and a second shell script is created that starts the configured vdemo GUI. To process a adapted vdemo script you have to insert it into [source:software/vdemo_scripts/trunk/Makefile]. The Makefile uses a environment variable called prefix to specify the output folder the processed vdemo files and the needed scripts are copied to.

To process your script use:

   export prefix="yourTargetPath" 
   make all
   make install

Now you should find a bin directory in yourTargetPath containing a lot of shell scripts. Run your shell script to start your demo.

How to configure my own vdemo script

How to write your own component

A component in vdemo is configured through a single file that has to be in the folder source:ai/software/vdemo_scripts/trunk/component_scripts. The file has to be named
component_"name_that_is_used_in_the_configuration_file", no spaces and all letters lower case.
Every line included in the file is executed in a bash. Be very carefull with spaces and special characters.
Below is a example component file:

#!/bin/bash

# common parameters

# Parameters can be defined here.

component="" <--- The command that starts your component.
title=name <--- The title of the component. This will be used to identify the screen your component runs in. Don't use spaces or bash characters in the name.

function clean_component {
    true
}

function on_start {
    #This function will be called before your component starts.
    true
}

function on_check {
    #This function will be called every time you manually check if the component is running.
    true
}

function on_stop {
    #This function will be called if the component is stopped. Do your cleanup here.
    true
}

source "$VDEMO_root/vdemo_standard_component_suffix.sh" 

How to start vdemo

start the right version of vdemo (whole path) with your vdemo script. Example:

/vol/airobots/releases/trunk/bin/vdemo2 /vol/airobots/releases/trunk/etc/vdemo_cfg/BIRON_base.sh

you need public key ssh (probably with empty passphrase) for this!

> ssh-keygen -trsa 
Generating public/private rsa key pair.
Enter file in which to save the key ($HOME/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in $HOME/.ssh/id_rsa.
Your public key has been saved in $HOME/.ssh/id_rsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

How to start my demo with vdemo

Vdemo allows you to specify levels and groups for your component. You can start each single component, a group of components or all components from a level by clicking on the start button from the component the group or the level. If you click on start next to All Components vdemo will begin starting all components from the lowest level, if those components are successfully started it will continue with the next higher level until all components are running. This can be used to wait for spread to start before trying to start a dispatcher etc.

How to start only a single component with vdemo for testing purposes

Sometimes a component does not start up if you press the start button in the vdemo GUI. To check you component configuration you can start only this component in a shell configured through vdemo. Press the button with the name of the machine you want to start the component at. The button should be located at the bottom of the vdemo GUI. Then use the command line tool

    vdemo_component (path to your vdemo installation)/etc/vdemo_cfg/(the script for your whole setup)  (path to your vdemo installation)/etc/vdemo_cfg/component_scripts/(the script for your component) 

If you have problems / see also / what you should note

  • since vdemo was initially built for biron some time ago you might find additional info on/in the BIRON page/part in this trac. Otherwise ask those people who are working with biron or other robots to help you.