Skip to content

Commit

Permalink
Merge branch 'object_modules' (finally!)
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
	components/sensors/cameras/Camera_Module.py.DEMO
	components/sensors/cameras/Camera_Module.py.ORIGINAL
	components/sensors/thermometer/Temperature_Module.py
	examples/morse/clients/atrv/ATRV_Client.py
	scenarii/Setup_Morse_Paths.py
	scenarii/action/action-3.blend
	scenarii/morse_default.blend
	scenarii/rosace-2.0/rosace_demo-2.0.blend
  • Loading branch information
Arnaud Degroote committed Jul 6, 2010
2 parents 1102e97 + 36bdafe commit 52e9c78
Show file tree
Hide file tree
Showing 317 changed files with 3,716 additions and 10,177 deletions.
6 changes: 5 additions & 1 deletion .gitignore
@@ -1,4 +1,3 @@
atrv
*.blend1
*.blend2
*.blend3
Expand All @@ -8,4 +7,9 @@ atrv
*.o
*.so
*.pyc
*~
build/
*.cmake
CMakeFiles/
CMakeCache.txt
install_manifest.txt
53 changes: 53 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 2.6)

set(PACKAGE_NAME morse)

option(BUILD_YARP2_SUPPORT "Build yarp framework support" OFF)
option(BUILD_POCOLIBS_SUPPORT "Build pocolibs framework support" OFF)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/config/)
find_package(PkgConfig REQUIRED)

find_package(Python26Interp REQUIRED)
find_package(PythonLibs REQUIRED)

EXECUTE_PROCESS(COMMAND
${PYTHON_EXECUTABLE} -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_lib(0,0,\"\"))"
OUTPUT_VARIABLE PYTHON_INSTALL
ERROR_VARIABLE PYTHON_STDERR
RESULT_VARIABLE PYTHON_ERR
)

SET(PYTHON_INSTDIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL})
MESSAGE(STATUS "will install python files in ${PYTHON_INSTDIR}")

if (NOT PYTHONINTERP_FOUND)
MESSAGE(FATAL_ERROR "Can't find python 2.6 on your system")
endif(NOT PYTHONINTERP_FOUND)
if (BUILD_YARP2_SUPPORT)
find_package(YARP2 REQUIRED)

EXECUTE_PROCESS(COMMAND
${PYTHON_EXECUTABLE} -c "import yarp;"
RESULT_VARIABLE YARP_PY_ERR
)
if (YARP_PY_ERR)
MESSAGE(FATAL_ERROR "BUILD_YARP_SUPPORT is required, but can't find yarp python binding")
endif (YARP_PY_ERR)
endif(BUILD_YARP2_SUPPORT)

if (BUILD_POCOLIBS_SUPPORT)
pkg_check_modules(POCOLIBS REQUIRED pocolibs)
find_package(SWIG REQUIRED)
endif(BUILD_POCOLIBS_SUPPORT)


ADD_SUBDIRECTORY(src)
INSTALL (DIRECTORY doc data examples
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
REGEX .*blend. EXCLUDE
REGEX .*py. EXCLUDE
)



87 changes: 69 additions & 18 deletions INSTALL
Expand Up @@ -3,12 +3,22 @@
(c) LAAS/ONERA 2009-2010
===============================================================================

Requirements / What you need to install before
----------------------------------------------
I/ Requirements - What you need to install before
-------------------------------------------------

- Python (2.6 or +)
I.1 Common requirements
-----------------------

- Python (2.6 or +)
- Blender 2.49 build with Python 2.6 [1]
- git to get the code of the simulator
- git to get the code of the simulator:
$ git clone http://trac.laas.fr/git/robots/morse.git

If you plan to use the simulator with raw sockets of text files as "middleware",
you don't need anything else.

I.2 YARP
--------

