Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.
duongdang edited this page May 4, 2011 · 28 revisions

Installation

Binary packages

Ubuntu (10.04 or newer):

apt-add-repository ppa:dang-duong/ppa
apt-get update
apt-get install robot-viewer

Fedora (12 or newer):

Create a robotviewer.repo file inside /etc/yum.repo.d with the following lines:

[robotviewer-repos]
name=Repository for robot-viewer.
baseurl=http://homepages.laas.fr/nddang/repos/fedora14
enabled=1

Change the line "fedora14" to the appropriate version of your system. Install robot-viewer by the usual way:

yum install robot-viewer

Note: omniorb is not available on Fedora, you would have to install it manually to run robotviewer in corba mode.

From source

Make sure you have the following dependency:

  • python 2.6 or 2.7.
  • pyopengl, numpy, python-numeric
  • SimpleParse 2.1
  • omniORB 4.1.4 and omniORBpy (optional)
  • python-imaging, python-opencv (optional)

To install this package:

python setup.py install --prefix $YOUR_PREFIX

Setting up

Edit config file

(i.e. $HOME/.robotviewer/config). An example is provided when you installed robot-viewer (config.example)

config.example:

[global]
version: 1.6
background: 1,1,1

[robot hrp]
geometry: $HOME/licenses/HRP2JRL/model/HRP2JRLmain.wrl
joint_rank: $HOME/licenses/HRP2LinkJointRank.xml
position: 0 0 0.6487 0 0 0 0.0 0.0 -0.453785605519 0.872664625997 -0.418879020479 0.0 0.0 0.0 -     0.453785605519 0.872664625997 -0.418879020479 0.0 0.0 0.0 0.0 0.0 0.261799387799 -0.174532925199 0.0 -0.523598775598 0.0 0.0 0.174532925199 0.261799387799 0.174532925199 0.0 -0.523598775598 0.0 0.0 0.174532925199 -0.174532925199 0.174532925199 -0.174532925199 0.174532925199 -0.174532925199 -0.174532925199 0.174532925199 -0.174532925199 0.174532925199 -0.174532925199

[object floor]
geometry: $HOME/.robotviewer/danceFloor.wrl

[object coord]
geometry: $HOME/.robotviewer/coord.py
parent: hrp,, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11, 12, 13, 14, 15, 16, 17, 18 ,19 ,20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
position: 0 0 0 0 0 0

The first section specifies global configuration (version, background color, etc. ). Option version in section is mandatory, otherwise robotviewer won't be able to parse your config correctly

The subsequent sections define either a robot or an object in the scene. The section header is in the style: [type name]. Each object in the scene has to have an unique name. The only mandatory option for each section is geometry which tells robot-viewer how to draw your object/robot. See next section for supporting formats. Optional items for each section are:

  • position: 6 float numbers defining x,y,z,roll,pitch,yaw position of the object. For robots, you also need to add angular values for all joints. In the above example, hrp's initial position contains 46 floats.
  • scale: 3 float numbers which tell robot-viewer if it is needed to scale up/down the object before drawing
  • parent: a name followed by joint id separated by a comma, which describe where the current object is attached to. In the above example, a coordinate system is attach each joints. The first blank between hrp and 0 indicates the free-flyer joint.
  • joint_rank: xml that specifies joint_id by joint_name.

Supported data formats

VRML

robot-viewer parses most of the kinematic parameter but omits dynamic parameters. Tri, quad, and polygon meshes are supported. VRML primitives such as Box, Cone, etc. are not supported. something like:

Box { 
field    SFVec3f size  2 2 2        # (0, )
}

will not work.

kxml

KineoCam format

py

OpenGL scripts that will be executed to draw the object in question.

obj

Usage

Server

Start the server by:

robotviewer -s mode

The server can be run in 2 modes: XML-RPC or corba. The latter mode requires that omniORB and omniORBpy be installed.

Keyboard control

  • m: Turn meshes on/off
  • s: Turn skeletons on/off
  • w: Turn wireframe on/off
  • +: Skeleton size up
  • -: Skeleton size down
  • l: lighter scene
  • d: dimmer scene
  • o: light ATTENUATION down
  • e: light ATTENUATION up
  • t: transparency up
  • r: transparency down
  • c: screen capture (PIL required)
  • v: start/stop video recording (opencv required)

Client

Create the client by:

In [1]: import robotviewer
In [2]: clt = robotviewer.client()

The following commands are available to the client:

  • listElements()
  • listElementDofs(element_name)
  • getElementConfig(element_name)
  • updateElementConfig(element_name, config)
  • createElement(type, name, description)
  • enableElement(element_name)
  • disableElement(element_name)
  • setRobotJointRank(specifity_file)