welcome: please sign in
location: Diff for "QuickStart"
Differences between revisions 3 and 4
Revision 3 as of 2009-05-12 07:57:58
Size: 4591
Editor: 2001:660:6602:4:20a:e4ff:fe26:de06
Comment:
Revision 4 as of 2010-11-05 16:44:40
Size: 4602
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * [:mkdep:]
 * [:pocolibs:]
 * [:editline:libedit] (on platform that don't provide it, ie Linux, Solaris)
 * [:eltclsh:]
 * [:genom:]
 * [[mkdep]]
 * [[pocolibs]]
 * [[editline|libedit]] (on platform that don't provide it, ie Linux, Solaris)
 * [[eltclsh]]
 * [[genom]]
Line 12: Line 12:
 * [http://www.gnu.org/software/autoconf/ autoconf] version 2.59 or later
 * [http://www.gnu.org/software/make/ make] version 3.79 or later
 * [http://pkgconfig.freedesktop.org/ pkgconfig] version 0.15 or later (Usually part of Gnome development packages).
 * [http://www.gnu.org/software/groff/groff.html groff] 1.10 or later (Usually part of system packages).
 * [http://www.tcl.tk/ Tcl/Tk] 8.0 or later development files (for eltclsh).
 * [[http://www.gnu.org/software/autoconf/|autoconf]] version 2.59 or later
 * [[http://www.gnu.org/software/make/|make]] version 3.79 or later
 * [[http://pkgconfig.freedesktop.org/|pkgconfig]] version 0.15 or later (Usually part of Gnome development packages).
 * [[http://www.gnu.org/software/groff/groff.html|groff]] 1.10 or later (Usually part of system packages).
 * [[http://www.tcl.tk/|Tcl/Tk]] 8.0 or later development files (for eltclsh).

Requirements:

LAAS/OpenRobots tools

External tools

These tools are generally available on most systems. If not, download them from the indicated web sites.

  • autoconf version 2.59 or later

  • make version 3.79 or later

  • pkgconfig version 0.15 or later (Usually part of Gnome development packages).

  • groff 1.10 or later (Usually part of system packages).

  • Tcl/Tk 8.0 or later development files (for eltclsh).

User environment:

Three environment variables need to be set in order to use the OpenRobots tools, when they are installed in a specific directory (ie not directly in /usr).

For instance at LAAS we install all the softwares in /usr/local/openrobots. Is is this value, ${prefix}, which is given to the option --prefix for GNU configure script. By default, the path for the architecture-dependent files, ${exec_prefix}, is equal to ${prefix}. However, this path can also be explicitely specified using the option --exec-prefix (eg, ${prefix}/i386-linux). It can be usefull if you compile for different architectures.

  • PATH: add ${exec_prefix}/bin to your PATH environment variable.

  • PKG_CONFIG_PATH: add ${exec_prefix}/lib/pkgconfig to your PKG_CONFIG_PATH environment variable, or set it to this value if it was not already defined.

  • LD_LIBRARY_PATH: add ${exec_prefix}/lib:${exec_prefix}/lib/openprs to your LD_LIBRARY_PATH environment variable, or set it to this value if it was not already defined.

Quick start guide

For a new module

  1. write module.gen, moduleConst.h, moduleStruct.h

  2. generate empty module + tcl client with genom -i -t module.gen

  3. if your module foo depends on another module bar:

    • use -Pbar on the genom command line. One -P for each dependency

    • or better, you can use the require directive in the .gen file.

  4. create a build dir and cd to it
     <path_to_src_dir>/configure --prefix=/home/<me>/openrobots/installed
     make
     make install

* This prefix means simply that your executable files will be placed there prefix/bin

Adding code files

  1. You put your files in codels/
  2. Edit the codels/Makefile.in ,adding at codels_src= the name of these files.

Modyfying a module

  • If you just changed the codels files, call
     make
     make install

from the build/ directory of the module.

  • If you just changed the <module>.gen file or the files included in the .gen file ( like <module>Struct.h file ) or codels/Makefile.in then call

  •  make regen
     make
     make install

    from the build/ directory of the module.

For an existing module, just checked out of git

  • generate the module server part once using either :
    • genom [options] module.gen

    You need to figure out the correct options for your environment (dependencies, using TCL or OpenPRS, specific defines, etc.).
    • or genom-regen if your environemnt matches the environment where the module was last generated. Check GENOMFLAGS in autoconf/genom.mk for the list of arguments.

  • sometimes you need to specify for which robot you compile the module, use the -D option followed by the robot name : genom [options] -DROBOTNAME module.gen

  • create a build dir and cd to it
     <path_to_src_dir>/configure --prefix=/home/<me>/openrobots/installed
     make
     make install

Running the module & a simple client

 h2 init
 <module> -b
 <module>Test 1

Running the module & tcl client

 h2 init
 tclserv
 <module> -b
 eltclsh -package genom
 connect localhost
 lm <module>
 mboxInit

Now it's ready to send requests: ::<module>::....

End:

In eltclsh:

 kill <module>
 exit

You can also use the die command, which kills tclserv and returns from the tcl interpreter

  • if the module has not been killed in eltclsh: killmodule <module> 

  • killmymodules kills all the modules of a user

  • if tclserv has not be died in eltclsh: pkill tclserv

 h2 end

OpenrobotsWiki: QuickStart (last edited 2010-11-05 16:44:40 by localhost)