For the YARP bindings
- YARP version (2.2.5 or +)
Expand All @@ -22,9 +32,6 @@ Note that the easiest way to install YARP is probably to use robotpkg (see
http://homepages.laas.fr/mallet/robotpkg for more instructions). You can
install yarp and its dependancies using make install into devel/libpyyarp.

Installation
------------

Compiling the YARP Python binding will create two files: yarp.py and _yarp.so
Copy them to the your Python lib directory (/usr/lib/python2.6/site-packages/)
or at some place reachable from your PYTHONPATH environment variable.
Expand All @@ -33,34 +40,78 @@ or at some place reachable from your PYTHONPATH environment variable.
${ROBOTPKG_BASE}/lib/python2.6/site-packages/ to let python finds the yarp
module.

If not already done, download the source code of OpenRobots Simulator:
$ git clone http://trac.laas.fr/git/robots/morse.git
I.2 Pocolibs
------------

Set the environment variable $ORS_ROOT to the path directory where you have
installed OpenRobots Simulator.
To build Pocolibs bindings (the LAAS-CNRS middleware), you need to install
Pocolibs on your system.

Running a simulation
--------------------
The recommended way to do it is through robotpkg (see
http://homepages.laas.fr/mallet/robotpkg for more informations).

To test the simulator you can load one of the example scenarii from
$ORS_ROOT/scenarii (.blend files)
To install:
$ cd $ROBOTPKG/devel/pocolibs
$ make update

II/ Installation
----------------

From your MORSE root directory:
$ mkdir build && cd build
$ cmake ..
$ make install

By default, MORSE will install in /usr/local. You can easily change that by
launching ccmake instead of cmake. You can also set there if you want YARP and
Pocolibs bindings to be build.

III/ Running a simulation
-------------------------

[YARP specific] Before to start a simulation: Start the YARP's server
with this command from a terminal "yarp server".

Launch MORSE by calling the morse executable:
$ morse

Several options are available, check them with:
$ morse help

Two environment variable have noticable effects:
- $PYTHONPATH specifies the directories where MORSE scripts are located. It will start with the MORSE installation prefix, followed by the path to the python scripts. It must also include the full path to the directory 'morse/blender' within the installed files. Example:

tcsh:
setenv PYTHONPATH {morse_install_prefix}/lib/python2.6/site-packages:{morse_install_prefix}/lib/python2.6/site-packages/morse/blender

bash:
export PYTHONPATH={morse_install_prefix}/lib/python2.6/site-packages:{morse_install_prefix}/lib/python2.6/site-packages/morse/blender


- $ORS_BLENDER that allows you to specify a custom Blender executable (else,
Blender is looked for in the path).

You can check your configuration is ok with:
$ morse check

Once launched, you can test the simulator by loading one of the example scenarii
from $ORS_ROOT/share/examples/morse/scenarii (.blend files)

To start a simulation, go on blender and press "P" to play the scenario.

IV/ Testing
-----------

To test the external control clients, open the Blender file:
$ORS_ROOT/scenarii/indoors_1/indoor_scene-2.0.blend
$ORS_ROOT/share/examples/morse/scenarii/indoors_1/indoor_scene-2.0.blend
Start the simulation ('P')
Run the C program:
$ORS_ROOT/clients/atrv/atrv_destination-1.0
$ORS_ROOT/share/examples/morse/clients/atrv/atrv_destination-1.0
Enter the coordinates where you want the robot to go. The robot will try to get
there.


Tips: If you have any problem to start to play a simulation: start blender
from a terminal and send us the error messages.


[1] For the moment the simulator work only with this version.
Blender 2.5 is being worked on.
39 changes: 12 additions & 27 deletions TODO
Expand Up @@ -6,36 +6,16 @@ File history:
29/04/2010 - Arnaud + Severin: mark with a * things needed for release v0.1
03/05/2010 - Simon: added a "section" related to the management of the frame transformations
04/05/2010 - Arnaud + Severin + Nicolas + Gilberto: review of the list, with aims at a first release
28/05/2010 - Arnaud + Severin: update after "CMake operation"
14/06/2010 - Gilberto: Remove completed tasks
---

Code organisation
-----------------
Proposal:
- One repo for the simulator itself (morse.git) (let's remove everything else,
including clients and scenarii) - if middleware are externalized (cf
"Middlewares" below), testing clients for component could stay there. Genom3
template will go there as well (some day...)
- One repo for scenarii (morse-scenarii.git)

Installation
------------
* make && make install ?? -> use CMake, with options (YARP, Pocolibs...)
* Proposal for installation:
- $PREFIX/bin -> ors(.sh) (launch Blender + the ORS interface)
- $PREFIX/share/morse -> blend files for components
- $PREFIX/lib/site-package/morse -> python scripts for components
- $PREFIX/share/doc/morse -> ...something :)
* Add empty templates for scenes, robots, components... + mechanism to copy these
templates when creating a new scene.
[DEFERRED] - One repo for scenarii (morse-scenarii.git)

Architecture
------------
* moving to an object-oriented model. Each component should keep:
- its 3D transformation relative to world/parent/robot
- its static configuration + its instance configuration
- an UI associated to its parameters
- noise functions
* naming of components (Python files, .blend files)
* how components access other components? (eg: the cameras need the position of the robot)
* unified time management ("what if we want to simulate at 2X?")

Expand All @@ -52,14 +32,14 @@ User-interface
Middlewares
-----------
* Rethink the architecture ; three proposals:
- Current solution: one abstract interface. Issues: only one middleware at
[DISCARDED] - Current solution: one abstract interface. Issues: only one middleware at
once ; coupling. In any case, current code must be rewritten (factories,
etc)
- Components have "hooks" to export their data. Middleware lives in parallel
[ONGOING] - Components have "hooks" to export their data. Middleware lives in parallel
threads and "visit" the components. In this case, middlewares still lives
in the Python VM. Advantage: better decoupling ; middleware can dynamically
choose what they want to watch.
- External decoupling: Python components export their data as shared memory
[DEFFERED] - External decoupling: Python components export their data as shared memory
(or possibly sockets?), external modules (written in any language) read
this memory and format it for each middleware. Advantage: complete decoupling.
If a middleware crashes/slowdowns, no impact on the simulator, language
Expand All @@ -70,6 +50,9 @@ Middlewares
-> Discuss what to do with the "YARP-JSON" bridge from IRIT

* Requests: be sure that components can be remotely (ie by clients) configured

* Add serialize methods to the data of each component. This will format the data according to the needs of each middleware/architecture.


Linking issues
--------------
Expand All @@ -82,6 +65,8 @@ Coding style
- Replace all "print" by the Python logging interface
- every simple function must have a function comment ( """ ... """) + setup the
documentation to be generated
- Change the names of modules, variables, classes, etc. to comply with the
naming conventions in: http://www.python.org/dev/peps/pep-0008/

Frame transformations
-----------
Expand All @@ -98,5 +83,5 @@ Frame transformations
Other stuff
-----------
* write, complete, update, add to repo the general documentation of the simulator
* commit policy
- commit policy
- Blender 2.5
Binary file removed Textures/33_15_10-fire-flame-texture_web.jpg
Binary file not shown.
Binary file removed Textures/33_15_15---Fire-Flame-Texture_web.jpg
Binary file not shown.
Binary file removed Textures/TiZeta_clothe.jpg
Binary file not shown.
Binary file removed Textures/bois1.jpg
Binary file not shown.
Binary file removed Textures/fire.jpg
Binary file not shown.
Binary file removed Textures/paves.jpg
Binary file not shown.
Binary file removed Textures/plasma.png
Binary file not shown.

0 comments on commit 52e9c78

Please sign in to comment.