You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus R. <rol...@us...> - 2006-04-14 16:27:30
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13309/physicsserver Modified Files: body.h body.cpp collider.h collider.cpp Added Files: transformcollider.h transformcollider.cpp Log Message: - implemented support for the ODE transfom geom. This geom allows the displacement of a geom relative to the associated body. This allows to attach more than one geom to a body in a meaningful way to construct composite bodies - added method TranslateMass() to Body. This method translates the mass center of the body relativ to the body frame Index: body.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/body.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** body.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- body.cpp 14 Apr 2006 16:27:27 -0000 1.2 *************** *** 345,346 **** --- 345,353 ---- return Vector3f(pos[0], pos[1], pos[2]); } + + void Body::TranslateMass(const salt::Vector3f& v) + { + dMass m; + dBodyGetMass(mODEBody, &m); + dMassTranslate(&m,v[0],v[1],v[2]); + } Index: body.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/body.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** body.h 5 Dec 2005 21:16:49 -0000 1.1 --- body.h 14 Apr 2006 16:27:26 -0000 1.2 *************** *** 143,146 **** --- 143,149 ---- void SetCappedCylinderTotal(float total_mass, float radius, float length); + /** displace the mass center relative to the body frame */ + void TranslateMass(const salt::Vector3f& v); + /** returns the current linear velocity vector of this body */ salt::Vector3f GetVelocity() const; --- NEW FILE: transformcollider.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: transformcollider.h,v 1.1 2006/04/14 16:27:27 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef OXYGEN_TRANSFORMCOLLIDER_H #define OXYGEN_TRANSFORMCOLLIDER_H #include "collider.h" namespace oxygen { /** TransformCollider encapsulates an ODE transform geometry object that encapsulates another geom. It allows the encapsulated geom to be positioned and rotated arbitrarily with respect to its point of reference. Most geoms (like the sphere and box) have their point of reference corresponding to their center of mass, allowing them to be easily connected to dynamics objects. Transform objects give you more flexibility - for example, you can offset the center of a sphere, or rotate a cylinder so that its axis is something other than the default. Transform geoms are further used to create composite objects. As they allow multiple displaced geoms to be connected to one body. */ class TransformCollider : public Collider { // // Functions // public: TransformCollider(); protected: virtual bool ConstructInternal(); }; DECLARE_CLASS(TransformCollider); } //namespace oxygen #endif //OXYGEN_TRANSFORMCOLLIDER_H --- NEW FILE: transformcollider.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: transformcollider.cpp,v 1.1 2006/04/14 16:27:27 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "transformcollider.h" using namespace oxygen; using namespace salt; TransformCollider::TransformCollider() : Collider() { } bool TransformCollider::ConstructInternal() { if (! Collider::ConstructInternal()) { return false; } mODEGeom = dCreateGeomTransform(0); if (mODEGeom == 0) { return false; } //! do not automatically destroy encapsulated geoms dGeomTransformSetCleanup(mODEGeom, 0); /** report the transform geom in collisions instead of the encapsulated geoms */ dGeomTransformSetInfo(mODEGeom, 1); return true; } Index: collider.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** collider.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- collider.cpp 14 Apr 2006 16:27:27 -0000 1.2 *************** *** 20,28 **** */ #include "collider.h" #include "space.h" #include "body.h" #include "collisionhandler.h" ! #include <oxygen/sceneserver/scene.h> ! #include <zeitgeist/logserver/logserver.h> using namespace oxygen; --- 20,29 ---- */ #include "collider.h" + #include <oxygen/sceneserver/scene.h> + #include <zeitgeist/logserver/logserver.h> #include "space.h" #include "body.h" #include "collisionhandler.h" ! #include "transformcollider.h" using namespace oxygen; *************** *** 48,56 **** ODEObject::OnLink(); ! if (mODEGeom == 0) { return; } // if we have a space add the geom to it dSpaceID space = GetSpaceID(); --- 49,75 ---- ODEObject::OnLink(); ! weak_ptr<Node> parent = GetParent(); ! if ( ! (mODEGeom == 0) || ! (parent.expired()) ! ) { return; } + shared_ptr<TransformCollider> tcParent = + shared_dynamic_cast<TransformCollider>(parent.lock()); + + if (tcParent.get() != 0) + { + // our parent is an ODE transform geom that encapsulates + // this geom, so register ourself to it. This geom must + // not directly register to a space or a body. + dGeomTransformSetGeom(tcParent->GetODEGeom(), mODEGeom); + return; + } + + // this geom is independent, so register to space and body + // if we have a space add the geom to it dSpaceID space = GetSpaceID(); *************** *** 66,70 **** // if there is a Body below our parent, link to it shared_ptr<Body> body = shared_static_cast<Body> ! (make_shared(GetParent())->GetChildOfClass("Body")); if (body.get() != 0) --- 85,89 ---- // if there is a Body below our parent, link to it shared_ptr<Body> body = shared_static_cast<Body> ! (parent.lock()->GetChildOfClass("Body")); if (body.get() != 0) *************** *** 106,117 **** void Collider::PrePhysicsUpdateInternal(float /*deltaTime*/) { ! if (GetChildSupportingClass("CollisionHandler").get() == 0) ! { ! // for convenience we add a ContactJointHandler if no ! // other handler is registered. This behaviour covers the ! // majority of all use cases and eases the creation of ! // Colliders. ! AddCollisionHandler("oxygen/ContactJointHandler"); ! } } --- 125,136 ---- void Collider::PrePhysicsUpdateInternal(float /*deltaTime*/) { ! // if (GetChildSupportingClass("CollisionHandler").get() == 0) ! // { ! // // for convenience we add a ContactJointHandler if no ! // // other handler is registered. This behaviour covers the ! // // majority of all use cases and eases the creation of ! // // Colliders. ! // AddCollisionHandler("oxygen/ContactJointHandler"); ! // } } Index: collider.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** collider.h 5 Dec 2005 21:16:49 -0000 1.1 --- collider.h 14 Apr 2006 16:27:27 -0000 1.2 *************** *** 95,99 **** /** returns the ID of managed ODE geom */ dGeomID GetODEGeom(); - /** sets the relative position of the managed geom directly. If the geom is connected to a body, the position of the body will --- 95,98 ---- |
From: Markus R. <rol...@us...> - 2006-04-14 14:59:18
|
Update of /cvsroot/simspark/simspark/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12208 Modified Files: acinclude.m4 Log Message: - define HAVE_KEROSIN_H if kerosin lib is found Index: acinclude.m4 =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/acinclude.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** acinclude.m4 25 Dec 2005 15:06:28 -0000 1.1 --- acinclude.m4 14 Apr 2006 14:59:06 -0000 1.2 *************** *** 107,110 **** --- 107,112 ---- AC_MSG_RESULT([$spark_kerosin_cppflags]) AC_SUBST(KEROSIN_CPPFLAGS, [$spark_kerosin_cppflags]) + + AC_DEFINE(HAVE_KEROSIN_H, 1, [Define to 1 if using the kerosin header]) ]) # SPARK_LIB_KEROSIN |
From: Markus R. <rol...@us...> - 2006-03-10 00:16:09
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30810 Modified Files: core.h core.cpp Log Message: - implemented an automatic stack trace that is triggered when we receive a segmentation fault. The implementation uses the backtrace facility of recent glibc version and the addr2line tool from the binutils package to demangle symbol and to print line number. Needs some cleanup: test for presence of execinfo.h and addr2line. Index: core.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/core.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** core.cpp 5 Dec 2005 20:59:18 -0000 1.1 --- core.cpp 10 Mar 2006 00:16:06 -0000 1.2 *************** *** 35,39 **** --- 35,42 ---- #include <salt/path.h> #include <salt/sharedlibrary.h> + #include <execinfo.h> + #include <signal.h> #include <iostream> + #include <sstream> using namespace boost; *************** *** 146,149 **** --- 149,204 ---- mRandomServer = shared_static_cast<RandomServer> (context->New("zeitgeist/RandomServer", "/sys/server/random")); + + // install fault handler + signal(SIGSEGV, CatchSignal); + } + + void Core::CatchSignal(int sig_num) + { + if (sig_num != SIGSEGV) + { + return; + } + + cerr << "(Core) caught signal " << sig_num << endl; + + // retrieve the name of our executable without access to argc and + // argv (this works only with linux) + + const int exeNameSz = 4096; + char exeName[exeNameSz]; + readlink("/proc/self/exe",exeName,exeNameSz); + + // print stack trace + + const int arSize = 200; + void *addresses[arSize]; + + int depth = backtrace (addresses, arSize); + char **strings = backtrace_symbols (addresses, depth); + + cerr << "(Core) dumping " << depth << " stack frames.\n"; + + for (int i=0; i<depth; ++i) + { + cerr << "[" << i << "] " << strings[i] << "\n"; + + // use the addr2line tool from binutils to retrieve the + // source line from the frame adress + // -C : decode, demangle low-level symbol names + // -e : specify executable name + // -f : display function names, as well as file and line number info + + stringstream ss; + ss << "addr2line -C -f -e \"" << exeName << "\" " << addresses[i]; + system(ss.str().c_str()); + + cerr << "\n"; + } + + free (strings); + + cerr << "(Core) exit" << endl; + exit(1); } Index: core.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/core.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** core.h 5 Dec 2005 20:59:18 -0000 1.1 --- core.h 10 Mar 2006 00:16:06 -0000 1.2 *************** *** 181,184 **** --- 181,187 ---- const boost::shared_ptr<Leaf>& base); + /** signal handler */ + static void CatchSignal(int sig_num); + // // members |
From: Markus R. <rol...@us...> - 2006-03-10 00:11:54
|
Update of /cvsroot/simspark/simspark/spark/test/coretest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28361 Modified Files: main.cpp Log Message: - implemented the 'crash' command ;) Index: main.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/test/coretest/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 19 Dec 2005 20:42:23 -0000 1.1 --- main.cpp 10 Mar 2006 00:11:48 -0000 1.2 *************** *** 65,69 **** done = true; } ! else { scriptServer->Eval(command.c_str()); --- 65,75 ---- done = true; } ! else if (command.compare("crash")==0) ! { ! // crash and burn; this is actually a feature as it ! // helps testing the builtin zeitgeist Core stack dump ! int* i=0; ! (*i)=0; ! } { scriptServer->Eval(command.c_str()); |
From: Oliver O. <fr...@us...> - 2006-03-08 18:17:07
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9416 Modified Files: Makefile.am spark.cpp spark.h Log Message: made spark wrapper independent of kerosin Index: spark.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** spark.cpp 2 Jan 2006 20:39:14 -0000 1.2 --- spark.cpp 8 Mar 2006 18:17:03 -0000 1.3 *************** *** 21,32 **** #include "spark.h" #include <zeitgeist/zeitgeist.h> - #include <kerosin/kerosin.h> #include <oxygen/oxygen.h> #include <kerosin/renderserver/rendercontrol.h> #include <kerosin/inputserver/inputserver.h> #include <kerosin/inputserver/inputcontrol.h> - using namespace spark; using namespace kerosin; using namespace oxygen; using namespace zeitgeist; --- 21,36 ---- #include "spark.h" #include <zeitgeist/zeitgeist.h> #include <oxygen/oxygen.h> + + #if HAVE_KEROSIN_H + #include <kerosin/kerosin.h> #include <kerosin/renderserver/rendercontrol.h> #include <kerosin/inputserver/inputserver.h> #include <kerosin/inputserver/inputcontrol.h> using namespace kerosin; + #endif + + using namespace spark; using namespace oxygen; using namespace zeitgeist; *************** *** 37,42 **** Spark::Spark(const string& relPathPrefix) : mZeitgeist(new Zeitgeist("." PACKAGE_NAME, relPathPrefix)), ! mOxygen(new Oxygen(*mZeitgeist)), ! mKerosin(new Kerosin(*mZeitgeist)) { } --- 41,48 ---- Spark::Spark(const string& relPathPrefix) : mZeitgeist(new Zeitgeist("." PACKAGE_NAME, relPathPrefix)), ! mOxygen(new Oxygen(*mZeitgeist)) ! #if HAVE_KEROSIN_H ! , mKerosin(new Kerosin(*mZeitgeist)) ! #endif { } *************** *** 52,71 **** } ! bool Spark::Init(int argc, char** argv) { mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) ! { ! cout << "(Spark) ERROR: LogServer not found\n"; ! return false; ! } mScriptServer = mZeitgeist->GetCore()->GetScriptServer(); if (mScriptServer.get() == 0) ! { ! mLogServer->Error() ! << "(Spark) ERROR: ScriptServer not found\n"; ! return false; ! } // run the spark init script --- 58,77 ---- } ! bool ! Spark::Init(int argc, char** argv) { mLogServer = mZeitgeist->GetCore()->GetLogServer(); if (mLogServer.get() == 0) ! { ! cerr << "(Spark) ERROR: LogServer not found\n"; ! return false; ! } mScriptServer = mZeitgeist->GetCore()->GetScriptServer(); if (mScriptServer.get() == 0) ! { ! mLogServer->Error() << "(Spark) ERROR: ScriptServer not found\n"; ! return false; ! } // run the spark init script *************** *** 81,88 **** if (mSceneServer.get() == 0) ! { ! mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! return false; ! } mSimulationServer = shared_dynamic_cast<SimulationServer> --- 87,94 ---- if (mSceneServer.get() == 0) ! { ! mLogServer->Error() << "(Spark) ERROR: SceneServer not found\n"; ! return false; ! } mSimulationServer = shared_dynamic_cast<SimulationServer> *************** *** 90,97 **** if (mSimulationServer.get() == 0) ! { ! mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! return false; ! } // run the app defined init --- 96,103 ---- if (mSimulationServer.get() == 0) ! { ! mLogServer->Error() << "(Spark) ERROR: SimulationServer not found\n"; ! return false; ! } // run the app defined init *************** *** 99,138 **** } ! bool Spark::InitApp(int /*argc*/, char** /*argv*/) { return true; } ! Zeitgeist& Spark::GetZeitgeist() { return (*mZeitgeist); } ! shared_ptr<Core> Spark::GetCore() { return mZeitgeist->GetCore(); } ! shared_ptr<zeitgeist::LogServer> Spark::GetLog() { return mZeitgeist->GetCore()->GetLogServer(); } ! shared_ptr<SceneServer> Spark::GetSceneServer() { return mSceneServer; } ! shared_ptr<SimulationServer> Spark::GetSimulationServer() { return mSimulationServer; } ! shared_ptr<InputControl> Spark::GetInputControl() { if (mSimulationServer.get() == 0) ! { ! return shared_ptr<InputControl>(); ! } return shared_dynamic_cast<InputControl> --- 105,152 ---- } ! bool ! Spark::InitApp(int /*argc*/, char** /*argv*/) { return true; } ! Zeitgeist& ! Spark::GetZeitgeist() { return (*mZeitgeist); } ! shared_ptr<Core> ! Spark::GetCore() { return mZeitgeist->GetCore(); } ! shared_ptr<zeitgeist::LogServer> ! Spark::GetLog() { return mZeitgeist->GetCore()->GetLogServer(); } ! shared_ptr<SceneServer> ! Spark::GetSceneServer() { return mSceneServer; } ! shared_ptr<SimulationServer> ! Spark::GetSimulationServer() { return mSimulationServer; } ! #if HAVE_KEROSIN_H ! shared_ptr<InputControl> ! Spark::GetInputControl() { if (mSimulationServer.get() == 0) ! { ! return shared_ptr<InputControl>(); ! } return shared_dynamic_cast<InputControl> *************** *** 140,144 **** } ! shared_ptr<InputServer> Spark::GetInputServer() { return shared_dynamic_cast<kerosin::InputServer> --- 154,159 ---- } ! shared_ptr<InputServer> ! Spark::GetInputServer() { return shared_dynamic_cast<kerosin::InputServer> *************** *** 146,174 **** } ! shared_ptr<RenderControl> Spark::GetRenderControl() { if (mSimulationServer.get() == 0) ! { ! return shared_ptr<RenderControl>(); ! } return shared_dynamic_cast<RenderControl> (mSimulationServer->GetControlNode("RenderControl")); } ! shared_ptr<ScriptServer> Spark::GetScriptServer() { return mScriptServer; } ! shared_ptr<Scene> Spark::GetActiveScene() { shared_ptr<Scene> scene = mSceneServer->GetActiveScene(); if (scene.get() == 0) ! { ! mLogServer->Warning() ! << "(Spark) Warning: no active scene registered\n"; ! } return scene; --- 161,193 ---- } ! shared_ptr<RenderControl> ! Spark::GetRenderControl() { if (mSimulationServer.get() == 0) ! { ! return shared_ptr<RenderControl>(); ! } return shared_dynamic_cast<RenderControl> (mSimulationServer->GetControlNode("RenderControl")); } + #endif // HAVE_KEROSIN_H ! shared_ptr<ScriptServer> ! Spark::GetScriptServer() { return mScriptServer; } ! shared_ptr<Scene> ! Spark::GetActiveScene() { shared_ptr<Scene> scene = mSceneServer->GetActiveScene(); if (scene.get() == 0) ! { ! mLogServer->Warning() ! << "(Spark) Warning: no active scene registered\n"; ! } return scene; Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 8 Mar 2006 16:49:48 -0000 1.3 --- Makefile.am 8 Mar 2006 18:17:03 -0000 1.4 *************** *** 1,3 **** - if BUILD_KEROSIN if DEBUG pkglib_LTLIBRARIES = libspark_debug.la --- 1,2 ---- *************** *** 14,19 **** endif - endif - bin_SCRIPTS = spark-config --- 13,16 ---- *************** *** 33,36 **** nobase_libpkginclude_HEADERS = \ spark.h - - --- 30,31 ---- Index: spark.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** spark.h 2 Jan 2006 20:39:14 -0000 1.2 --- spark.h 8 Mar 2006 18:17:03 -0000 1.3 *************** *** 21,24 **** --- 21,28 ---- #define SPARK_SPARK_H + #if HAVE_CONFIG_H + #include <config.h> + #endif + #include <string> #include <boost/shared_ptr.hpp> *************** *** 40,43 **** --- 44,48 ---- } + #if HAVE_KEROSIN_H namespace kerosin { *************** *** 47,50 **** --- 52,56 ---- class InputServer; } + #endif namespace spark *************** *** 90,96 **** boost::shared_ptr<oxygen::SceneServer> GetSceneServer(); - /** returns the InputServer */ - boost::shared_ptr<kerosin::InputServer> GetInputServer(); - /** returns the current active Scene */ boost::shared_ptr<oxygen::Scene> GetActiveScene(); --- 96,99 ---- *************** *** 99,102 **** --- 102,109 ---- boost::shared_ptr<oxygen::SimulationServer> GetSimulationServer(); + #if HAVE_KEROSIN_H + /** returns the InputServer */ + boost::shared_ptr<kerosin::InputServer> GetInputServer(); + /** returns the input control node */ boost::shared_ptr<kerosin::InputControl> GetInputControl(); *************** *** 104,107 **** --- 111,115 ---- /** returns the render control node */ boost::shared_ptr<kerosin::RenderControl> GetRenderControl(); + #endif protected: *************** *** 113,117 **** --- 121,127 ---- boost::shared_ptr<zeitgeist::Zeitgeist> mZeitgeist; boost::shared_ptr<oxygen::Oxygen> mOxygen; + #if HAVE_KEROSIN_H boost::shared_ptr<kerosin::Kerosin> mKerosin; + #endif }; |
From: Oliver O. <fr...@us...> - 2006-03-08 17:13:47
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5914 Modified Files: configure.ac Log Message: - cleaned up the old Spades check and installed the new macro. SPARK is now configured to (not) use SPADES by using the --enable-spades (--disable-spades) option instead of the --with-spades option. --enable/--disable should be used for controlling optional features. Index: configure.ac =================================================================== RCS file: /cvsroot/simspark/simspark/spark/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure.ac 8 Mar 2006 09:30:37 -0000 1.4 --- configure.ac 8 Mar 2006 17:13:42 -0000 1.5 *************** *** 118,166 **** RCSS_CHECK_RUBY_VERSION(1,8,0) RCSS_CHECK_ODE WX_CPPFLAGS="`wx-config --cppflags`" WX_LDFLAGS="`wx-config --libs` `wx-config --gl-libs`" - AC_SUBST(WX_CPPFLAGS) AC_SUBST(WX_LDFLAGS) - AC_ARG_VAR(SPADES, [prefix of SPADES installation]) - AC_ARG_WITH([spades], - [AC_HELP_STRING([--with-spades], - [whether to support SPADES-SIM (default is yes)])], - [rcss_with_spades=$withval], - [rcss_with_spades=yes]) - - if test "$rcss_with_spades" = yes; then - if test "$SPADES"; then - if test -z "$PATH"; then - PATH="$SPADES/bin" - else - PATH="$PATH:$SPADES/bin" - fi - if test -z "$LDFLAGS"; then - LDFLAGS="-L$SPADES/lib" - else - LDFLAGS="$LDFLAGS -L$SPADES/lib" - fi - if test -z "$CPPFLAGS"; then - CPPFLAGS="-I$SPADES/include" - else - CPPFLAGS="$CPPFLAGS -I$SPADES/include" - fi - fi - RCSS_LIB_SPADES([rcss_build_spades=yes - AC_DEFINE([HAVE_SPADES_HEADERS], 1, - [Define to 1 if you have the SPADES header files])], - [AC_MSG_ERROR([the SPADES library (http://spades-sim.sourceforge.net) cannot be found. Please specify the prefix used when installing SPADES with the SPADES enviroment variable.])]) - else - rcss_build_spades=no - AC_MSG_NOTICE([SpadesServer will not be build]) - fi - AM_CONDITIONAL(BUILD_SPADES_MODULES, test $rcss_build_spades = yes) - - - - # create Makefiles and other configuration files AC_CONFIG_FILES([Makefile \ --- 118,128 ---- RCSS_CHECK_RUBY_VERSION(1,8,0) RCSS_CHECK_ODE + RCSS_BUILD_SPADES_SERVER WX_CPPFLAGS="`wx-config --cppflags`" WX_LDFLAGS="`wx-config --libs` `wx-config --gl-libs`" AC_SUBST(WX_CPPFLAGS) AC_SUBST(WX_LDFLAGS) # create Makefiles and other configuration files AC_CONFIG_FILES([Makefile \ |
From: Oliver O. <fr...@us...> - 2006-03-08 17:08:03
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2630 Modified Files: acinclude.m4 Log Message: - changed the DevIL check so that kerosin can be built with no DevIL. If the DevIL headers are found, but libIL is not, we still throw an error. A Metavariable IL_LIBADD is defined for use in the Makefiles (for linking libIL if present) - changed messages and orderings in the SPADES checks - fixed comments to match the actual code Index: acinclude.m4 =================================================================== RCS file: /cvsroot/simspark/simspark/spark/acinclude.m4,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** acinclude.m4 8 Mar 2006 09:22:42 -0000 1.3 --- acinclude.m4 8 Mar 2006 17:07:54 -0000 1.4 *************** *** 190,195 **** # if rcss_build_kerosin is (still) set to 'yes', check for the DEVIL # headers and libraries. ! # If DEVIL headers or libraries can not be found, building kerosin will ! # be disabled. #----------------------------------------------------------------------------- AC_DEFUN([RCSS_CHECK_DEVIL], [ --- 190,199 ---- # if rcss_build_kerosin is (still) set to 'yes', check for the DEVIL # headers and libraries. ! # If DEVIL headers can not be found, kerosin will be built with no image ! # loading/saving support. ! # If the headers can be found, but the library is not there, we stop ! # with an error. ! # Substitutes: @IL_LIBADD@ the flags for linking with libIL ! # Defines: HAVE_IL_IL_H if the IL/il.h header file is present #----------------------------------------------------------------------------- AC_DEFUN([RCSS_CHECK_DEVIL], [ *************** *** 200,218 **** fi RCSS_KEROSIN_IF_ELSE([ ! AC_CHECK_HEADERS([IL/il.h],, ! RCSS_BUILD_KEROSIN_ERROR([DevIL headers not found. ! Please set CPPFLAGS appropriately or you can specify the location of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])) ]) ! RCSS_KEROSIN_IF_ELSE([ ! rcss_tmp="$LDFLAGS" ! LDFLAGS="$LDFLAGS -lIL" ! AC_LINK_IFELSE([#include <IL/il.h> #include <stdarg.h> /* _vsnprintf may be undefined (and it is needed by libIL) */ extern "C" int _vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0;} int main() { ilInit(); return 0; }],, ! RCSS_BUILD_KEROSIN_ERROR([The DevIL library (libIL.a or libIL.so) cannot be found. ! Please set LDFLAGS appropriately or you can specify the location of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])) ! LDFLAGS="$rcss_tmp" ! ]) ]) # RCSS_CHECK_DEVIL --- 204,229 ---- fi RCSS_KEROSIN_IF_ELSE([ ! AC_CHECK_HEADERS([IL/il.h],rcss_tmp="yes", ! [rcss_tmp="no" ! AC_MSG_WARN([DevIL headers not found. Loading/Saving images will not be supported]) ! AC_MSG_WARN([To enable image support, please set CPPFLAGS appropriately or you can specify the location of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])]) ]) ! if test "$rcss_tmp" = "no"; then ! IL_LIBADD="" ! else ! IL_LIBADD="-lIL" ! RCSS_KEROSIN_IF_ELSE([rcss_tmp="$LDFLAGS" ! LDFLAGS="$LDFLAGS -lIL" ! AC_LINK_IFELSE([#include <IL/il.h> #include <stdarg.h> /* _vsnprintf may be undefined (and it is needed by libIL) */ extern "C" int _vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0;} int main() { ilInit(); return 0; }],, ! [RCSS_BUILD_KEROSIN_ERROR([The DevIL headers are present but the library (libIL.a or libIL.so) cannot be found.]) ! RCSS_BUILD_KEROSIN_ERROR([Please set LDFLAGS appropriately. Alternatively you can specify the location ]) ! RCSS_BUILD_KEROSIN_ERROR([of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])]) ! LDFLAGS="$rcss_tmp" ! ]) ! fi ! AC_SUBST(IL_LIBADD) ]) # RCSS_CHECK_DEVIL *************** *** 320,328 **** RCSS_BUILD_KEROSIN_INTERNAL fi - AM_CONDITIONAL(BUILD_KEROSIN, test x$rcss_build_kerosin = xyes) if test "$rcss_build_kerosin" = no; then AC_MSG_NOTICE([libkerosin will not be build...]) AC_MSG_NOTICE([...you can enable it using the --enable-kerosin flag]) fi ]) # RCSS_BUILD_KEROSIN --- 331,339 ---- RCSS_BUILD_KEROSIN_INTERNAL fi if test "$rcss_build_kerosin" = no; then AC_MSG_NOTICE([libkerosin will not be build...]) AC_MSG_NOTICE([...you can enable it using the --enable-kerosin flag]) fi + AM_CONDITIONAL(BUILD_KEROSIN, test x$rcss_build_kerosin = xyes) ]) # RCSS_BUILD_KEROSIN *************** *** 353,357 **** #----------------------------------------------------------------------------- AC_DEFUN([RCSS_BUILD_SPADES_SERVER], [ ! # --enable-kerosin AC_ARG_ENABLE(spades, AC_HELP_STRING([--enable-spades=@<:@yes|no@:>@], --- 364,369 ---- #----------------------------------------------------------------------------- AC_DEFUN([RCSS_BUILD_SPADES_SERVER], [ ! AC_ARG_VAR(SPADES, [location of the SPADES library]) ! # --enable-spades AC_ARG_ENABLE(spades, AC_HELP_STRING([--enable-spades=@<:@yes|no@:>@], *************** *** 363,372 **** AC_MSG_NOTICE([Checking prerequisites for building the spades server...]) RCSS_LIB_SPADES fi - AM_CONDITIONAL(BUILD_SPADES, test x$rcss_build_spades = xyes) if test "$rcss_build_spades" = no; then ! AC_MSG_NOTICE([the spades server will not be build...]) ! AC_MSG_NOTICE([...you can enable it using the --enable-spades flag]) fi ]) # RCSS_BUILD_SPADES_SERVER --- 375,387 ---- AC_MSG_NOTICE([Checking prerequisites for building the spades server...]) RCSS_LIB_SPADES + else + AC_MSG_NOTICE([======================================================]) + AC_MSG_NOTICE([You have chosen not to build the SPADES Server module.]) fi if test "$rcss_build_spades" = no; then ! AC_MSG_WARN([The SPADES server will not be build. To build this module,]) ! AC_MSG_WARN([you have to configure again using the --enable-spades option.]) fi + AM_CONDITIONAL(BUILD_SPADES_SERVER, test x$rcss_build_spades = xyes) ]) # RCSS_BUILD_SPADES_SERVER *************** *** 375,380 **** # --------------------------------------------------------- AC_DEFUN([RCSS_LIB_SPADES], ! [AS_VAR_PUSHDEF([rcss_lib_spades], [rcss_cv_lib_spades])dnl ! AC_CACHE_CHECK(whether the spades library is available, rcss_cv_lib_spades, [AC_LANG_PUSH(C++) OLD_LDFLAGS="$LDFLAGS" --- 390,400 ---- # --------------------------------------------------------- AC_DEFUN([RCSS_LIB_SPADES], ! [AS_VAR_PUSHDEF([rcss_lib_spades], [rcss_cv_lib_spades])dnl ! if test "$SPADES"; then ! PATH="$PATH:$SPADES/bin" ! LDFLAGS="$LDFLAGS -L$SPADES/lib" ! CPPFLAGS="$CPPFLAGS -I$SPADES/include" ! fi ! AC_CACHE_CHECK(whether the spades library is available, rcss_cv_lib_spades, [AC_LANG_PUSH(C++) OLD_LDFLAGS="$LDFLAGS" |
From: Oliver O. <fr...@us...> - 2006-03-08 17:02:36
|
Update of /cvsroot/simspark/simspark/spark/oxygen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31849 Modified Files: Makefile.am Log Message: renamed conditional Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 5 Dec 2005 21:16:49 -0000 1.1 --- Makefile.am 8 Mar 2006 17:02:33 -0000 1.2 *************** *** 28,32 **** bin_SCRIPTS = oxygen-config ! if BUILD_SPADES_MODULES spades_sources = \ spadesserver/spadesserver.cpp \ --- 28,32 ---- bin_SCRIPTS = oxygen-config ! if BUILD_SPADES_SERVER spades_sources = \ spadesserver/spadesserver.cpp \ |
From: Oliver O. <fr...@us...> - 2006-03-08 17:00:21
|
Update of /cvsroot/simspark/simspark/spark/kerosin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30482 Modified Files: Makefile.am Log Message: - link DevIL conditionally only Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 18 Feb 2006 19:40:58 -0000 1.5 --- Makefile.am 8 Mar 2006 17:00:17 -0000 1.6 *************** *** 5,9 **** nodist_libkerosin_debug_la_SOURCES = openglserver/glextensionreg.cpp libkerosin_debug_la_CXXFLAGS = -O -g -W -Wall ! libkerosin_debug_la_LIBADD = @FREETYPE_LIBADD@ -lSDL -lIL -lGL libkerosin_debug_la_LDFLAGS = -version-info @kerosin_version_info@ else --- 5,9 ---- nodist_libkerosin_debug_la_SOURCES = openglserver/glextensionreg.cpp libkerosin_debug_la_CXXFLAGS = -O -g -W -Wall ! libkerosin_debug_la_LIBADD = @FREETYPE_LIBADD@ -lSDL @IL_LIBADD@ -lGL libkerosin_debug_la_LDFLAGS = -version-info @kerosin_version_info@ else *************** *** 12,16 **** nodist_libkerosin_la_SOURCES = openglserver/glextensionreg.cpp libkerosin_la_CXXFLAGS = -O2 ! libkerosin_la_LIBADD = @FREETYPE_LIBADD@ -lSDL -lIL -lGL libkerosin_la_LDFLAGS = -version-info @kerosin_version_info@ endif --- 12,16 ---- nodist_libkerosin_la_SOURCES = openglserver/glextensionreg.cpp libkerosin_la_CXXFLAGS = -O2 ! libkerosin_la_LIBADD = @FREETYPE_LIBADD@ -lSDL @IL_LIBADD@ -lGL libkerosin_la_LDFLAGS = -version-info @kerosin_version_info@ endif |
From: Oliver O. <fr...@us...> - 2006-03-08 16:53:00
|
Update of /cvsroot/simspark/simspark/spark/kerosin/imageserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26628 Modified Files: imageserver.cpp Log Message: - moved declaration of global fileserver outside the conditional compilation (as the file server is needed in all cases). Index: imageserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/imageserver.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** imageserver.cpp 8 Mar 2006 09:18:56 -0000 1.2 --- imageserver.cpp 8 Mar 2006 16:52:57 -0000 1.3 *************** *** 33,41 **** using namespace std; #if HAVE_IL_IL_H //----------------------------------------------------------------------------- // FileServer hooks for DevIL //----------------------------------------------------------------------------- - shared_ptr<FileServer> gFileServer; ILHANDLE --- 33,42 ---- using namespace std; + shared_ptr<FileServer> gFileServer; + #if HAVE_IL_IL_H //----------------------------------------------------------------------------- // FileServer hooks for DevIL //----------------------------------------------------------------------------- ILHANDLE |
From: Oliver O. <fr...@us...> - 2006-03-08 16:49:54
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24931 Modified Files: Makefile.am Log Message: removed library dependencies from Makefile Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 25 Dec 2005 14:55:52 -0000 1.2 --- Makefile.am 8 Mar 2006 16:49:48 -0000 1.3 *************** *** 4,8 **** libspark_debug_la_SOURCES = $(sources) libspark_debug_la_CXXFLAGS = -O -g -W -Wall ! libspark_debug_la_LIBADD = @FREETYPE_LIBADD@ -lSDL -lIL -lGL libspark_debug_la_LDFLAGS = -version-info @spark_version_info@ else --- 4,8 ---- libspark_debug_la_SOURCES = $(sources) libspark_debug_la_CXXFLAGS = -O -g -W -Wall ! libspark_debug_la_LIBADD = libspark_debug_la_LDFLAGS = -version-info @spark_version_info@ else *************** *** 10,14 **** libspark_la_SOURCES = $(sources) libspark_la_CXXFLAGS = -O2 ! libspark_la_LIBADD = @FREETYPE_LIBADD@ -lSDL -lIL -lGL libspark_la_LDFLAGS = -version-info @spark_version_info@ endif --- 10,14 ---- libspark_la_SOURCES = $(sources) libspark_la_CXXFLAGS = -O2 ! libspark_la_LIBADD = libspark_la_LDFLAGS = -version-info @spark_version_info@ endif |
From: Oliver O. <fr...@us...> - 2006-03-08 09:30:45
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14435 Modified Files: configure.ac Log Message: - removed a few superflous checks - removed hash_map check - changes due to changes in the LIB_SPADES macro Index: configure.ac =================================================================== RCS file: /cvsroot/simspark/simspark/spark/configure.ac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.ac 24 Jan 2006 19:18:39 -0000 1.3 --- configure.ac 8 Mar 2006 09:30:37 -0000 1.4 *************** *** 50,60 **** AC_CHECK_HEADERS([arpa/nameser.h]) AC_CHECK_HEADERS([resolv.h netdb.h]) ! AC_CHECK_HEADERS([float.h limits.h malloc.h memory.h stdlib.h string.h]) AC_CHECK_HEADER([boost/version.hpp],, AC_MSG_ERROR([boost library not found. Please specify the location of the boost header directory using the CPPFLAGS environment variable])) - AC_CHECK_HEADERS([hash_map],, - AC_MSG_NOTICE(['hash_map' will be substituted by 'map'. If you need hash_map install stlport])) # Checks for typedefs, structures, and compiler characteristics. --- 50,58 ---- AC_CHECK_HEADERS([arpa/nameser.h]) AC_CHECK_HEADERS([resolv.h netdb.h]) ! AC_CHECK_HEADERS([float.h limits.h memory.h stdlib.h string.h]) AC_CHECK_HEADER([boost/version.hpp],, AC_MSG_ERROR([boost library not found. Please specify the location of the boost header directory using the CPPFLAGS environment variable])) # Checks for typedefs, structures, and compiler characteristics. *************** *** 152,159 **** fi fi ! AC_LIB_SPADES([rcss_build_spades=yes ! AC_DEFINE([HAVE_SPADES_HEADERS], 1, ! [Define to 1 if you have the SPADES header files])], ! [AC_MSG_ERROR([the SPADES library (http://spades-sim.sourceforge.net) cannot be found. Please specify the prefix used when installing SPADES with the SPADES enviroment variable.])]) else rcss_build_spades=no --- 150,157 ---- fi fi ! RCSS_LIB_SPADES([rcss_build_spades=yes ! AC_DEFINE([HAVE_SPADES_HEADERS], 1, ! [Define to 1 if you have the SPADES header files])], ! [AC_MSG_ERROR([the SPADES library (http://spades-sim.sourceforge.net) cannot be found. Please specify the prefix used when installing SPADES with the SPADES enviroment variable.])]) else rcss_build_spades=no |
From: Oliver O. <fr...@us...> - 2006-03-08 09:22:46
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10454 Modified Files: acinclude.m4 Log Message: - changed DevIL check to define preprocessor symbols - removed rcssbase check (not needed) - renamed AC_SPADES... macro to RCSS_BUILD_SPADES_SERVER (the AC prefix means that the macro was provided by autoconf, mere mortal users like us are encouraged to use a different prefix for our macros) Index: acinclude.m4 =================================================================== RCS file: /cvsroot/simspark/simspark/spark/acinclude.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** acinclude.m4 19 Feb 2006 12:56:07 -0000 1.2 --- acinclude.m4 8 Mar 2006 09:22:42 -0000 1.3 *************** *** 86,111 **** ]) # RCSS_CHECK_RUBY_VERSION - # RCSS_CHECK_RCSSBASE - #----------------------------------------------------------------------------- - AC_DEFUN([RCSS_CHECK_RCSSBASE], [ - AC_ARG_VAR(RCSSBASE, [location of rcssbase installation]) - if test $RCSSBASE; then - CPPFLAGS="$CPPFLAGS -I$RCSSBASE/include" - LDFLAGS="$LDFLAGS -L$RCSSBASE/lib" - fi - - AC_CHECK_HEADERS([rcssbase/net/udpsocket.hpp],,[ - AC_MSG_ERROR([The rcssbase headers (e.g. rcssbase/net/udpsocket.hpp) cannot be found. Please specify the location of the rcssbase installation, by using the RCSSBASE environment variable (e.g. ./configure RCSSBASE=$HOME/rcssbase)])]) - - AC_MSG_CHECKING([for the rcssnet library]) - rcss_tmp="$LDFLAGS" - LDFLAGS="$LDFLAGS -lrcssnet" - AC_LINK_IFELSE([int main() { return 0; }], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([The rcssnet library (librcssnet.a or librcssnet.so) cannot be found. Please specify the location of the rcssbase installation using the RCSSBASE environment variable (e.g. ./configure RCSSBASE=$HOME/rcssbase)])]) - LDFLAGS="$rcss_tmp" - ]) # RCSS_CHECK_RCSSBASE - # RCSS_CHECK_ODE #----------------------------------------------------------------------------- --- 86,89 ---- *************** *** 222,226 **** fi RCSS_KEROSIN_IF_ELSE([ ! AC_CHECK_HEADER([IL/il.h],, RCSS_BUILD_KEROSIN_ERROR([DevIL headers not found. Please set CPPFLAGS appropriately or you can specify the location of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])) --- 200,204 ---- fi RCSS_KEROSIN_IF_ELSE([ ! AC_CHECK_HEADERS([IL/il.h],, RCSS_BUILD_KEROSIN_ERROR([DevIL headers not found. Please set CPPFLAGS appropriately or you can specify the location of the DevIL installation using the DEVIL environment variable (e.g. ./configure DEVIL=$HOME/DevIL)])) *************** *** 371,380 **** ]) # RCSS_KEROSIN_IF_ELSE ! # AC_LIB_SPADES([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) ! # --------------------------------------------------------- # Checks for the spades library ! AC_DEFUN([AC_LIB_SPADES], ! [AS_VAR_PUSHDEF([ac_lib_spades], [ac_cv_lib_spades])dnl ! AC_CACHE_CHECK(whether the spades library is available, ac_cv_lib_spades, [AC_LANG_PUSH(C++) OLD_LDFLAGS="$LDFLAGS" --- 349,380 ---- ]) # RCSS_KEROSIN_IF_ELSE ! # RCSS_BUILD_SPADES_SERVER ! # set rcss_build_spades to 'yes' ! #----------------------------------------------------------------------------- ! AC_DEFUN([RCSS_BUILD_SPADES_SERVER], [ ! # --enable-kerosin ! AC_ARG_ENABLE(spades, ! AC_HELP_STRING([--enable-spades=@<:@yes|no@:>@], ! [whether to compile the spades simulation engine server (default is no)]), ! [rcss_build_spades="$enableval"], ! [rcss_build_spades=no] ! ) ! if test "$rcss_build_spades" = yes; then ! AC_MSG_NOTICE([Checking prerequisites for building the spades server...]) ! RCSS_LIB_SPADES ! fi ! AM_CONDITIONAL(BUILD_SPADES, test x$rcss_build_spades = xyes) ! if test "$rcss_build_spades" = no; then ! AC_MSG_NOTICE([the spades server will not be build...]) ! AC_MSG_NOTICE([...you can enable it using the --enable-spades flag]) ! fi ! ]) # RCSS_BUILD_SPADES_SERVER ! ! # RCSS_LIB_SPADES # Checks for the spades library ! # --------------------------------------------------------- ! AC_DEFUN([RCSS_LIB_SPADES], ! [AS_VAR_PUSHDEF([rcss_lib_spades], [rcss_cv_lib_spades])dnl ! AC_CACHE_CHECK(whether the spades library is available, rcss_cv_lib_spades, [AC_LANG_PUSH(C++) OLD_LDFLAGS="$LDFLAGS" *************** *** 386,397 **** return 0; }], ! [AS_VAR_SET(ac_lib_spades, yes)], ! [AS_VAR_SET(ac_lib_spades, no)]) LDFLAGS="$OLD_LDFLAGS" AC_LANG_POP(C++) ]) ! AS_IF([test AS_VAR_GET(ac_lib_spades) = yes], [$1], [$2]) ! AS_VAR_POPDEF([ac_lib_spades])dnl ! ])# AC_LIB_SPADES # RCSS_LIBRARY_VERSION_INFO --- 386,396 ---- return 0; }], ! [AS_VAR_SET(rcss_lib_spades, yes)], ! [AS_VAR_SET(rcss_lib_spades, no)]) LDFLAGS="$OLD_LDFLAGS" AC_LANG_POP(C++) ]) ! AS_VAR_POPDEF([rcss_lib_spades])dnl ! ])# RCSS_LIB_SPADES # RCSS_LIBRARY_VERSION_INFO |
From: Oliver O. <fr...@us...> - 2006-03-08 09:19:03
|
Update of /cvsroot/simspark/simspark/spark/kerosin/imageserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3651/imageserver Modified Files: image.cpp image.h imageserver.cpp imageserver.h imageserver_c.cpp Log Message: - changed the ImageServer so that it compiles without DevIL. For this, some DevIL types had to be encapsulated in the kerosin::Image and kerosin::ImageServer classes. Advantage of this method (over not compiling the ImageServer at all when DevIL is not present) is that checks for the ImageServer are not necessary in code using kerosin. - the ImageServer interface has been changed to be const-correct and to provide interface functions with standard types only (or types defined in kerosin and salt). Index: imageserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/imageserver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** imageserver.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- imageserver.cpp 8 Mar 2006 09:18:56 -0000 1.2 *************** *** 33,52 **** using namespace std; shared_ptr<FileServer> gFileServer; ! //------------------------------------------------------------------------------------------------ ! // FileServer hooks for DevIL ! //------------------------------------------------------------------------------------------------ ! ILHANDLE ILAPIENTRY FSOpen(const ILstring inName) { return (ILHANDLE)(gFileServer->Register(inName)); } ! ILvoid ILAPIENTRY FSClose(ILHANDLE handle) { gFileServer->Close((FileServer::THandle)handle); } ! ILboolean ILAPIENTRY FSEof(ILHANDLE handle) { shared_ptr<salt::RFile> file = --- 33,56 ---- using namespace std; + #if HAVE_IL_IL_H + //----------------------------------------------------------------------------- + // FileServer hooks for DevIL + //----------------------------------------------------------------------------- shared_ptr<FileServer> gFileServer; ! ILHANDLE ! ILAPIENTRY FSOpen(const ILstring inName) { return (ILHANDLE)(gFileServer->Register(inName)); } ! ILvoid ! ILAPIENTRY FSClose(ILHANDLE handle) { gFileServer->Close((FileServer::THandle)handle); } ! ILboolean ! ILAPIENTRY FSEof(ILHANDLE handle) { shared_ptr<salt::RFile> file = *************** *** 56,62 **** } ! ILint ILAPIENTRY FSGetc(ILHANDLE handle) { ! shared_ptr<salt::RFile> file = gFileServer->Get((FileServer::THandle)handle); --- 60,67 ---- } ! ILint ! ILAPIENTRY FSGetc(ILHANDLE handle) { ! shared_ptr<salt::RFile> file = gFileServer->Get((FileServer::THandle)handle); *************** *** 64,68 **** } ! ILint ILAPIENTRY FSRead(void *buffer, ILuint size, ILuint count, ILHANDLE handle) { shared_ptr<salt::RFile> file = --- 69,74 ---- } ! ILint ! ILAPIENTRY FSRead(void *buffer, ILuint size, ILuint count, ILHANDLE handle) { shared_ptr<salt::RFile> file = *************** *** 72,76 **** } ! ILint ILAPIENTRY FSSeek(ILHANDLE handle, ILint offset, ILint origin) { shared_ptr<salt::RFile> file = --- 78,83 ---- } ! ILint ! ILAPIENTRY FSSeek(ILHANDLE handle, ILint offset, ILint origin) { shared_ptr<salt::RFile> file = *************** *** 80,84 **** } ! ILint ILAPIENTRY FSTell(ILHANDLE handle) { shared_ptr<salt::RFile> file = --- 87,92 ---- } ! ILint ! ILAPIENTRY FSTell(ILHANDLE handle) { shared_ptr<salt::RFile> file = *************** *** 87,90 **** --- 95,99 ---- return file->Tell(); } + #endif // HAVE_IL_IL_H //------------------------------------------------------------------------------------------------ *************** *** 95,98 **** --- 104,108 ---- ImageServer::ImageServer() { + #if HAVE_IL_IL_H // initialize DevIL ilInit(); *************** *** 105,124 **** // register FileServer hooks for DevIL ! ilSetRead( ! FSOpen, ! FSClose, ! FSEof, ! FSGetc, ! FSRead, ! FSSeek, ! FSTell); } // ! // This function loads the file inName. If inType is IL_TYPE_UNKNOWN, // then the library will try to find a handler by the file extension provided. // This behavior is done automatically by the library! // ! boost::shared_ptr<Image> ImageServer::Load(const string& inName, ILenum inType) { // create a new image --- 115,133 ---- // register FileServer hooks for DevIL ! ilSetRead(FSOpen, FSClose, FSEof, FSGetc, FSRead, FSSeek, FSTell); ! #else ! #warning ====================================================================== ! #warning The ImageServer is will not work properly without using DevIL ! #warning ====================================================================== ! #endif } // ! // This function loads the file inName. If inType is eTYPE_UNKNOWN, // then the library will try to find a handler by the file extension provided. // This behavior is done automatically by the library! // ! boost::shared_ptr<Image> ! ImageServer::Load(const string& inName, ImageServer::EImgType inType) const { // create a new image *************** *** 130,151 **** // set the file server gFileServer = shared_static_cast<FileServer>(GetCore()->Get("/sys/server/file")); ! // load the image ilLoad(inType, (ILstring)inName.c_str()); ! // set the file server to 0 again gFileServer.reset(); // check for errors ! if(HandleErrors() == true) ! { ! // release the image and return ! return boost::shared_ptr<Image>(); ! } return image; } ! bool ImageServer::Save(const boost::shared_ptr<Image> &inImage, const string& inName, ILenum inType) { // make the image active --- 139,167 ---- // set the file server gFileServer = shared_static_cast<FileServer>(GetCore()->Get("/sys/server/file")); ! #if HAVE_IL_IL_H // load the image ilLoad(inType, (ILstring)inName.c_str()); ! #else ! GetLog()->Error() << "(ImageServer) ERROR: Sorry, SPARK was compiled " ! << "without image support.\n" ! << " To support loading images, " ! << "install DevIL (http://openil.sf.net/) and recompile SPARK.\n"; ! #endif // set the file server to 0 again gFileServer.reset(); // check for errors ! if (HandleErrors() == true) ! { ! // release the image and return ! return boost::shared_ptr<Image>(); ! } return image; } ! bool ! ImageServer::Save(boost::shared_ptr<Image> inImage, const string& inName, ! ImageServer::EImgType inType) const { // make the image active *************** *** 155,160 **** --- 171,183 ---- gFileServer = shared_static_cast<FileServer>(GetCore()->Get("/sys/server/file")); + #if HAVE_IL_IL_H // save the image ilSave(inType, (ILstring)inName.c_str()); + #else + GetLog()->Error() << "(ImageServer) ERROR: Sorry, SPARK was compiled " + << "without image support.\n" + << " To support loading images, " + << "install DevIL (http://openil.sf.net/) and recompile SPARK.\n"; + #endif // set the file server to 0 again *************** *** 162,179 **** // check for errors ! if(HandleErrors() == true) ! { ! return false; ! } return true; } ! // ! // This routine checks for DevIL errors and logs them. The function returns ! // 'true' if an error has occured and 'false' if not. ! // ! bool ImageServer::HandleErrors() { bool ret = false; ILenum error; --- 185,202 ---- // check for errors ! if (HandleErrors() == true) ! { ! return false; ! } return true; } ! // This routine checks for DevIL errors and logs them. The function returns ! // 'true' if an error has occured and 'false' if not. ! bool ! ImageServer::HandleErrors() const { + #if HAVE_IL_IL_H bool ret = false; ILenum error; *************** *** 181,293 **** // check if we have any errors and log them accordingly while ((error = ilGetError()) != IL_NO_ERROR) ! { ! ret = true; ! ! string msg; ! switch(error) ! { ! case IL_INVALID_ENUM : ! msg = "invalid enum"; ! break; ! case IL_OUT_OF_MEMORY : ! msg = "out of memory"; ! break; ! case IL_FORMAT_NOT_SUPPORTED : ! msg = "format not supported"; ! break; ! case IL_INTERNAL_ERROR : ! msg = "internal error"; ! break; ! case IL_INVALID_VALUE : ! msg = "invalid value"; ! break; ! case IL_ILLEGAL_OPERATION : ! msg = "illegal operation"; ! break; ! case IL_ILLEGAL_FILE_VALUE : ! msg = "illegal file value"; ! break; ! case IL_INVALID_FILE_HEADER : ! msg = "invalid file header"; ! break; ! case IL_INVALID_PARAM : ! msg = "invalid param"; ! break; ! case IL_COULD_NOT_OPEN_FILE : ! msg = "could not open file"; ! break; ! case IL_INVALID_EXTENSION : ! msg = "invalid extension"; ! break; ! case IL_FILE_ALREADY_EXISTS : ! msg = "file already exists"; ! break; ! case IL_OUT_FORMAT_SAME : ! msg = "out format same"; ! break; ! case IL_STACK_OVERFLOW : ! msg ="stack overflow"; ! break; ! case IL_STACK_UNDERFLOW : ! msg ="stack underflow"; ! break; ! case IL_INVALID_CONVERSION : ! msg = "invalid conversion"; ! break; ! case IL_BAD_DIMENSIONS : ! msg = "bad dimensions"; ! break; ! case IL_FILE_READ_ERROR : ! //case IL_FILE_WRITE_ERROR : ! msg = "file read/write error"; ! break; ! case IL_LIB_GIF_ERROR : ! msg = "lib gif error"; ! break; ! case IL_LIB_JPEG_ERROR : ! msg = "lib jpeg error"; ! break; ! case IL_LIB_PNG_ERROR : ! msg = "lib png error"; ! break; ! case IL_LIB_TIFF_ERROR : ! msg = "lib tiff error"; ! break; ! case IL_LIB_MNG_ERROR : ! msg = "lib mng error"; ! break; ! default: ! msg = "unknown IL error"; ! break; ! } ! GetLog()->Error() << "(ImageServer) ERROR: DevIL returned error " ! << error << " (" << msg << ")\n"; } return ret; } --- 204,319 ---- // check if we have any errors and log them accordingly while ((error = ilGetError()) != IL_NO_ERROR) ! { ! ret = true; ! string msg; ! switch(error) ! { ! case IL_INVALID_ENUM : ! msg = "invalid enum"; ! break; ! case IL_OUT_OF_MEMORY : ! msg = "out of memory"; ! break; ! case IL_FORMAT_NOT_SUPPORTED : ! msg = "format not supported"; ! break; ! case IL_INTERNAL_ERROR : ! msg = "internal error"; ! break; ! case IL_INVALID_VALUE : ! msg = "invalid value"; ! break; ! case IL_ILLEGAL_OPERATION : ! msg = "illegal operation"; ! break; ! case IL_ILLEGAL_FILE_VALUE : ! msg = "illegal file value"; ! break; ! case IL_INVALID_FILE_HEADER : ! msg = "invalid file header"; ! break; ! case IL_INVALID_PARAM : ! msg = "invalid param"; ! break; ! case IL_COULD_NOT_OPEN_FILE : ! msg = "could not open file"; ! break; ! case IL_INVALID_EXTENSION : ! msg = "invalid extension"; ! break; ! case IL_FILE_ALREADY_EXISTS : ! msg = "file already exists"; ! break; ! case IL_OUT_FORMAT_SAME : ! msg = "out format same"; ! break; ! case IL_STACK_OVERFLOW : ! msg ="stack overflow"; ! break; ! case IL_STACK_UNDERFLOW : ! msg ="stack underflow"; ! break; ! case IL_INVALID_CONVERSION : ! msg = "invalid conversion"; ! break; ! case IL_BAD_DIMENSIONS : ! msg = "bad dimensions"; ! break; ! case IL_FILE_READ_ERROR : ! //case IL_FILE_WRITE_ERROR : ! msg = "file read/write error"; ! break; ! case IL_LIB_GIF_ERROR : ! msg = "lib gif error"; ! break; ! case IL_LIB_JPEG_ERROR : ! msg = "lib jpeg error"; ! break; ! case IL_LIB_PNG_ERROR : ! msg = "lib png error"; ! break; ! case IL_LIB_TIFF_ERROR : ! msg = "lib tiff error"; ! break; ! case IL_LIB_MNG_ERROR : ! msg = "lib mng error"; ! break; ! default: ! msg = "unknown IL error"; ! break; } + GetLog()->Error() << "(ImageServer) ERROR: DevIL returned error " + << error << " (" << msg << ")\n"; + } + return ret; + #else + return true; + #endif } Index: imageserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/imageserver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** imageserver.h 5 Dec 2005 21:38:22 -0000 1.1 --- imageserver.h 8 Mar 2006 09:18:56 -0000 1.2 *************** *** 23,27 **** --- 23,33 ---- #define KEROSIN_IMAGESERVER_H + #ifdef HAVE_CONFIG_H + #include <config.h> + #endif + #ifdef HAVE_IL_IL_H #include <IL/il.h> + #endif + #include <zeitgeist/class.h> *************** *** 39,65 **** - Conversion between formats ! NOTE: ! ! HISTORY: ! 14.07.01 - MK ! - Initial version ! 29.07.01 - MK ! - Uses classserver ! 29.08.01 - MK ! - Doesn't use classserver anymore :( ! - Switched to DevIL for image loading needs, since the task of supporting ! all major formats would have been too time consuming ! - Cleaned up the interface of the imageserver quite a bit ! 11.10.01 - MK ! - Made singleton functionality more secure ! 02.10.02 - MK ! - Moved to Kerosin ! ! TODO: ! - Image creation ! - Image conversion ! - Pixel-level access ! TOFIX: */ --- 45,54 ---- - Conversion between formats ! NOTE: Initial version 14.07.01 - MK ! TODO: ! - Image creation ! - Image conversion ! - Pixel-level access */ *************** *** 67,85 **** { public: ImageServer(); // load/save ! /** interpret the file with the filter associated with inExt */ boost::shared_ptr<Image> Load(const std::string& inName, ! ILenum inType = IL_TYPE_UNKNOWN); ! /** interpret the file with the filter associated with inExt */ ! bool Save(const boost::shared_ptr<Image> &inImage, const std::string& inName, ! ILenum inType = IL_TYPE_UNKNOWN); private: ! /** some internal error checking */ ! bool HandleErrors(); }; --- 56,144 ---- { public: + #ifdef HAVE_IL_IL_H + enum EImgType + { + eTYPE_UNKNOWN = IL_TYPE_UNKNOWN, + eBMP = IL_BMP, + eCUT = IL_CUT, + eDOOM = IL_DOOM, + eDOOM_FLAT = IL_DOOM_FLAT, + eICO = IL_ICO, + eJPG = IL_JPG, + eJFIF = IL_JFIF, + eLBM = IL_LBM, + ePCD = IL_PCD, + ePCX = IL_PCX, + ePIC = IL_PIC, + ePNG = IL_PNG, + ePNM = IL_PNM, + eSGI = IL_SGI, + eTGA = IL_TGA, + eTIF = IL_TIF, + eCHEAD = IL_CHEAD, + eRAW = IL_RAW, + eMDL = IL_MDL, + eWAL = IL_WAL, + eLIF = IL_LIF, + eMNG = IL_MNG, + eJNG = IL_JNG, + eGIF = IL_GIF, + eDDS = IL_DDS, + eDCX = IL_DCX, + ePSD = IL_PSD, + eEXIF = IL_EXIF, + ePSP = IL_PSP, + ePIX = IL_PIX, + ePXR = IL_PXR, + eXPM = IL_XPM, + eHDR = IL_HDR, + eJASC_PAL = IL_JASC_PAL + }; + #else + enum EImgType + { + eTYPE_UNKNOWN, eBMP, eCUT, eDOOM, + eDOOM_FLAT, eICO, eJPG, eJFIF, + eLBM, ePCD, ePCX, ePIC, + ePNG, ePNM, eSGI, eTGA, + eTIF, eCHEAD, eRAW, eMDL, + eWAL, eLIF, eMNG, eJNG, + eGIF, eDDS, eDCX, ePSD, + eEXIF, ePSP, ePIX, ePXR, + eXPM, eHDR, eJASC_PAL + }; + #endif + public: ImageServer(); // load/save ! /** Load the file with the filter associated with the given type. ! If inType is eTYPE_UNKNOWN, then Load try to find a handler by the ! file extension provided. If using DevIL, this behavior is done ! automatically by the library (Without DevIL, loading and saving ! is disabled at the moment). ! @param inName the file name of the image ! @param inType hint for the file type ! @return a shared_ptr to the Image (handle) ! */ boost::shared_ptr<Image> Load(const std::string& inName, ! EImgType inType = eTYPE_UNKNOWN) const; ! /** Save the file with the filter associated with the given type. ! @param inImage a shared_ptr to the image (handle) ! @param inName the name of the file for the image ! @param inType a hint for the file type ! @return true if successful ! */ ! bool Save(boost::shared_ptr<Image> inImage, const std::string& inName, ! EImgType inType = eTYPE_UNKNOWN) const; private: ! /** Some internal error checking. ! This routine checks for DevIL errors and logs them. ! @returns true if an error has occured and false if not. ! */ ! bool HandleErrors() const; }; Index: image.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/image.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** image.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- image.cpp 8 Mar 2006 09:18:56 -0000 1.2 *************** *** 1,2 **** --- 1,23 ---- + /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of simspark + Mon May 9 2005 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ #include "image.h" *************** *** 6,11 **** Image::Image() { ! // let's create a DevIL ID for this image ! ilGenImages(1, &mId); } --- 27,34 ---- Image::Image() { ! #ifdef HAVE_IL_IL_H ! // let's create a DevIL ID for this image ! ilGenImages(1, &mId); ! #endif } *************** *** 13,108 **** Image::~Image() { ! // free the image with DevIL ! ilDeleteImages(1, &mId); } ! void Image::Bind() { ! ilBindImage(mId); } ! ILuint Image::Width() { ! Bind(); ! return ilGetInteger(IL_IMAGE_WIDTH); } ! ! ILuint Image::Height() { ! Bind(); ! return ilGetInteger(IL_IMAGE_HEIGHT); } ! ! ILuint Image::Depth() { ! Bind(); ! return ilGetInteger(IL_IMAGE_DEPTH); } ! ILuint Image::BitsPP() { ! Bind(); ! return ilGetInteger(IL_IMAGE_BITS_PER_PIXEL ); } ! ILuint Image::BytesPP() { ! Bind(); ! return ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL ); } ! ILuint Image::Type() { ! Bind(); ! return ilGetInteger(IL_IMAGE_TYPE); } ! ILuint Image::Format() { ! Bind(); ! return ilGetInteger(IL_IMAGE_FORMAT); } ! ILubyte* Image::Data() { ! Bind(); ! return ilGetData(); } ! bool Image::HasAlpha() { ! Bind(); ! ILuint format = Format(); ! switch(format) ! { ! case IL_RGB: ! case IL_BGR: ! return false; ! break; ! case IL_RGBA: ! case IL_BGRA: ! return true; ! break; ! default: ! return false; ! } } ! bool Image::Create(int w, int h, int b, void *data) { ! Bind(); ! ! if(b==3) ! { ! ilTexImage(w, h, 1, b, IL_RGB, IL_UNSIGNED_BYTE, data); ! } ! else ! { ! ilTexImage(w, h, 1, b, IL_RGBA, IL_UNSIGNED_BYTE, data); ! } ! return true; } --- 36,183 ---- Image::~Image() { ! #ifdef HAVE_IL_IL_H ! // free the image with DevIL ! ilDeleteImages(1, &mId); ! #endif } ! void ! Image::Bind() const { ! #ifdef HAVE_IL_IL_H ! ilBindImage(mId); ! #endif } ! Image::TImgUInt ! Image::Width() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_WIDTH); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::Height() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_HEIGHT); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::Depth() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_DEPTH); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::BitsPP() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_BITS_PER_PIXEL ); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::BytesPP() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL ); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::Type() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_TYPE); ! #else ! return 0; ! #endif } ! Image::TImgUInt ! Image::Format() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetInteger(IL_IMAGE_FORMAT); ! #else ! return 0; ! #endif } ! Image::TImgUChar* ! Image::Data() { ! #ifdef HAVE_IL_IL_H ! Bind(); ! return ilGetData(); ! #else ! return 0; ! #endif } ! bool ! Image::HasAlpha() const { ! #ifdef HAVE_IL_IL_H ! Bind(); ! TImgUInt format = Format(); ! switch(format) ! { ! case IL_RGB: ! case IL_BGR: ! return false; ! break; ! case IL_RGBA: ! case IL_BGRA: ! return true; ! break; ! default: ! return false; ! } ! #else ! return false; ! #endif } ! bool ! Image::Create(int w, int h, int b, void* data) { ! #ifdef HAVE_IL_IL_H ! Bind(); ! if (b==3) ! { ! ilTexImage(w, h, 1, b, IL_RGB, IL_UNSIGNED_BYTE, data); ! } ! else ! { ! ilTexImage(w, h, 1, b, IL_RGBA, IL_UNSIGNED_BYTE, data); ! } ! return true; ! #else ! return false; ! #endif } Index: imageserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/imageserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** imageserver_c.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- imageserver_c.cpp 8 Mar 2006 09:18:56 -0000 1.2 *************** *** 1,2 **** --- 1,23 ---- + /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of simspark + Mon May 9 2005 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ #include "imageserver.h" *************** *** 7,10 **** void CLASS(ImageServer)::DefineClass() { ! DEFINE_BASECLASS(zeitgeist/Leaf); } --- 28,31 ---- void CLASS(ImageServer)::DefineClass() { ! DEFINE_BASECLASS(zeitgeist/Leaf); } Index: image.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/imageserver/image.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** image.h 5 Dec 2005 21:38:22 -0000 1.1 --- image.h 8 Mar 2006 09:18:56 -0000 1.2 *************** *** 24,49 **** /* Image - A Wrapper for the DevIL Library ! NOTE: ! ! HISTORY: ! 11.07.01 - MK ! - Initial version ! 28.08.01 - MK ! - Added support for a palette ! 29.08.01 - MK ! - Rewrite for DevIL ! 03.09.01 - MK ! - OpenGL texture support ! TODO: - add RGB access - image creation - - TOFIX: */ ! #include <IL/il.h> namespace kerosin --- 24,41 ---- /* Image - A Wrapper for the DevIL Library + (or loading images by anything else) ! NOTE: Initial version by MK (11.07.01) TODO: - add RGB access - image creation */ ! #ifdef HAVE_CONFIG_H ! #include <config.h> ! #endif ! #ifdef HAVE_IL_IL_H #include <IL/il.h> + #endif namespace kerosin *************** *** 53,98 **** { public: ! // constructor/destructor Image(); virtual ~Image(); ! // this makes the image active ! void Bind(); // image information ! ILuint Width(); // width ! ILuint Height(); // height ! ILuint Depth(); // depth (==1 for 2d images, >1 for 3d images) ! ! ILuint BitsPP(); // bits per pixel ! ILuint BytesPP(); // bytes per pixel ! ! ILuint Type(); // format of pixels ! ILuint Format(); // byte format of image ! ! ILubyte*Data(); ! ! bool HasAlpha(); // does the format have an alpha channel ! bool Create(int w, int h, int b, void *data = NULL); ! // the interface functions ... these *have* to be implemented by derived classes ! //virtual bool Create() = 0; ! //virtual void SetPixel(int x, int y, long color) const = 0; ! //virtual long GetPixel(int x, int y) const = 0; ! /* ! virtual long MakeCol(int a, int r, int g, int b) const = 0; ! virtual void GetCol(long col, int& a, int& r, int& g, int& b) const = 0; ! virtual int GetA(long col) const = 0; ! virtual int GetR(long col) const = 0; ! virtual int GetG(long col) const = 0; ! virtual int GetB(long col) const = 0; - // accessors - f_inline void SetWidth (int inWidth) { mWidth = inWidth; } - f_inline void SetHeight(int inHeight) { mHeight = inHeight; } - */ protected: ! ILuint mId; // the DevIL ID which this image is bound to }; --- 45,90 ---- { public: ! #ifdef HAVE_IL_IL_H ! typedef ILuint TImgUInt; ! typedef ILubyte TImgUChar; ! #else ! typedef unsigned int TImgUInt; ! typedef unsigned char TImgUChar; ! #endif ! ! public: Image(); virtual ~Image(); ! //! this makes the image active ! void Bind() const; // image information ! //! @return the image width ! TImgUInt Width() const; ! //! @return the image height ! TImgUInt Height() const; ! /** Image depth information. ! @return 1 for 2d images, >1 for 3d images ! */ ! TImgUInt Depth() const; ! //! @return bits per pixel ! TImgUInt BitsPP() const; ! //! @return bytes per pixel ! TImgUInt BytesPP() const; ! //! @return format of pixels ! TImgUInt Type() const; ! //! @return byte format of image ! TImgUInt Format() const; ! TImgUChar* Data(); ! //! @return true if the format has an alpha channel ! bool HasAlpha() const; ! bool Create(int w, int h, int b, void* data = 0); protected: ! //! the (DevIL) ID which this image is bound to ! TImgUInt mId; }; |
Update of /cvsroot/simspark/simspark/simulations/parts/ros In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/ros Added Files: aibo.ros aibo.rsi blockworld.ros bsmart.ros demo1.ros factory.ros friction.ros surfaces.rsi vehicle.ros Log Message: - added rsg and ros example files --- NEW FILE: blockworld.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RoSi.xsd"> <AppearanceDefinition name="red"> <Color r="255" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="dark blue"> <Color r="0" g="0" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="green"> <Color r="0" g="200" b="0"/> <!-- <Alpha a="0.5"/> --> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="220" g="220" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="glass"> <Color r="200" g="200" b="200"/> <Alpha a="0.3"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <Scene name="BlockWorld" description="Weird block world with a pendulum and some sensors."> <Background surface="background"/> <AmbientLightColor r="150" g="150" b="150"/> <DefaultAppearance ref="dark blue"/> <GlobalPhysicalParameters gravity="-0.0005" erp="0.2" cfm="0.0001" defaultRollingFrictionCoefficient="0.0001"/> <SimulationParameters stepLength="0.33" standardLength="0.1" applyDynamicsForceFactor="10.0"/> <Elements> <Box name="Ground" length="2.1" width="2.1" height="0.2"> <Translation x="0" y="0" z="-0.1"/> <Appearance ref="dark blue"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side1" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side2" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="-1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side3" length="0.1" width="2" height="0.2"> <Translation x="1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side4" length="0.1" width="2" height="0.2"> <Translation x="-1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="SwingPole1" length="0.1" width="0.1" height="0.4"> <Translation x="0" y="-0.2" z="0.2"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="SwingPole2" length="0.1" width="0.1" height="0.4"> <Translation x="0" y="0.2" z="0.2"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="SwingBar" length="0.1" width="0.5" height="0.1"> <Translation x="0" y="0" z="0.45"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <Hinge name="SwingJoint"> <AnchorPoint x="0.0" y="0.0" z="0.0" /> <Axis x="0.0" y="1.0" z="0.0"/> <Elements> <Movable name="swing"> <Elements> <Box name="Pendulum" length="0.04" width="0.04" height="0.04"> <Translation x="0.1" y="0.0" z="0.25"/> <Appearance ref="orange"/> <PhysicalAttributes> <Mass value="1"/> </PhysicalAttributes> <Elements> <Camera name="cam1"> <Translation x="0.0" y="0.0" z="-0.07"/> <Rotation x="0.0" y="90" z="0.0"/> <Resolution x="100" y="100"/> <OpeningAngles x="90" y="90"/> <Range near="0.01" far="10"/> <PerspectiveProjection/> </Camera> </Elements> </Box> </Elements> </Movable> </Elements> </Hinge> </Elements> </Box> <Movable name="dominostone1"> <Elements> <Box name="Stone1" length="0.02" width="0.08" height="0.2"> <Translation x="0.1" y="0.0" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone2"> <Elements> <Box name="Stone2" length="0.02" width="0.08" height="0.2"> <Translation x="0.25" y="0.0" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone3"> <Elements> <Box name="Stone3" length="0.02" width="0.08" height="0.2"> <Translation x="0.4" y="0.0" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone4"> <Elements> <Box name="Stone4" length="0.02" width="0.08" height="0.2"> <Translation x="0.55" y="0.0" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="cylinder1"> <Elements> <Cylinder name="Cylinder" radius="0.04" height="0.2"> <Translation x="-0.4" y="0.57" z="0.04"/> <Rotation x="90" y="0" z="0"/> <Appearance ref="green"/> <PhysicalAttributes> <Mass value="3"/> </PhysicalAttributes> </Cylinder> </Elements> </Movable> <Movable name="seesaw"> <Elements> <Box name="Seesaw" length="0.4" width="0.08" height="0.02"> <Translation x="-0.4" y="0.5" z="0.2"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="2"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="ball"> <Elements> <Sphere name="Ball" radius="0.06"> <Translation x="-0.2" y="0.5" z="0.28"/> <Appearance ref="orange"/> <PhysicalAttributes> <Mass value="1"/> </PhysicalAttributes> <Elements> <Camera name="hallo"> <Translation x="0.0" y="0.0" z="-0.07"/> <Rotation x="0.0" y="90" z="0.0"/> <Resolution x="100" y="100"/> <OpeningAngles x="90" y="90"/> <Range near="0.01" far="10"/> <PerspectiveProjection/> </Camera> <DistanceSensor name="halloDistance"> <Translation x="0.0" y="0.0" z="-0.07"/> <Rotation x="0.0" y="90" z="0.0"/> <Resolution x="40" y="1"/> <OpeningAngles x="90" y="2"/> <Range near="0.01" far="10"/> <SphericalProjection/> </DistanceSensor> </Elements> </Sphere> </Elements> </Movable> <Movable name="ball2"> <Elements> <Sphere name="Ball2" radius="0.05"> <Translation x="-0.6" y="0.5" z="0.4"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Sphere> </Elements> </Movable> <Movable name="dominostone5"> <Elements> <Box name="Stone5" length="0.02" width="0.08" height="0.2"> <Translation x="0.1" y="-0.5" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone6"> <Elements> <Box name="Stone6" length="0.02" width="0.08" height="0.2"> <Translation x="0.2" y="-0.5" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone7"> <Elements> <Box name="Stone7" length="0.02" width="0.08" height="0.2"> <Translation x="0.3" y="-0.5" z="0.1"/> <Appearance ref="orange"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="dominostone8"> <Elements> <Box name="Stone8" length="0.02" width="0.08" height="0.2"> <Translation x="0.4" y="-0.5" z="0.1"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="0.1"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="cappedcylinder"> <Elements> <CappedCylinder name="CappedCylinder" radius="0.05" height="0.15"> <Translation x="0.3" y="-0.5" z="0.5"/> <Rotation x="0" y="80" z="0"/> <Appearance ref="green"/> <PhysicalAttributes> <Mass value="1"/> </PhysicalAttributes> </CappedCylinder> </Elements> </Movable> </Elements> </Scene> </Simulation> --- NEW FILE: factory.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="simrobot.xsd"> <AppearanceDefinition name="red"> <Color r="255" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="dark blue"> <Color r="0" g="0" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="green"> <Color r="0" g="200" b="80"/> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="220" g="220" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="glass"> <Color r="200" g="200" b="200"/> <Alpha a="0.3"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="metal"> <Color r="120" g="120" b="120"/> </AppearanceDefinition> <MaterialDefinition name="Stone"> <FrictionCoefficient otherMaterial="Wood" value="1.0"/> </MaterialDefinition> <MaterialDefinition name="Steel"> <FrictionCoefficient otherMaterial="Wood" value="0.1"/> </MaterialDefinition> <MaterialDefinition name="Wood"/> <VertexList name="SomePoints"> <Vertex name="p1" x="1" y="1" z="1"/> <Vertex name="p2" x="1" y="2" z="1"/> <Vertex name="p3" x="2" y="2" z="1"/> <Vertex name="p4" x="2" y="1" z="1"/> </VertexList> <Scene name="Factory" description="A simple factory demonstration with blocks being sensed and automatically pushed to the right place."> <Background surface="background"/> <AmbientLightColor r="150" g="150" b="150"/> <DefaultAppearance ref="dark blue"/> <GlobalPhysicalParameters gravity="-9.81" erp="0.2" cfm="0.0001" contactSoftnessERP="0.2" contactSoftnessCFM="0.005"/> <SimulationParameters stepLength="0.005" standardLength="0.1" applyDynamicsForceFactor="10.0"/> <Elements> <Box name="Ground" length="2.1" width="2.1" height="0.2"> <Translation x="0" y="0" z="-0.1"/> <Appearance ref="dark blue"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Pole" length="0.1" width="0.1" height="1.0"> <Translation x="0.3" y="-0.6" z="0.5"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <DistanceSensor name="distance1"> <Translation x="-0.06" y="0.0" z="0.04"/> <Rotation x="0.0" y="180.0" z="0.0"/> <Resolution x="1" y="1"/> <OpeningAngles x="1" y="1"/> <Range near="0.0" far="0.6"/> <SphericalProjection/> </DistanceSensor> <DistanceSensor name="distance2"> <Translation x="-0.06" y="0.0" z="0.07"/> <Rotation x="0.0" y="180.0" z="0.0"/> <Resolution x="1" y="1"/> <OpeningAngles x="1" y="1"/> <Range near="0.0" far="0.6"/> <SphericalProjection/> </DistanceSensor> <DistanceSensor name="distance3"> <Translation x="-0.06" y="0.0" z="0.105"/> <Rotation x="0.0" y="180.0" z="0.0"/> <Resolution x="1" y="1"/> <OpeningAngles x="1" y="1"/> <Range near="0.0" far="0.6"/> <SphericalProjection/> </DistanceSensor> </Elements> </Box> <Box name="Side1" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side2" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="-1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side3" length="0.1" width="2" height="0.2"> <Translation x="1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side4" length="0.1" width="2" height="0.2"> <Translation x="-1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side4" length="0.1" width="2" height="0.2"> <Translation x="-1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="part1" length="0.1" width="1.6" height="0.05"> <Translation x="0.15" y="0.0" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="part2" length="0.1" width="1.6" height="0.05"> <Translation x="-0.15" y="0.0" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="part3" length="0.2" width="0.4" height="0.05"> <Translation x="0.0" y="-0.6" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <Hinge name="trapDoor1Hinge"> <AnchorPoint x="0.0" y="0.2" z="0.0" /> <Axis x="1.0" y="0.0" z="0.0"> <Deflection min="-90.0" max="1.0"/> <AngularMotor name ="td1motor" maxVelocity="5.0" maxForce="1000.0"> <PController pControlFactor="10" stopBias="0.0"/> </AngularMotor> </Axis> <Elements> <Bumper name="trapDoor1Sensor"> <Elements> <Box name="trapDoor1" length="0.18" width="0.18" height="0.05"> <Translation x="0.0" y="0.1" z="0.0"/> <Appearance ref="green"/> <Material name="Wood"/> <PhysicalAttributes> <Mass value="1.0"/> </PhysicalAttributes> </Box> </Elements> </Bumper> </Elements> </Hinge> </Elements> </Box> <Box name="part4" length="0.2" width="0.1" height="0.05"> <Translation x="0.0" y="-0.14" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <Hinge name="trapDoor2Hinge"> <AnchorPoint x="0.0" y="0.05" z="0.0" /> <Axis x="1.0" y="0.0" z="0.0"> <Deflection min="-90.0" max="1.0"/> <AngularMotor name ="td2motor" maxVelocity="5.0" maxForce="1000.0"> <PController pControlFactor="10" stopBias="0.0"/> </AngularMotor> </Axis> <Elements> <Bumper name="trapDoor2Sensor"> <Elements> <Box name="trapDoor2" length="0.18" width="0.18" height="0.05"> <Translation x="0.0" y="0.1" z="0.0"/> <Appearance ref="red"/> <Material name="Wood"/> <PhysicalAttributes> <Mass value="1.0"/> </PhysicalAttributes> </Box> </Elements> </Bumper> </Elements> </Hinge> </Elements> </Box> <Box name="part5" length="0.2" width="0.1" height="0.05"> <Translation x="0.0" y="0.17" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <Hinge name="trapDoor3Hinge"> <AnchorPoint x="0.0" y="0.05" z="0.0" /> <Axis x="1.0" y="0.0" z="0.0"> <Deflection min="-90.0" max="1.0"/> <AngularMotor name ="td3motor" maxVelocity="5.0" maxForce="1000.0"> <PController pControlFactor="10" stopBias="0.0"/> </AngularMotor> </Axis> <Elements> <Bumper name="trapDoor3Sensor"> <Elements> <Box name="trapDoor3" length="0.18" width="0.18" height="0.05"> <Translation x="0.0" y="0.1" z="0.0"/> <Appearance ref="yellow"/> <Material name="Wood"/> <PhysicalAttributes> <Mass value="1.0"/> </PhysicalAttributes> </Box> </Elements> </Bumper> </Elements> </Hinge> </Elements> </Box> <Box name="part6" length="0.2" width="0.36" height="0.05"> <Translation x="0.0" y="0.62" z="0.5"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="part7" length="0.4" width="1.6" height="0.05"> <Translation x="0.0" y="0.0" z="0.15"/> <Rotation x="0.0" y="-35.0" z="0.0"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="part0" length="0.4" width="0.1" height="0.8"> <Translation x="0.0" y="-0.8" z="0.3"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> <Elements> <Slider name="sliderJoint"> <Axis x="0.0" y="1.0" z=".0"> <Deflection min="0.01" max="1.4"/> <AngularMotor name ="MixMotor" maxVelocity="50.0" maxForce="1000.0"> <PController pControlFactor="15.0" stopBias="0.01"/> </AngularMotor> </Axis> <Elements> <Box name="SlideBox" length="0.2" width="0.04" height="0.08"> <Translation x="0.0" y="0.1" z="0.27"/> <Appearance ref="orange"/> <PhysicalAttributes> <Mass value="1"/> </PhysicalAttributes> </Box> </Elements> </Slider> <Box name="part10" length="0.4" width="0.4" height="0.1"> <Translation x="0.0" y="-0.25" z="0.35"/> <Appearance ref="metal"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> </Elements> </Box> <!--Blocks--> <Movable name="Box1"> <Elements> <Box name="box1" length="0.1" width="0.1" height="0.1"> <Translation x="0.0" y="-0.8" z="1.0"/> <Appearance ref="yellow"/> <Material name="Stone"/> <PhysicalAttributes> <Mass value="0.5"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="Box2"> <Elements> <Box name="box2" length="0.1" width="0.1" height="0.04"> <Translation x="0.0" y="-0.6" z="0.8"/> <Appearance ref="green"/> <Material name="Stone"/> <PhysicalAttributes> <Mass value="0.5"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="Box3"> <Elements> <Box name="box3" length="0.1" width="0.1" height="0.06"> <Translation x="0.0" y="-1.0" z="1.0"/> <Appearance ref="red"/> <Material name="Stone"/> <PhysicalAttributes> <Mass value="0.5"/> </PhysicalAttributes> </Box> </Elements> </Movable> </Elements> </Scene> </Simulation> --- NEW FILE: friction.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="simrobot.xsd"> <AppearanceDefinition name="red"> <Color r="255" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="dark blue"> <Color r="0" g="0" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="green"> <Color r="0" g="200" b="80"/> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="220" g="220" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="glass"> <Color r="200" g="200" b="200"/> <Alpha a="0.3"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <MaterialDefinition name="Stone"> <FrictionCoefficient otherMaterial="Wood" value="5.3"/> </MaterialDefinition> <MaterialDefinition name="Steel"> <FrictionCoefficient otherMaterial="Wood" value="0.05"/> </MaterialDefinition> <MaterialDefinition name="Wood"/> <VertexList name="SomePoints"> <Vertex name="p1" x="1" y="1" z="1"/> <Vertex name="p2" x="1" y="2" z="1"/> <Vertex name="p3" x="2" y="2" z="1"/> <Vertex name="p4" x="2" y="1" z="1"/> </VertexList> <Scene name="Friction" description="Demonstration of friction."> <Background surface="background"/> <AmbientLightColor r="150" g="150" b="150"/> <DefaultAppearance ref="dark blue"/> <GlobalPhysicalParameters gravity="-9.81" erp="0.2" cfm="0.0001" contactSoftnessERP="0.5" contactSoftnessCFM="0.01"/> <SimulationParameters stepLength="0.0033" standardLength="0.1" applyDynamicsForceFactor="10.0"/> <Elements> <!-- <ComplexShape name="hallo-test"> <VertexList name="SomeOtherPoints"> <Vertex name="p1" x="1" y="1" z="1"/> <Vertex name="p2" x="1" y="2" z="1"/> <Vertex name="p3" x="2" y="2" z="1"/> <Vertex name="p4" x="2" y="1" z="1"/> </VertexList> <GraphicalRepresentation vertexList="SomePoints"> </GraphicalRepresentation> <PhysicalRepresentation></PhysicalRepresentation> </ComplexShape> --> <Box name="Ground" length="2.1" width="2.1" height="0.2"> <Translation x="0" y="0" z="-0.1"/> <Appearance ref="dark blue"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side1" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Cylinder name="Test-Zylinder" height="0.3" radius="0.1"> <Translation x="0.0" y="1.0" z="0.3"/> <Appearance ref="orange"/> </Cylinder> <Box name="Side2" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="-1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side3" length="0.1" width="2" height="0.2"> <Translation x="1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side4" length="0.1" width="2" height="0.2"> <Translation x="-1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Corner1" length="0.1" width="0.6" height="0.2"> <Translation x="0.8" y="0.8" z="0.1"/> <Rotation x="0.0" y="0.0" z="45.0" /> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Corner2" length="0.1" width="0.6" height="0.2"> <Translation x="-0.8" y="-0.8" z="0.1"/> <Rotation x="0.0" y="0.0" z="45.0" /> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Corner3" length="0.1" width="0.6" height="0.2"> <Translation x="0.8" y="-0.8" z="0.1"/> <Rotation x="0.0" y="0.0" z="135.0" /> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Corner4" length="0.1" width="0.6" height="0.2"> <Translation x="-0.8" y="0.8" z="0.1"/> <Rotation x="0.0" y="0.0" z="135.0" /> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Schraege" length="1.0" width="0.6" height="0.2"> <Translation x="-0.3" y="0.0" z="0.1"/> <Rotation x="0.0" y="30.0" z="0.0" /> <Appearance ref="green"/> <Material name="Wood"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Movable name="mboxx1"> <Elements> <Box name="bocks1" length="0.1" width="0.1" height="0.05"> <Translation x="-0.4" y="-0.2" z="0.5"/> <Appearance ref="yellow"/> <Material name="Stone"/> <PhysicalAttributes> <Mass value="1.0"/> </PhysicalAttributes> </Box> </Elements> </Movable> <Movable name="mboxx2"> <Elements> <Box name="bocks2" length="0.1" width="0.1" height="0.05"> <Translation x="-0.4" y="0.2" z="0.5"/> <Appearance ref="orange"/> <Material name="Steel"/> <PhysicalAttributes> <Mass value="1.0"/> </PhysicalAttributes> </Box> </Elements> </Movable> <!-- <Movable name="ball8"> <Elements> <Sphere name="Ball8" radius="0.1"> <Translation x="-0.2" y="0.2" z="0.6"/> <Appearance ref="green"/> <PhysicalAttributes> <Mass value="2"/> </PhysicalAttributes> </Sphere> </Elements> </Movable> --> </Elements> </Scene> </Simulation> --- NEW FILE: surfaces.rsi --- <RoSiIncludeFile> <!-- The apearances of all objects: --> <AppearanceDefinition name="green"> <Color r="0" g="200" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="178" g="178" b="178"/> <!-- <Color r="200" g="200" b="200"/> --> </AppearanceDefinition> <AppearanceDefinition name="white"> <Color r="255" g="255" b="255"/> </AppearanceDefinition> <AppearanceDefinition name="pink"> <Color r="255" g="0" b="255"/> </AppearanceDefinition> <AppearanceDefinition name="sky blue"> <Color r="128" g="204" b="255"/> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="255" g="255" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="red"> <Color r="153" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="blue"> <Color r="0" g="0" b="76"/> </AppearanceDefinition> <!-- ***************** ERS-7 surfaces ******************************* --> <AppearanceDefinition name="body01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="body01.2"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="body02.1"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="body03.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="body03.2"> <Color r="72" g="72" b="72"/> </AppearanceDefinition> <AppearanceDefinition name="body03.3"> <Color r="5" g="5" b="5"/> </AppearanceDefinition> <AppearanceDefinition name="body04.1"> <Color r="6" g="6" b="6"/> </AppearanceDefinition> <AppearanceDefinition name="body05.1"> <Color r="75" g="75" b="75"/> </AppearanceDefinition> <AppearanceDefinition name="body06.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="chops.1"> <Color r="205" g="205" b="205"/> </AppearanceDefinition> <AppearanceDefinition name="chops.2"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="head01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="head02.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="head02.2"> <Color r="5" g="5" b="5"/> </AppearanceDefinition> <AppearanceDefinition name="head03.1"> <Color r="26" g="26" b="26"/> </AppearanceDefinition> <AppearanceDefinition name="head04.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="head04.2"> <Color r="56" g="63" b="66"/> </AppearanceDefinition> <AppearanceDefinition name="head05.1"> <Color r="135" g="135" b="135"/> </AppearanceDefinition> <AppearanceDefinition name="head05.2"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="head06.1"> <Color r="135" g="135" b="135"/> </AppearanceDefinition> <AppearanceDefinition name="head06.2"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="lear01.1"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="lear01.2"> <Color r="182" g="182" b="182"/> </AppearanceDefinition> <AppearanceDefinition name="lear02.1"> <Color r="221" g="235" b="239"/> </AppearanceDefinition> <AppearanceDefinition name="neck.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="rear01.1"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="rear01.2"> <Color r="182" g="182" b="182"/> </AppearanceDefinition> <AppearanceDefinition name="rear02.1"> <Color r="221" g="235" b="239"/> </AppearanceDefinition> <AppearanceDefinition name="larm01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="larm02.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="larm02.2"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="larm03.1"> <Color r="163" g="163" b="163"/> </AppearanceDefinition> <AppearanceDefinition name="larm03.2"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="larm03.3"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="larm04.1"> <Color r="140" g="147" b="158"/> </AppearanceDefinition> <AppearanceDefinition name="larm04.2"> <Color r="56" g="63" b="66"/> </AppearanceDefinition> <AppearanceDefinition name="rarm01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rarm02.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="rarm02.2"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rarm03.1"> <Color r="163" g="163" b="163"/> </AppearanceDefinition> <AppearanceDefinition name="rarm03.2"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="rarm03.3"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rarm04.1"> <Color r="140" g="147" b="158"/> </AppearanceDefinition> <AppearanceDefinition name="rarm04.2"> <Color r="56" g="63" b="66"/> </AppearanceDefinition> <AppearanceDefinition name="lleg01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="lleg02.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="lleg02.2"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="lleg03.1"> <Color r="163" g="163" b="163"/> </AppearanceDefinition> <AppearanceDefinition name="lleg03.2"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="lleg03.3"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="lleg04.1"> <Color r="140" g="147" b="158"/> </AppearanceDefinition> <AppearanceDefinition name="lleg04.2"> <Color r="56" g="63" b="66"/> </AppearanceDefinition> <AppearanceDefinition name="lleg04.3"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="rleg01.1"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rleg02.1"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="rleg02.2"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rleg03.1"> <Color r="163" g="163" b="163"/> </AppearanceDefinition> <AppearanceDefinition name="rleg03.2"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="rleg03.3"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="rleg04.1"> <Color r="140" g="147" b="158"/> </AppearanceDefinition> <AppearanceDefinition name="rleg04.2"> <Color r="56" g="63" b="66"/> </AppearanceDefinition> <AppearanceDefinition name="rleg04.3"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="tail01.1"> <Color r="73" g="73" b="73"/> </AppearanceDefinition> <AppearanceDefinition name="tail01.2"> <Color r="68" g="68" b="68"/> </AppearanceDefinition> <AppearanceDefinition name="tail02.1"> <Color r="221" g="235" b="239"/> </AppearanceDefinition> <!-- ***************** ERS-7 LED surfaces *************************** --> <AppearanceDefinition name="dark back led"> <Color r="166" g="166" b="166"/> </AppearanceDefinition> <AppearanceDefinition name="white back led"> <Color r="230" g="230" b="230"/> </AppearanceDefinition> <AppearanceDefinition name="red back led"> <Color r="179" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange back led"> <Color r="204" g="102" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="blue back led"> <Color r="0" g="0" b="179"/> </AppearanceDefinition> <AppearanceDefinition name="red white back led"> <Color r="230" g="153" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="orange white back led"> <Color r="255" g="179" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="blue white back led"> <Color r="128" g="128" b="230"/> </AppearanceDefinition> <AppearanceDefinition name="dark orange led"> <Color r="38" g="31" b="26"/> </AppearanceDefinition> <AppearanceDefinition name="dark blue led"> <Color r="26" g="26" b="51"/> </AppearanceDefinition> <AppearanceDefinition name="yellow head led"> <Color r="204" g="204" b="51"/> </AppearanceDefinition> <AppearanceDefinition name="pink head led"> <Color r="204" g="77" b="204"/> </AppearanceDefinition> <AppearanceDefinition name="turquoise head led"> <Color r="77" g="204" b="204"/> </AppearanceDefinition> <AppearanceDefinition name="green head led"> <Color r="77" g="230" b="77"/> </AppearanceDefinition> </RoSiIncludeFile> --- NEW FILE: demo1.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RoSi.xsd"> <AppearanceDefinition name="red"> <Color r="255" g="0" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="dark blue"> <Color r="0" g="0" b="128"/> </AppearanceDefinition> <AppearanceDefinition name="green"> <Color r="0" g="200" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="220" g="220" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="glass"> <Color r="200" g="200" b="200"/> <Alpha a="0.0"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <Scene name="Demo1"> <Background surface="background"/> <AmbientLightColor r="150" g="150" b="150"/> <DefaultAppearance ref="dark blue"/> <GlobalPhysicalParameters gravity="-0.001" erp="0.2" cfm="0.0001"/> <SimulationParameters stepLength="0.33" standardLength="0.1"/> <Elements> <Box name="Ground" length="2.1" width="2.1" height="0.2"> <Translation x="0" y="0" z="-0.1"/> <Appearance ref="dark blue"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side1" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side2" length="2.1" width="0.1" height="0.2"> <Translation x="0.0" y="-1.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side3" length="0.1" width="2" height="0.2"> <Translation x="1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Box name="Side4" length="0.1" width="2" height="0.2"> <Translation x="-1.0" y="0.0" z="0.1"/> <Appearance ref="red"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Movable name="car"> <Elements> <Box name="Vehicle" length="0.2" width="0.2" height="0.1"> <Translation x="0" y="0" z="0.2"/> <Appearance ref="green"/> <PhysicalAttributes> <Mass value="2"/> </PhysicalAttributes> <Elements> <Hinge name="Joint1"> <AnchorPoint x="0.13" y="0.13" z="-0.01" /> <Axis x="1.0" y="0.0" z="0.0"> <VelocityMotor name ="Motor1" maxVelocity="0.05" maxForce="10.0"/> </Axis> <Elements> <Sphere name="Wheel1" radius="0.05"> <Translation x="0.05" y="0.0" z="0"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="1"/> <CenterOfMass x="0" y="0" z="0"/> </PhysicalAttributes> </Sphere> </Elements> </Hinge> <Hinge name="Joint2"> <AnchorPoint x="-0.13" y="0.13" z="-0.01" /> <Axis x="1.0" y="0.0" z="0.0"> <VelocityMotor name ="Motor2" maxVelocity="0.05" maxForce="10.0"/> </Axis> <Elements> <Sphere name="Wheel2" radius="0.05"> <Translation x="-0.05" y="0.0" z="0"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="1"/> <CenterOfMass x="0" y="0" z="0"/> </PhysicalAttributes> </Sphere> </Elements> </Hinge> <Hinge name="Joint3"> <AnchorPoint x="0.13" y="-0.13" z="-0.01" /> <Axis x="1.0" y="0.0" z="0.0"> <VelocityMotor name ="Motor3" maxVelocity="0.05" maxForce="10.0"/> </Axis> <Elements> <Sphere name="Wheel3" radius="0.05"> <Translation x="0.05" y="0.1" z="0"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="1"/> <CenterOfMass x="0" y="0" z="0"/> </PhysicalAttributes> </Sphere> </Elements> </Hinge> <Hinge name="Joint4"> <AnchorPoint x="-0.13" y="-0.13" z="-0.01" /> <Axis x="1.0" y="0.0" z="0.0"> <VelocityMotor name ="Motor4" maxVelocity="0.05" maxForce="10.0"/> </Axis> <Elements> <Sphere name="Wheel4" radius="0.05"> <Translation x="-0.05" y="0.1" z="0"/> <Appearance ref="yellow"/> <PhysicalAttributes> <Mass value="1"/> <CenterOfMass x="0" y="0" z="0"/> </PhysicalAttributes> </Sphere> </Elements> </Hinge> </Elements> </Box> </Elements> </Movable> <Movable name="ball"> <Elements> <Sphere name="Ball1" radius="0.08"> <Translation x="0.3" y="0.0" z="0.5"/> <Appearance ref="orange"/> <PhysicalAttributes> <Mass value="1"/> <CenterOfMass x="0" y="0" z="0"/> </PhysicalAttributes> </Sphere> </Elements> </Movable> </Elements> </Scene> </Simulation> --- NEW FILE: aibo.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RoSi.xsd"> <Scene> <Background surface="background"/> <AmbientLightColor r="150" g="150" b="150"/> <DefaultAppearance ref="dark blue"/> <GlobalPhysicalParameters gravity="-0.0005" erp="0.2" cfm="0.0001" defaultRollingFrictionCoefficient="0.0001"/> <SimulationParameters stepLength="0.33" standardLength="0.1" applyDynamicsForceFactor="10.0"/> <Elements> <Use macroName="ERS-7"/> </Elements> </Scene> </Simulation> --- NEW FILE: bsmart.ros --- <Simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RoSi.xsd"> <!-- The apearances of all objects: --> <AppearanceDefinition name="field green"> <Color r="0" g="200" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="orange"> <Color r="250" g="150" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="yellow"> <Color r="255" g="255" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="green"> <Color r="0" g="255" b="0"/> </AppearanceDefinition> <AppearanceDefinition name="background"> <Color r="200" g="200" b="200"/> </AppearanceDefinition> <AppearanceDefinition name="hide"> <Color r="170" g="170" b="170"/> </AppearanceDefinition> <AppearanceDefinition name="white"> <Color r="255" g="255" b="255"/> </AppearanceDefinition> <AppearanceDefinition name="LightGray"> <Color r="150" g="150" b="150"/> </AppearanceDefinition> <AppearanceDefinition name="VeryDarkGray"> <Color r="20" g="20" b="20"/> </AppearanceDefinition> <AppearanceDefinition name="MediumGray"> <Color r="100" g="100" b="100"/> </AppearanceDefinition> <AppearanceDefinition name="HullColor"> <Color r="0" g="0" b="0"/> </AppearanceDefinition> <MaterialDefinition name="golfball"> <FrictionCoefficient otherMaterial="gummi" value="10"/> </MaterialDefinition> <VertexList name="field coords"> <Vertex name="fieldOwnLeft" x="-2.46" y="1.71" z="0"/> <Vertex name="fieldOwnRight" x="-2.46" y="-1.71" z="0"/> <Vertex name="fieldOpponentLeft" x="2.46" y="1.71" z="0"/> <Vertex name="fieldOpponentRight" x="2.46" y="-1.71" z="0"/> <Vertex name="cornerOwnLeft" x="-2.45" y="1.7" z="0"/> <Vertex name="cornerOwnRight" x="-2.45" y="-1.7" z="0"/> <Vertex name="cornerOpponentLeft" x="2.45" y="1.7" z="0"/> <Vertex name="cornerOpponentRight" x="2.45" y="-1.7" z="0"/> <Vertex name="middleOwnLeft" x="-0.005" y="1.7" z="0"/> <Vertex name="middleOwnRight" x="-0.005" y="-1.7" z="0"/> <Vertex name="middleOpponentLeft" x="0.005" y="1.7" z="0"/> <Vertex name="middleOpponentRight" x="0.005" y="-1.7" z="0"/> <Vertex name="middleCircleA" x="0" y="0.4" z="0"/> <Vertex name="middleCircleB" x="0.069" y="0.394" z="0"/> <Vertex name="middleCircleC" x="0.137" y="0.376" z="0"/> <Vertex name="middleCircleD" x="0.2" y="0.346" z="0"/> <Vertex name="middleCircleE" x="0.257" y="0.306" z="0"/> <Vertex name="middleCircleF" x="0.306" y="0.257" z="0"/> <Vertex name="middleCircleG" x="0.346" y="0.2" z="0"/> <Vertex name="middleCircleH" x="0.376" y="0.137" z="0"/> <Vertex name="middleCircleI" x="0.394" y="0.069" z="0"/> <Vertex name="middleCircleJ" x="0.4" y="0" z="0"/> <Vertex name="middleCirclea" x="0" y="0.39" z="0"/> <Vertex name="middleCircleb" x="0.068" y="0.384" z="0"/> <Vertex name="middleCirclec" x="0.133" y="0.366" z="0"/> <Vertex name="middleCircled" x="0.195" y="0.338" z="0"/> <Vertex name="middleCirclee" x="0.251" y="0.299" z="0"/> <Vertex name="middleCirclef" x="0.299" y="0.251" z="0"/> <Vertex name="middleCircleg" x="0.338" y="0.195" z="0"/> <Vertex name="middleCircleh" x="0.366" y="0.133" z="0"/> <Vertex name="middleCirclei" x="0.384" y="0.068" z="0"/> <Vertex name="middleCirclej" x="0.39" y="0" z="0"/> <Vertex name="penaltyCircleA" x="0" y="0.5" z="0"/> <Vertex name="penaltyCircleB" x="0.087" y="0.492" z="0"/> <Vertex name="penaltyCircleC" x="0.171" y="0.47" z="0"/> <Vertex name="penaltyCircleD" x="0.25" y="0.433" z="0"/> <Vertex name="penaltyCircleE" x="0.321" y="0.383" z="0"/> <Vertex name="penaltyCircleF" x="0.383" y="0.321" z="0"/> <Vertex name="penaltyCircleG" x="0.433" y="0.25" z="0"/> <Vertex name="penaltyCircleH" x="0.47" y="0.171" z="0"/> <Vertex name="penaltyCircleI" x="0.492" y="0.087" z="0"/> <Vertex name="penaltyCircleJ" x="0.5" y="0" z="0"/> <Vertex name="penaltyCirclea" x="0" y="0.49" z="0"/> <Vertex name="penaltyCircleb" x="0.085" y="0.483" z="0"/> <Vertex name="penaltyCirclec" x="0.168" y="0.46" z="0"/> <Vertex name="penaltyCircled" x="0.245" y="0.424" z="0"/> <Vertex name="penaltyCirclee" x="0.315" y="0.375" z="0"/> <Vertex name="penaltyCirclef" x="0.375" y="0.315" z="0"/> <Vertex name="penaltyCircleg" x="0.424" y="0.245" z="0"/> <Vertex name="penaltyCircleh" x="0.46" y="0.168" z="0"/> <Vertex name="penaltyCirclei" x="0.483" y="0.085" z="0"/> <Vertex name="penaltyCirclej" x="0.49" y="0" z="0"/> </VertexList> <!-- The ball --> <Macro name="ball"> <Movable name="ball"> <Elements> <Sphere name="ball" radius="0.0215"> <Appearance ref="orange"/> <Material name="golfball"/> <PhysicalAttributes> <Mass value="0.046"/> </PhysicalAttributes> </Sphere> </Elements> </Movable> </Macro> <!-- The field --> <Macro name="quarter circle 40"> <ComplexShape name="lines"> <Translation x="0" y="0" z="0.0005"/> <Appearance ref="white"/> <GraphicalRepresentation vertexList="field coords"> <Polygon> <Vertex ref="middleCircleA"/> <Vertex ref="middleCircleB"/> <Vertex ref="middleCircleb"/> <Vertex ref="middleCirclea"/> </Polygon> <Polygon> <Vertex ref="middleCircleB"/> <Vertex ref="middleCircleC"/> <Vertex ref="middleCirclec"/> <Vertex ref="middleCircleb"/> </Polygon> <Polygon> <Vertex ref="middleCircleC"/> <Vertex ref="middleCircleD"/> <Vertex ref="middleCircled"/> <Vertex ref="middleCirclec"/> </Polygon> <Polygon> <Vertex ref="middleCircleD"/> <Vertex ref="middleCircleE"/> <Vertex ref="middleCirclee"/> <Vertex ref="middleCircled"/> </Polygon> <Polygon> <Vertex ref="middleCircleE"/> <Vertex ref="middleCircleF"/> <Vertex ref="middleCirclef"/> <Vertex ref="middleCirclee"/> </Polygon> <Polygon> <Vertex ref="middleCircleF"/> <Vertex ref="middleCircleG"/> <Vertex ref="middleCircleg"/> <Vertex ref="middleCirclef"/> </Polygon> <Polygon> <Vertex ref="middleCircleG"/> <Vertex ref="middleCircleH"/> <Vertex ref="middleCircleh"/> <Vertex ref="middleCircleg"/> </Polygon> <Polygon> <Vertex ref="middleCircleH"/> <Vertex ref="middleCircleI"/> <Vertex ref="middleCirclei"/> <Vertex ref="middleCircleh"/> </Polygon> <Polygon> <Vertex ref="middleCircleI"/> <Vertex ref="middleCircleJ"/> <Vertex ref="middleCirclej"/> <Vertex ref="middleCirclei"/> </Polygon> </GraphicalRepresentation> <PhysicalRepresentation/> </ComplexShape> </Macro> <Macro name="quarter circle 50"> <ComplexShape name="lines"> <Translation x="0" y="0" z="0.0005"/> <Appearance ref="white"/> <GraphicalRepresentation vertexList="field coords"> <Polygon> <Vertex ref="penaltyCircleA"/> <Vertex ref="penaltyCircleB"/> <Vertex ref="penaltyCircleb"/> <Vertex ref="penaltyCirclea"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleB"/> <Vertex ref="penaltyCircleC"/> <Vertex ref="penaltyCirclec"/> <Vertex ref="penaltyCircleb"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleC"/> <Vertex ref="penaltyCircleD"/> <Vertex ref="penaltyCircled"/> <Vertex ref="penaltyCirclec"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleD"/> <Vertex ref="penaltyCircleE"/> <Vertex ref="penaltyCirclee"/> <Vertex ref="penaltyCircled"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleE"/> <Vertex ref="penaltyCircleF"/> <Vertex ref="penaltyCirclef"/> <Vertex ref="penaltyCirclee"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleF"/> <Vertex ref="penaltyCircleG"/> <Vertex ref="penaltyCircleg"/> <Vertex ref="penaltyCirclef"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleG"/> <Vertex ref="penaltyCircleH"/> <Vertex ref="penaltyCircleh"/> <Vertex ref="penaltyCircleg"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleH"/> <Vertex ref="penaltyCircleI"/> <Vertex ref="penaltyCirclei"/> <Vertex ref="penaltyCircleh"/> </Polygon> <Polygon> <Vertex ref="penaltyCircleI"/> <Vertex ref="penaltyCircleJ"/> <Vertex ref="penaltyCirclej"/> <Vertex ref="penaltyCirclei"/> </Polygon> </GraphicalRepresentation> <PhysicalRepresentation/> </ComplexShape> </Macro> <Macro name="field half"> <Compound> <Elements> <ComplexShape name="lines"> <Translation x="0" y="0" z="0.0005"/> <Appearance ref="white"/> <GraphicalRepresentation vertexList="field coords"> <Polygon> <Vertex ref="cornerOwnLeft"/> <Vertex ref="fieldOwnLeft"/> <Vertex ref="fieldOwnRight"/> <Vertex ref="cornerOwnRight"/> </Polygon> <Polygon> <Vertex ref="fieldOwnLeft"/> <Vertex ref="cornerOwnLeft"/> <Vertex ref="cornerOpponentLeft"/> <Vertex ref="fieldOpponentLeft"/> </Polygon> </GraphicalRepresentation> <PhysicalRepresentation/> </ComplexShape> <Use macroName="quarter circle 40" instanceName="quarter1"/> <Use macroName="quarter circle 40" instanceName="quarter2"> <Rotation x="0" y="0" z="90"/> </Use> <Use macroName="quarter circle 50" instanceName="quarter3"> <Translation x="-2.45" y="0" z="0"/> <Rotation x="0" y="0" z="-90"/> </Use> <Use macroName="quarter circle 50" instanceName="quarter3"> <Translation x="-2.45" y="0" z="0"/> <Rotation x="0" y="0" z="0"/> </Use> <Box name="side wall" length="5.52" width="0.01" height="0.1"> <Translation x="0" y="2.005" z="0.05"/> <Appearance ref="white"/> </Box> <Box name="goal wall" length="0.01" width="4" height="0.1"> <Translation x="2.755" y="0" z="0.05"/> <Appearance ref="white"/> </Box> </Elements> </Compound> </Macro> <Macro name="goal side"> <Box length="0.18" width="0.01" height="0.15"/> </Macro> <Macro name="goal back"> <Box length="0.01" width="0.72" height="0.15"/> </Macro> <Macro name="goal"> <Compound> <Elements> <Use macroName="goal side" instanceName="goal side 1"> <Translation x="0.09" y="0.355" z="0.075"/> </Use> <Use macroName="goal side" instanceName="goal side 2"> <Translation x="0.09" y="-0.355" z="0.075"/> </Use> <Use macroName="goal back" instanceName="goal back"> <Translation x="0.185" y="0" z="0.075"/> </Use> </Elements> </Compound> </Macro> <Macro name="field"> <Compound> <Elements> <Use macroName="field half" instanceName="own side"/> <Use macroName="field half" instanceName="opponent side"> <Rotation x="0" y="0" z="180"/> </Use> <ComplexShape name="middle line"> <Translation x="0" y="0" z="0.0005"/> <Appearance ref="white"/> <GraphicalRepresentation vertexList="field coords"> <Polygon> <Vertex ref="middleOwnLeft"/> <Vertex ref="middleOwnRight"/> <Vertex ref="middleOpponentRight"/> <Vertex ref="middleOpponentLeft"/> </Polygon> </GraphicalRepresentation> <PhysicalRepresentation/> </ComplexShape> <Box name="Green carpet" length="5.5" width="4" height="0.005"> <Translation x="0" y="0" z="-0.0025"/> <Appearance ref="field green"/> <PhysicalAttributes> <Mass value="10"/> </PhysicalAttributes> </Box> <Use macroName="goal" instanceName="own goal"> <Translation x="2.45" y="0" z="0"/> <SubstituteAllSurfaces with="white"/> </Use> <Use macroName="goal" instanceName="opponent goal"> <Rotation x="0" y="0... [truncated message content] |
From: Markus R. <rol...@us...> - 2006-02-24 12:04:22
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/rsg/boxspheres Added Files: arena.rsg box.rsg ccylinder.rsg layer.rsg row.rsg simspark.rsg sphere.rsg staticbox.rsg staticccylinder.rsg staticsphere.rsg Log Message: - added rsg and ros example files --- NEW FILE: layer.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $density) (node Transform (setLocalPos -6 -4 0) (importScene rsg/boxspheres/row.rsg $radius $density) ) (node Transform (setLocalPos -6 -2 0) (importScene rsg/boxspheres/row.rsg $radius $density) ) (node Transform (setLocalPos -6 0 0) (importScene rsg/boxspheres/row.rsg $radius $density) ) (node Transform (setLocalPos -6 2 0) (importScene rsg/boxspheres/row.rsg $radius $density) ) (node Transform (setLocalPos -6 4 0) (importScene rsg/boxspheres/row.rsg $radius $density) ) ) --- NEW FILE: staticsphere.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $material) (node Sphere (setRadius $radius) (setMaterial $material) ) (node SphereCollider (setRadius $radius) (node ContactJointHandler (setContactBounceMode false) ) ) ) --- NEW FILE: arena.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; create the base plane (node Transform (setLocalPos 0 0 -1) (node Box (setMaterial matGreen) (setExtents 100 100 4) ) (node PlaneCollider (setParams 0 0 1.0 0) (node ContactJointHandler (setContactBounceMode false) ) ) ) ; create left side (node Transform (setLocalPos -50 0 10) (node Box (setMaterial matWhite) (setExtents 1 100 20) ) (node PlaneCollider (setParams 1.0 0 0 -49) ) ) ; create back side (node Transform (setLocalPos 0 50 10) (node Box (setMaterial matGrey) (setExtents 100 1 20) ) (node PlaneCollider (setParams 0 -1.0 0 -49) ) ) ; create right side (node Transform (setLocalPos 50 0 10) (node Box (setMaterial matWhite) (setExtents 1 100 20) ) (node PlaneCollider (setParams -1.0 0 0 -49) ) ) ; create front side (node Transform (setLocalPos 0 -50 10) (node Box (setMaterial matGrey) (setExtents 100 1 20) ) (node PlaneCollider (setParams 0 1.0 0 -49) ) ) ) --- NEW FILE: staticccylinder.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $length $density $material) (node CCylinder (setParams $radius $length) (setMaterial $material) ) (node CCylinderCollider (setParams $radius $length) ) ) --- NEW FILE: simspark.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; add lights (node Transform (setLocalPos -10 10 20) (node Light (setDiffuse 1.0 1.0 1.0 1.0) (setSpecular 0.1 0.1 0.1 1.0) (setAmbient 0.5 0.5 0.5 1.0) ) ) ; create the arena (node Transform (setLocalPos 0 0 -1) (importScene rsg/boxspheres/arena.rsg) ) ; add boxes (node Transform (setLocalPos -8 0 30) (importScene rsg/boxspheres/box.rsg 3 4 5 2 matYellow) ) (node Transform (setLocalPos -7 0 15) (importScene rsg/boxspheres/box.rsg 2 2 2 2 matRedGlow) (node Light (setDiffuse 0.5 0 0 1) (setSpecular 0.2 0.2 0.2 1) (setAmbient 0 0 0 1.0) ) ) ; add capped cylinder (node Transform (setLocalPos -4 0 20) (importScene rsg/boxspheres/ccylinder.rsg 1 3 2 matBlue) ) (node Transform (setLocalPos -6 3 20) (importScene rsg/boxspheres/ccylinder.rsg 1 10 2 matWhite) ) ; add two layer of spheres (node Transform (setLocalPos 0 0 0.6) (importScene rsg/boxspheres/layer.rsg 1 1) ) (node Transform (setLocalPos 0 0 2) (importScene rsg/boxspheres/layer.rsg 1 1) ) ) --- NEW FILE: ccylinder.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $length $density $material) (node CCylinder (setParams $radius $length) (setMaterial $material) ) (node Body (setCappedCylinder $density $radius $length) ) (node CCylinderCollider (setParams $radius $length) ) ) --- NEW FILE: box.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $lenX $lenY $lenZ $density $material) (node Box (setExtents $lenX $lenY $lenZ) (setMaterial $material) ) (node Body (setName boxBody) (setBox $density $lenX $lenY $lenZ) (node DragController (setAngularDrag 0.01) (setLinearDrag 0.01) ) ) (node BoxCollider (setBoxLengths $lenX $lenY $lenZ) (node ContactJointHandler (setContactBounceMode false) (setContactSlipMode true) (setContactSlip 0.1 0.1) (setContactSoftERPMode true) (setContactSoftERP 0.5) (setContactSoftCFM true) (setContactSoftCFM 0.3) ) ) ) --- NEW FILE: sphere.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $density $material) (node Sphere (setRadius $radius) (setMaterial $material) ) (node Body (setName sphereBody) (setSphere $density $radius) (node DragController (setAngularDrag 0.01) (setLinearDrag 0.01) ) ) (node SphereCollider (setRadius $radius) (node ContactJointHandler (setContactBounceMode false) (setContactSlipMode true) (setContactSlip 0.1 0.1) (setContactSoftERPMode true) (setContactSoftERP 0.5) (setContactSoftCFM true) (setContactSoftCFM 0.3) ) ) ) --- NEW FILE: staticbox.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $lenX $lenY $lenZ $material) (node Box (setExtents $lenX $lenY $lenZ) (setMaterial $material) ) (node BoxCollider (setBoxLengths $lenX $lenY $lenZ) (node ContactJointHandler (setContactBounceMode false) ) ) ) --- NEW FILE: row.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $radius $density) (node Transform (setLocalPos -6 0 0) (importScene rsg/boxspheres/sphere.rsg $radius $density matWhite) ) (node Transform (setLocalPos -3 0 0) (importScene rsg/boxspheres/sphere.rsg $radius $density matYellow) ) (node Transform (setLocalPos -0 0 0) (importScene rsg/boxspheres/sphere.rsg $radius $density matWhite) ) (node Transform (setLocalPos +3 0 0) (importScene rsg/boxspheres/sphere.rsg $radius $density matYellow) ) (node Transform (setLocalPos +6 0 0) (importScene rsg/boxspheres/sphere.rsg $radius $density matWhite) ) ) |
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/jointtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/rsg/jointtest Added Files: hinge2thing.rsg hingething.rsg rotorlayer.rsg rotorthing.rsg simspark.rsg sliderthing.rsg universalthing.rsg Log Message: - added rsg and ros example files --- NEW FILE: universalthing.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (node Transform (setName top) (setLocalPos 0 0 4) (importScene rsg/boxspheres/sphere.rsg 1 1 matRed) ) (node Transform (setName mid) (setLocalPos 0 0 2) (importScene rsg/boxspheres/box.rsg 1 1 2 2 matYellow) ) (node Transform (setName bottom) (setLocalPos 0 0 0) (importScene rsg/boxspheres/sphere.rsg 1 1 matGreen) ) (node UniversalJoint (attach ../top/sphereBody ../mid/boxBody) (setAnchor 0 0 1) (setLowStopDeg 0 -30) (setHighStopDeg 0 30) (setLowStopDeg 1 -45) (setHighStopDeg 1 45) ) (node UniversalJoint (attach ../bottom/sphereBody ../mid/boxBody) (setAnchor 0 0 3) (setLowStopDeg 0 -30) (setHighStopDeg 0 30) (setLowStopDeg 1 -45) (setHighStopDeg 1 45) ) ) --- NEW FILE: hinge2thing.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (node Transform (setName chassis) (setLocalPos 0 0 0.5) (importScene rsg/boxspheres/box.rsg 1 3 0.8 10 matRed) ) (node Transform (setName leftBack) (setLocalPos -0.5 -1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) (node Transform (setName leftFront) (setLocalPos -0.5 +1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) (node Transform (setName rightBack) (setLocalPos 0.5 -1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) (node Transform (setName rightFront) (setLocalPos 0.5 +1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) ) --- NEW FILE: rotorlayer.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $velocity $force) (node Transform (setLocalPos 0 -15 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos -11 -15 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos +11 -15 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos 0 -26 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos -11 -26 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos +11 -26 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos 0 -37 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos -11 -37 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) (node Transform (setLocalPos +11 -37 1) (importScene rsg/jointtest/rotorthing.rsg 10 $force $force) ) ) --- NEW FILE: simspark.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; add lights (node Transform (setLocalPos -10 10 20) (node Light (setDiffuse 1.0 1.0 1.0 1.0) (setSpecular 0.1 0.1 0.1 1.0) (setAmbient 0.5 0.5 0.5 1.0) ) ) ; create the arena (node Transform (setLocalPos 0 0 -1) (importScene rsg/boxspheres/arena.rsg) ) ; add a platform (node Transform (setLocalPos 0 25 20) (setLocalRotation 30 0 0) (importScene rsg/boxspheres/staticbox.rsg 15 80 0.2 matGreen) ) ; add some rotors (importScene rsg/jointtest/rotorlayer.rsg 200 300) (node Transform (setLocalPos 0 -20 15) (importScene rsg/boxspheres/layer.rsg 1 0.01) ) ; add some bodies connected with joints (node Transform (setLocalPos -2 40 32) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalPos -4 40 31) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalPos 0 39 30) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalPos -2 33 32) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalPos -4 36 29) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalPos 0 34 30) (importScene rsg/jointtest/hinge2thing.rsg) ) (node Transform (setLocalRotation 45 0 0) (setLocalPos 0 0 20) (importScene rsg/jointtest/hingething.rsg) ) (node Transform (setLocalRotation 45 0 0) (setLocalPos 0 0 30) (importScene rsg/jointtest/hingething.rsg) ) (node Transform (setLocalRotation 45 0 0) (setLocalPos 10 10 10) (importScene rsg/jointtest/sliderthing.rsg) ) (node Transform (setLocalPos -10 -10 10) (setLocalRotation 45 0 0) (importScene rsg/jointtest/universalthing.rsg) ) ) --- NEW FILE: hingething.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (node Transform (setName mid) (setLocalPos 0 0 0) (importScene rsg/boxspheres/box.rsg 8 1 2 2 matYellow) ) (node Transform (setName right) (setLocalPos 4.6 0 0) (importScene rsg/boxspheres/box.rsg 1 3 5.5 2 matBlue) ) (node Transform (setName left) (setLocalPos -4.6 0 0) (importScene rsg/boxspheres/box.rsg 1 3 5 2 matRed) ) (node HingeJoint (attach ../mid/boxBody ../right/boxBody) (setAnchor 3 0 0) (setLowStopDeg 0 -40) (setHighStopDeg 0 +40) ) (node HingeJoint (attach ../mid/boxBody ../left/boxBody) (setAnchor -3 0 0) (setLowStopDeg 0 -40) (setHighStopDeg 0 +40) ) ) --- NEW FILE: rotorthing.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (template $size $velocity $force) (node Transform (setName blue) (importScene rsg/boxspheres/box.rsg $size 1 1 2 matBlue) ) (node Transform (setName red) (importScene rsg/boxspheres/box.rsg 1 $size 1 2 matRed) ) (node FixedJoint (attach ../blue/boxBody ../red/boxBody) ) (node HingeJoint (attach ../blue/boxBody) (setAnchor 0 0 0) (setAngularMotorVelocity 0 $velocity) (setMaxMotorForce 0 $force) ) ) --- NEW FILE: sliderthing.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (node Transform (setName top) (setLocalPos 0 0 6) (importScene rsg/boxspheres/sphere.rsg 1 1 matRed) ) (node Transform (setName mid) (setLocalPos 0 0 4) (importScene rsg/boxspheres/box.rsg 2 1 2 2 matYellow) ) (node Transform (setName bottom) (setLocalPos 0 0 0) (importScene rsg/boxspheres/sphere.rsg 1 1 matGreen) ) (node SliderJoint (attach ../top/sphereBody ../mid/boxBody) (setLowStopPos 0 1) (setHighStopPos 0 1.5) ) (node SliderJoint (attach ../bottom/sphereBody ../mid/boxBody) (setLowStopPos 0 1) (setHighStopPos 0 1.5) ) ) |
From: Markus R. <rol...@us...> - 2006-02-24 10:40:47
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/agent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15792/agent Added Files: ball.rsg buggy.rsg flag.rsg leggedsphere.rsg simspark.rsg soccer.rsg soccerplayer.rsg Log Message: - added rsg and RoSiML demo files --- NEW FILE: ball.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( (define $Radius (eval Soccer.BallRadius)) (define $Material matOrange) (define $Density (eval Soccer.BallDensity)) (node Ball (setLocalPos 0 0 0.5) (setName Ball) (node Sphere (setRadius $Radius) (setMaterial $Material) ) (node Body (setName physics) (setSphere $Density $Radius) (node DragController (setAngularDrag 0.2) (setLinearDrag 0.4) ) ) (node SphereCollider (setName geometry) (setRadius $Radius) (node ContactJointHandler (setContactBounceMode false) (setContactSlipMode true) (setContactSlip 0.1 0.1) (setContactSoftERPMode true) (setContactSoftERP 0.5) (setContactSoftCFM true) (setContactSoftCFM 0.3) ) ) (node ObjectState (setPerceptName Ball) ) ) ) --- NEW FILE: soccer.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; ; define constants, copy values from the ScriptServer Soccer namespace ; (define $FieldLength (eval Soccer.FieldLength)) (define $FieldWidth (eval Soccer.FieldWidth)) (define $BorderExt (eval Soccer.BorderSize)) (define $GoalWidth (eval Soccer.GoalWidth)) (define $GoalDepth (eval Soccer.GoalDepth)) (define $GoalHeight (eval Soccer.GoalHeight)) ; height of the field ground plane (define $FieldBaseHeight 4) ; with of the side boundary (define $SideExt 2) ; height of the side boundary (define $SideHeight 1) ; height of a field line (define $LineHeight 0.2) (define $FieldMaterial matGreen) (define $BorderMaterial matYellow) (define $SideMaterial matGrey) (define $LineMaterial matWhite) (define $GoalMaterial matWhite) ; calc some helper vars (define $FieldBase (eval -1 * $FieldBaseHeight / 2.0)) (define $LineBase 0) (define $FieldHalfLength (eval $FieldLength / 2.0)) (define $FieldHalfWidth (eval $FieldWidth / 2.0)) (define $GoalHalfWidth (eval $GoalWidth / 2.0)) (define $GoalHalfHeight (eval $GoalHeight / 2.0)) (define $GoalHalfDepth (eval $GoalDepth / 2.0)) (define $HalfBorderExt (eval $BorderExt / 2.0)) (define $BorderLength (eval $FieldHalfLength + $HalfBorderExt)) (define $BorderWidth (eval $FieldHalfWidth + $HalfBorderExt)) (define $SideLength (eval $FieldHalfLength + $BorderExt)) (define $SideWidth (eval $FieldHalfWidth + $BorderExt)) (define $LineWidth (eval $FieldWidth - $LineHeight)) (define $BarDiameter $LineHeight) (define $BarRadius (eval $BarDiameter / 2.0)) ; ; construct playing field ; ; add lights (node Transform (setLocalPos -10 10 10) (node Light (setDiffuse 1.0 1.0 1.0 1.0) (setSpecular 0.1 0.1 0.1 1.0) (setAmbient 0.8 0.8 0.8 1.0) ) ) ; add lights (node Transform (setLocalPos 10 -10 10) (node Light (setDiffuse 1.0 1.0 1.0 1.0) (setSpecular 0.1 0.1 0.1 1.0) (setAmbient 0.0 0.0 0.0 1.0) ) ) ; create the base plane (node Transform (setLocalPos 0 0 $FieldBase) (node Box (setMaterial $FieldMaterial) (setExtents $FieldLength $FieldWidth $FieldBaseHeight) ) (node PlaneCollider (setParams 0 0 1.0 0) (node ContactJointHandler (setContactBounceMode false) ) ) ) ; create the left goal (node Transform (setName GoalBoxL) (setLocalPos (eval -1 * (eval $FieldHalfLength + $GoalHalfDepth)) 0 $GoalHalfHeight) (node BoxCollider (setBoxLengths $GoalDepth $GoalWidth $GoalHeight) (node ContactJointHandler (setContactBounceMode false) ) ) (node RecorderHandler (setName recorder) ) ) ; create the goal bar on top of the goal (left goal) (node Transform (setLocalPos (eval -1 * (eval $FieldHalfLength + $GoalHalfDepth) + $LineHeight) 0 (eval $GoalHeight + $BarRadius) ) (node Box (setExtents $GoalDepth (eval $GoalWidth - 0.1) $BarDiameter) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth (eval $GoalWidth - 0.1) $BarDiameter) ) ) ; create the left goal post (left goal) (node Transform (setLocalPos (eval -1 * (eval $FieldHalfLength + $GoalHalfDepth) + $LineHeight) (eval -1 * (eval $GoalHalfWidth + $BarRadius)) (eval $GoalHalfHeight + $BarRadius) ) (node Box (setExtents $GoalDepth $BarDiameter $GoalHeight) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth $BarDiameter $GoalHeight) ) ) ; create the right goal post (left goal) (node Transform (setLocalPos (eval -1 * (eval $FieldHalfLength + $GoalHalfDepth) + $LineHeight) (eval $GoalHalfWidth + $BarRadius) (eval $GoalHalfHeight + $BarRadius) ) (node Box (setExtents $GoalDepth $BarDiameter $GoalHeight) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth $BarDiameter $GoalHeight) ) ) ; create the right goal (node Transform (setName GoalBoxR) (setLocalPos (eval $FieldHalfLength + $GoalHalfDepth) 0 $GoalHalfHeight) (node BoxCollider (setBoxLengths $GoalDepth $GoalWidth $GoalHeight) (node ContactJointHandler (setContactBounceMode false) ) ) (node RecorderHandler (setName recorder) ) ) ; create the goal bar on top of the goal (right goal) (node Transform (setLocalPos (eval (eval $FieldHalfLength + $GoalHalfDepth) - $LineHeight) 0 (eval $GoalHeight + $BarRadius) ) (node Box (setExtents $GoalDepth (eval $GoalWidth - 0.1) $BarDiameter) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth (eval $GoalWidth - 0.1) $BarDiameter) ) ) ; create the left goal post (right goal) (node Transform (setLocalPos (eval (eval $FieldHalfLength + $GoalHalfDepth) - $LineHeight) (eval -1 * (eval $GoalHalfWidth + $BarRadius)) (eval $GoalHalfHeight + $BarRadius) ) (node Box (setExtents $GoalDepth $BarDiameter $GoalHeight) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth $BarDiameter $GoalHeight) ) ) ; create the right goal post (right goal) (node Transform (setLocalPos (eval (eval $FieldHalfLength + $GoalHalfDepth) - $LineHeight) (eval $GoalHalfWidth + $BarRadius) (eval $GoalHalfHeight + $BarRadius) ) (node Box (setExtents $GoalDepth $BarDiameter $GoalHeight) (setMaterial $GoalMaterial) ) (node BoxCollider (setBoxLengths $GoalDepth $BarDiameter $GoalHeight) ) ) ; create left side (node Transform (setLocalPos (eval -1 * $SideLength) 0 0) (node Box (setMaterial $SideMaterial) (setExtents $SideHeight (eval $FieldWidth + 2 * $BorderExt) $SideExt) ) (node PlaneCollider (setParams 1.0 0 0 (eval -1 * $SideLength)) ) ) ; create right side (node Transform (setLocalPos $SideLength 0 0) (node Box (setMaterial $SideMaterial) (setExtents $SideHeight (eval $FieldWidth + 2 * $BorderExt) $SideExt) ) (node PlaneCollider (setParams -1.0 0 0 (eval -1 * $SideLength)) ) ) ; create back side (node Transform (setLocalPos 0 $SideWidth 0) (node Box (setMaterial $SideMaterial) (setExtents (eval $FieldLength + 2 * $BorderExt) $SideHeight $SideExt) ) (node PlaneCollider (setParams 0 -1.0 0 (eval -1 * $SideWidth)) ) ) ; create front side (node Transform (setLocalPos 0 (eval -1 * $SideWidth) 0) (node Box (setMaterial $SideMaterial) (setExtents (eval $FieldLength + 2 * $BorderExt) $SideHeight $SideExt) ) (node PlaneCollider (setParams 0 1.0 0 (eval -1 * $SideWidth)) ) ) ; create middle line (node Transform (setLocalPos 0 0 $LineBase) (node Box (setExtents $LineHeight $LineWidth $LineHeight) (setMaterial $LineMaterial) ) ) ; create front line (node Transform (setLocalPos 0 (eval -1 * $FieldHalfWidth) $LineBase) (node Box (setExtents $FieldLength $LineHeight $LineHeight) (setMaterial $LineMaterial) ) ) ; create back line (node Transform (setLocalPos 0 $FieldHalfWidth $LineBase) (node Box (setExtents $FieldLength $LineHeight $LineHeight) (setMaterial $LineMaterial) ) ) ; create left line (node Transform (setLocalPos (eval -1 * $FieldHalfLength) 0 $LineBase) (node Box (setExtents $LineHeight $LineWidth $LineHeight) (setMaterial $LineMaterial) ) ) ; create right line (node Transform (setLocalPos $FieldHalfLength 0 $LineBase) (node Box (setExtents $LineHeight $LineWidth $LineHeight) (setMaterial $LineMaterial) ) ) ; create left outer field (node Transform (setLocalPos (eval -1 * $BorderLength) 0 $FieldBase) (node Box (setMaterial $BorderMaterial) (setExtents $BorderExt $FieldWidth $FieldBaseHeight) ) ) ; create right outer field (node Transform (setLocalPos $BorderLength 0 $FieldBase) (node Box (setMaterial $BorderMaterial) (setExtents $BorderExt $FieldWidth $FieldBaseHeight) ) ) ; create front outer field (node Transform (setLocalPos 0 (eval -1 * $BorderWidth) $FieldBase) (node Box (setMaterial $BorderMaterial) (setExtents (eval $FieldLength + 2 * $BorderExt) $BorderExt $FieldBaseHeight) ) ) ; create back outer field (node Transform (setLocalPos 0 $BorderWidth $FieldBase) (node Box (setMaterial $BorderMaterial) (setExtents (eval $FieldLength + 2 * $BorderExt) $BorderExt $FieldBaseHeight) ) ) ;; ;; add flags ;; ; mark the soccer field with 4 field flags (importScene rsg/agent/flag.rsg (eval -1 * $FieldHalfLength) $FieldHalfWidth 0 Flag_1_l matRed ) (importScene rsg/agent/flag.rsg (eval -1 * $FieldHalfLength) (eval -1 * $FieldHalfWidth) 0 Flag_2_l matRed ) (importScene rsg/agent/flag.rsg $FieldHalfLength $FieldHalfWidth 0 Flag_1_r matBlue ) (importScene rsg/agent/flag.rsg $FieldHalfLength (eval -1 * $FieldHalfWidth) 0 Flag_2_r matBlue ) ; mark the left goal (importScene rsg/agent/flag.rsg (eval -1 * $FieldHalfLength) (eval -1 * $GoalHalfWidth) 0 Goal_1_l matRed ) (importScene rsg/agent/flag.rsg (eval -1 * $FieldHalfLength) $GoalHalfWidth 0 Goal_2_l matRed ) ; mark the right goal (importScene rsg/agent/flag.rsg $FieldHalfLength (eval -1 * $GoalHalfWidth) 0 Goal_1_r matBlue ) (importScene rsg/agent/flag.rsg $FieldHalfLength $GoalHalfWidth 0 Goal_2_r matBlue ) ;; ;; add the ball ;; (importScene rsg/agent/ball.rsg) ) --- NEW FILE: simspark.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; add lights (node Transform (setLocalPos -10 10 10) (node Light (setDiffuse 1.0 1.0 1.0 1.0) (setSpecular 0.1 0.1 0.1 1.0) (setAmbient 0.5 0.5 0.5 1.0) ) ) ; create the arena (node Transform (setLocalPos 0 0 -2) (importScene rsg/boxspheres/arena.rsg) ) ) --- NEW FILE: soccerplayer.rsg --- ; -*- mode: lisp; -*- (RubySceneGraph 0 1) ( ; create the torso (node AgentAspect (setName torso) (setLocalPos 0 0 0.5) (importScene rsg/boxspheres/box.rsg 1.3 1 1 5 matRed) ; install a perceptor to receive the current simulation time (node TimePerceptor) ; install a node holding agent state data (node AgentState (setName AgentState) ) ; install a perceptor to receive info about ball and player positions (node VisionPerceptor (setSenseMyPos false) (setStaticSenseAxis false) (addNoise false) ) ; install a kick effector (node KickEffector (setKickMargin 2) (setForceFactor 0.7) (setTorqueFactor 0.1) (setNoiseParams 0.4 0.02 0.9 4.5) (setSteps 10) (setMaxPower 100.0) (setAngleRange 0.0 50.0) ) ; install a beam effector (node BeamEffector) (node Transform (setLocalPos 0 0.5 0.6) (node Box (setMaterial matBlue) (setExtents 1 0.1 0.2) ) ) (node Transform (setLocalPos 0 0.1 0.6) (node Box (setMaterial matBlue) (setExtents 0.1 0.8 0.2) ) ) ) ; install the left tire (node Transform (setName leftTire) (setLocalPos -0.6 0.5 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matWhite) (node Transform (setLocalRotation 0 0 180) ; install the joint (node Hinge2Joint (attach ../../sphereBody ../../../torso/boxBody) (setAnchor 0 0 0) ; enable the joint motor (setMaxMotorForce 1 4000) ; install a perceptor to measure the tire movement (node Hinge2Perceptor (setName ltp) ) ; install an effector to control the joint motor (node Hinge2Effector (setName lte) ) ) ; add some boxes to visualize the tire spin (node Box (setExtents 1.1 0.1 0.1) (setMaterial matBlue) ) (node Box (setExtents 0.1 1.1 0.1) (setMaterial matRed) ) (node Box (setExtents 0.1 0.1 1.1) (setMaterial matYellow) ) ) ) ; install the right tire (node Transform (setName rightTire) (setLocalPos 0.6 0.5 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matWhite) (node Transform (setLocalRotation 0 0 180) ; install the joint (node Hinge2Joint (attach ../../sphereBody ../../../torso/boxBody) (setAnchor 0 0 0) ; enable the joint motor (setMaxMotorForce 1 4000) ; install a perceptor to measure the tire movement (node Hinge2Perceptor (setName rtp) ) ; install an effector to control the joint motor (node Hinge2Effector (setName rte) ) ) ; add some boxes to visualize the tire spin (node Box (setExtents 1.1 0.1 0.1) (setMaterial matBlue) ) (node Box (setExtents 0.1 1.1 0.1) (setMaterial matRed) ) (node Box (setExtents 0.1 0.1 1.1) (setMaterial matYellow) ) ) ) ; install passive back tire (node Transform (setName backTire) (setLocalPos 0 -0.55 0.5) (importScene rsg/boxspheres/sphere.rsg 0.51 2 matGrey) ; install the joint (node Hinge2Joint (attach ../sphereBody ../../torso/boxBody) (setAnchor 0 0 0) ) ) ) --- NEW FILE: leggedsphere.rsg --- ; -*- mode: lisp; -*- ; ; sphere with two legs (5DOF/leg) ; (RubySceneGraph 0 1) ( ; create the sphere (node Transform (setName body) (setLocalPos 0 0 3) (importScene rsg/boxspheres/sphere.rsg 1.25 0.75 matRed) ) ; attach left thigh (node Transform (setName leftthigh) (setLocalPos 1.25 0 2.25) (importScene rsg/boxspheres/box.rsg 0.5 0.5 1.0 1.0 matGrey) ; install the joint to connect to the body (node UniversalJoint (attach ../boxBody ../../body/sphereBody) (setAnchor 0 0 0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName lefthip) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lhe) ) ) ) ; attach left shank (node Transform (setName leftshank) (setLocalPos 1.25 0 1) (importScene rsg/boxspheres/box.rsg 0.5 0.5 1.0 1.0 matGrey) ; install the joint to connect to the body (node HingeJoint (attach ../boxBody ../../leftthigh/boxBody) (setAnchor 0 0 0) (setAxis 0) ; move around the x-axis ; enable the joint motor (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName leftknee) ) ; install an effector to control the joint motor (node HingeEffector (setName lke) ) ) ) ; attach left foot (node Transform (setName leftfoot) (setLocalPos 1.25 0 0.125) (importScene rsg/boxspheres/box.rsg 1.0 1.25 0.25 1.0 matGrey) ; install the joint to connect to the body (node UniversalJoint (attach ../boxBody ../../leftshank/boxBody) (setAnchor 0 0 0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName leftankle) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lae) ) ) ) ; attach right thigh (node Transform (setName rightthigh) (setLocalPos -1.25 0 2.25) (importScene rsg/boxspheres/box.rsg 0.5 0.5 1.0 1.0 matGrey) (node UniversalJoint (attach ../boxBody ../../body/sphereBody) (setAnchor 0 0 0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName righthip) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rhe) ) ) ) ; attach right shank (node Transform (setName rightshank) (setLocalPos -1.25 0 1) (importScene rsg/boxspheres/box.rsg 0.5 0.5 1.0 1.0 matGrey) ; install the joint to connect to the body (node HingeJoint (attach ../boxBody ../../rightthigh/boxBody) (setAnchor 0 0 0) (setAxis 0) ; move around the x-axis ; enable the joint motor (setMaxMotorForce 0 100) ; install a perceptor (node HingePerceptor (setName rightknee) ) ; install an effector to control the joint motor (node HingeEffector (setName rke) ) ) ) ; attach right foot (node Transform (setName rightfoot) (setLocalPos -1.25 0 0.125) (importScene rsg/boxspheres/box.rsg 1.0 1.25 0.25 1.0 matGrey) ; install the joint to connect to the body (node UniversalJoint (attach ../boxBody ../../rightshank/boxBody) (setAnchor 0 0 0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName rightankle) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rae) ) ) ) ) --- NEW FILE: buggy.rsg --- ; -*- mode: lisp; -*- ; ; this file constructs a simple buggy, the connected agent controlls ; one joint motor ; (RubySceneGraph 0 1) ( ; install a perceptor to receive the current simulation time (node TimePerceptor) ; create the char chassis (node Transform (setName chassis) (setLocalPos 0 0 0.5) (importScene rsg/boxspheres/box.rsg 1 3 0.8 10 matRed) (node Transform (setLocalPos 0 1.3 0.55) (node Box (setMaterial matBlue) (setExtents 1 0.1 0.3) ) ) ) ; install the left back tire, this tire is used to accelerate (node Transform (setName leftBack) (setLocalPos -0.5 -1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Transform (setLocalRotation 0 180 0) ; install the joint (node Hinge2Joint (attach ../../sphereBody ../../../chassis/boxBody) (setAnchor 0 0 0) ; enable the joint motor (setMaxMotorForce 1 4000) ; install a perceptor to measure the tire movement (node Hinge2Perceptor (setName lb) ) ; install an effector to control the joint motor (node Hinge2Effector) ) ; add some boxes to visualize the tire spin (node Box (setExtents 1 0.1 0.1) (setMaterial matBlue) ) (node Box (setExtents 0.1 1 0.1) (setMaterial matRed) ) (node Box (setExtents 0.1 0.1 1) (setMaterial matYellow) ) ) ) ; install remaining passive wheels (node Transform (setName leftFront) (setLocalPos -0.5 +1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) (node Transform (setName rightBack) (setLocalPos 0.5 -1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Transform (setLocalRotation 0 180 0) (node Hinge2Joint (attach ../../sphereBody ../../../chassis/boxBody) (setAnchor 0 0 0) ) ) ) (node Transform (setName rightFront) (setLocalPos 0.5 +1.5 0) (importScene rsg/boxspheres/sphere.rsg 0.4 2 matWhite) (node Hinge2Joint (attach ../sphereBody ../../chassis/boxBody) (setAnchor 0 0 0) ) ) ) --- NEW FILE: flag.rsg --- ; -*- mode: lisp; -*- ; ; create a field flag at ($PosX $PosY $PosZ) named $Name with the ; given $Material ; (RubySceneGraph 0 1) ( (template $PosX $PosY $PosZ $Name $Material) (node Transform (setLocalPos $PosX $PosY $PosZ) (importScene rsg/boxspheres/staticsphere.rsg 1 $Material) (node ObjectState (setPerceptName $Name) ) ) ) |
From: Markus R. <rol...@us...> - 2006-02-24 10:38:36
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14627/boxspheres Log Message: Directory /cvsroot/simspark/simspark/simulations/parts/rsg/boxspheres added to the repository |
From: Markus R. <rol...@us...> - 2006-02-24 10:38:35
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/jointtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14627/jointtest Log Message: Directory /cvsroot/simspark/simspark/simulations/parts/rsg/jointtest added to the repository |
From: Markus R. <rol...@us...> - 2006-02-24 10:38:35
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/agent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14627/agent Log Message: Directory /cvsroot/simspark/simspark/simulations/parts/rsg/agent added to the repository |
From: Markus R. <rol...@us...> - 2006-02-24 10:37:59
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14148/rsg Log Message: Directory /cvsroot/simspark/simspark/simulations/parts/rsg added to the repository |
From: Markus R. <rol...@us...> - 2006-02-24 10:37:12
|
Update of /cvsroot/simspark/simspark/simulations/parts/ros In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13545/ros Log Message: Directory /cvsroot/simspark/simspark/simulations/parts/ros added to the repository |
From: Markus R. <rol...@us...> - 2006-02-24 10:36:04
|
Update of /cvsroot/simspark/simspark/simulations/parts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12924/parts Log Message: Directory /cvsroot/simspark/simspark/simulations/parts added to the repository |
From: Markus R. <rol...@us...> - 2006-02-23 13:40:29
|
Update of /cvsroot/simspark/simspark/spark/plugin/rosimporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17195 Modified Files: roselements.cpp roselements.h rosimporter.cpp rosimporter.h Log Message: - create and register TriMeshes from the parsed meshes - parse Physical Representation of complex objects; this needes still some work to get the joint setup right - various small fixes Index: roselements.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/roselements.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roselements.h 22 Feb 2006 19:42:07 -0000 1.4 --- roselements.h 23 Feb 2006 13:40:23 -0000 1.5 *************** *** 97,100 **** --- 97,106 ---- RE_GRAPHICALREPRESENTATION, RE_POLYGON, + RE_TRIANGLESTRIP, + RE_PHYSICALREPRESENTATION, + RE_SIMPLEBOX, + RE_SIMPLESPHERE, + RE_SIMPLECYLINDER, + RE_SIMPLECAPPEDCYLINDER, RE_MACRO, Index: roselements.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/roselements.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roselements.cpp 22 Feb 2006 19:42:07 -0000 1.4 --- roselements.cpp 23 Feb 2006 13:40:23 -0000 1.5 *************** *** 67,71 **** --- 67,78 ---- ROS_DEFINE_ELEMENT(RE_VERTEX,"Vertex"); ROS_DEFINE_ELEMENT(RE_GRAPHICALREPRESENTATION, "GraphicalRepresentation"); + ROS_DEFINE_ELEMENT(RE_PHYSICALREPRESENTATION,"PhysicalRepresentation"); ROS_DEFINE_ELEMENT(RE_POLYGON,"Polygon"); + ROS_DEFINE_ELEMENT(RE_TRIANGLESTRIP,"TriangleStrip"); + + ROS_DEFINE_ELEMENT(RE_SIMPLEBOX,"SimpleBox"); + ROS_DEFINE_ELEMENT(RE_SIMPLESPHERE,"SimpleSphere"); + ROS_DEFINE_ELEMENT(RE_SIMPLECYLINDER,"SimpleCylinder"); + ROS_DEFINE_ELEMENT(RE_SIMPLECAPPEDCYLINDER,"SimpleCappedCylinder"); ROS_DEFINE_ELEMENT(RE_MACRO, "Macro"); Index: rosimporter.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rosimporter.cpp 22 Feb 2006 19:42:07 -0000 1.8 --- rosimporter.cpp 23 Feb 2006 13:40:23 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- */ #include "rosimporter.h" + #include <GL/glu.h> #include <tinyxml/xmlfunctions.h> #include <zeitgeist/logserver/logserver.h> *************** *** 32,35 **** --- 33,37 ---- #include <oxygen/physicsserver/body.h> #include <oxygen/physicsserver/hingejoint.h> + #include <oxygen/geometryserver/geometryserver.h> #include <oxygen/geometryserver/trimesh.h> #include <kerosin/openglserver/glbase.h> *************** *** 39,42 **** --- 41,45 ---- #include <kerosin/sceneserver/sphere.h> #include <kerosin/sceneserver/ccylinder.h> + #include <kerosin/sceneserver/staticmesh.h> #include <kerosin/renderserver/renderserver.h> #include <boost/scoped_array.hpp> *************** *** 56,61 **** --- 59,116 ---- static const string S_UNNAMED("<unnamed>"); + // ------------------- + + boost::shared_array<float> RosImporter::TVertexList::GetPos() + { + if (pos.get() != 0) + { + return pos; + } + + pos = shared_array<float> (new float[vertexRef.size() * 3]); + + int i=0; + for ( + TVertexRef::iterator iter = vertexRef.begin(); + iter != vertexRef.end(); + ++iter + ) + { + TVertex& vertex = (*iter).second; + vertex.idx = i; + + pos[(i*3)+0] = vertex.vec[0]; + pos[(i*3)+1] = vertex.vec[1]; + pos[(i*3)+2] = vertex.vec[2]; + + ++i; + } + + return pos; + } + + int RosImporter::TVertexList::GetIndex(const std::string& name) + { + TVertexRef::const_iterator iter = vertexRef.find(name); + if (iter == vertexRef.end()) + { + return -1; + } + + return (*iter).second.idx; + } + + + void RosImporter::TVertexList::AddVertex(const std::string& name, const TVertex& vertex) + { + pos.reset(); + vertexRef[name] = vertex; + } + + // ------------------- + RosImporter::TMacroMap RosImporter::mMacroMap; + RosImporter::RosImporter() : SceneImporter() { *************** *** 332,336 **** if (materialServer.get() == 0) { ! GetLog()->Error() << "(RosImporter) failed to lookup MaterialServer node\n"; return false; } --- 387,391 ---- if (materialServer.get() == 0) { ! GetLog()->Error() << "(RosImporter) ERROR: failed to lookup MaterialServer node\n"; return false; } *************** *** 392,396 **** if (renderServer.get() == 0) { ! GetLog()->Error() << "(RosImporter) failed to lookup RenderServer node\n"; return false; } --- 447,451 ---- if (renderServer.get() == 0) { ! GetLog()->Error() << "(RosImporter) ERROR: failed to lookup RenderServer node\n"; return false; } *************** *** 557,560 **** --- 612,620 ---- ) { + if (IgnoreNode(node)) + { + continue; + } + TiXmlElement* element = static_cast<TiXmlElement*>(node); if (element == 0) *************** *** 610,613 **** --- 670,679 ---- } + void RosImporter::ApplyTransform(shared_ptr<Transform> transform, const Trans& trans) + { + transform->SetLocalRotationDeg(trans.rotate); + transform->SetLocalPos(trans.translate); + } + shared_ptr<Transform> RosImporter::CreateTransform(shared_ptr<BaseNode> parent, const Trans& trans) { *************** *** 615,620 **** (GetCore()->New("/oxygen/Transform")); ! transform->SetLocalRotationDeg(trans.rotate); ! transform->SetLocalPos(trans.translate); parent->AddChildReference(transform); --- 681,685 ---- (GetCore()->New("/oxygen/Transform")); ! ApplyTransform(transform, trans); parent->AddChildReference(transform); *************** *** 949,952 **** --- 1014,1018 ---- shared_ptr<Body> RosImporter::GetJointParentBody(shared_ptr<BaseNode> parent) { + GetLog()->Debug() << "RosImporter::GetJointParentBody for " << parent->GetFullPath() << "\n"; for ( shared_ptr<BaseNode> node = parent; *************** *** 958,965 **** if (body.get() != 0) { return body; } } ! return shared_ptr<Body>(); } --- 1024,1032 ---- if (body.get() != 0) { + GetLog()->Debug() << "RosImporter::GetJointParentBody found " << body->GetFullPath() << "\n"; return body; } } ! GetLog()->Debug() << "RosImporter::GetJointParentBody not found\n"; return shared_ptr<Body>(); } *************** *** 968,971 **** --- 1035,1040 ---- { // find the body created most recently + GetLog()->Debug() << "RosImporter::GetJointChildBody for " << parent->GetFullPath() << "\n"; + Leaf::TLeafList children; parent->ListChildrenSupportingClass<Transform>(children,false); *************** *** 982,989 **** --- 1051,1060 ---- if (body.get() != 0) { + GetLog()->Debug() << "RosImporter::GetJointChildBody found " << body->GetFullPath() << "\n"; return body; } } + GetLog()->Debug() << "RosImporter::GetJointChildBody not found\n"; return shared_ptr<Body>(); } *************** *** 1086,1090 **** transform->SetName(S_MACRO+instance); ! GetLog()->Debug() << "(RosImporter) START instancing macro " << name << "\n"; shared_ptr<TiXmlElement> tree = (*iter).second; --- 1157,1162 ---- transform->SetName(S_MACRO+instance); ! GetLog()->Debug() << "(RosImporter) START instancing macro " << name ! << " as instance " << instance << "\n"; shared_ptr<TiXmlElement> tree = (*iter).second; *************** *** 1092,1096 **** GetLog()->Debug() << "(RosImporter) END instancing macro " << name << "\n"; - return ok; } --- 1164,1167 ---- *************** *** 1132,1141 **** case RosElements::RE_VERTEX: { ! Vector3f vec; string name; if ( (! ReadAttribute(element, RA_NAME, name)) || ! (! ReadVector(element, vec)) ) { --- 1203,1212 ---- case RosElements::RE_VERTEX: { ! TVertex vertex; string name; if ( (! ReadAttribute(element, RA_NAME, name)) || ! (! ReadVector(element, vertex.vec)) ) { *************** *** 1143,1147 **** } ! vertices[name] = vec; break; } --- 1214,1218 ---- } ! vertices.AddVertex(name, vertex); break; } *************** *** 1155,1163 **** bool RosImporter::ReadComplexShape(shared_ptr<BaseNode> parent, TiXmlElement* element, ENodeContext context) { string name; Trans trans; Appearance appear; Physical physical; - TVertexList vertices; if ( --- 1226,1242 ---- bool RosImporter::ReadComplexShape(shared_ptr<BaseNode> parent, TiXmlElement* element, ENodeContext context) { + shared_ptr<GeometryServer> geometryServer = shared_dynamic_cast<GeometryServer> + (GetCore()->Get("/sys/server/geometry")); + + if (geometryServer.get() == 0) + { + GetLog()->Error() << "(RosImporter) ERROR: failed to lookup GeometryServer node\n"; + return false; + } + string name; Trans trans; Appearance appear; Physical physical; if ( *************** *** 1186,1204 **** transform->SetName(name); ! // TODO: read <Appearance> tag, does ist always 'ref' to the ! // surrounding compley shape? ! TriMesh mesh; ! if (! ReadGraphicalRep(parent, element, mesh)) { return false; } ! GetLog()->Debug() << "(RosImporter) read complex shape " << name << "\n"; ! return true; } ! bool RosImporter::ReadGraphicalRep(shared_ptr<BaseNode> parent, TiXmlElement* element, TriMesh& mesh) { TiXmlElement* graphRepElem = GetFirstChild(element, RosElements::RE_GRAPHICALREPRESENTATION); --- 1265,1293 ---- transform->SetName(name); ! if (! ReadPhysicalRep(transform,element,context)) ! { ! return false; ! } ! shared_ptr<TriMesh> mesh(new TriMesh); ! mesh->SetName(name); ! ! if (! ReadGraphicalRep(element, mesh, appear)) { return false; } ! geometryServer->RegisterMesh(mesh); ! shared_ptr<StaticMesh> staticMesh = shared_dynamic_cast<StaticMesh> ! (GetCore()->New("/kerosin/StaticMesh")); ! transform->AddChildReference(staticMesh); ! staticMesh->Load(name); ! ! GetLog()->Debug() << "(RosImporter) read complex shape " << name << "\n"; ! return ReadChildElements(transform, element, context); } ! bool RosImporter::ReadGraphicalRep(TiXmlElement* element, shared_ptr<TriMesh> mesh, const Appearance& appear) { TiXmlElement* graphRepElem = GetFirstChild(element, RosElements::RE_GRAPHICALREPRESENTATION); *************** *** 1220,1224 **** } ! TVertexListMap::const_iterator iter = mVertexListMap.find(vertexListName); if (iter == mVertexListMap.end()) { --- 1309,1313 ---- } ! TVertexListMap::iterator iter = mVertexListMap.find(vertexListName); if (iter == mVertexListMap.end()) { *************** *** 1232,1237 **** } - const TVertexList& vertexList = (*iter).second; - TComplexGeomList geomList; if (! ReadComplexElements(graphRepElem, geomList)) --- 1321,1324 ---- *************** *** 1240,1243 **** --- 1327,1335 ---- } + TVertexList& vertexList = (*iter).second; + BuildTriMesh(mesh, vertexList, geomList, appear); + + GetLog()->Debug() << "(RosImporter) read graphical representation\n"; + return true; } *************** *** 1245,1256 **** bool RosImporter::ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList) { - // TODO: read TriangleStrips - for ( ! TiXmlNode* node = GetFirstChild(element, RosElements::RE_POLYGON); node != 0; node = element->IterateChildren(node) ) { TiXmlElement* element = static_cast<TiXmlElement*>(node); --- 1337,1351 ---- bool RosImporter::ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList) { for ( ! TiXmlNode* node = element->FirstChild(); node != 0; node = element->IterateChildren(node) ) { + if (IgnoreNode(node)) + { + continue; + } + TiXmlElement* element = static_cast<TiXmlElement*>(node); *************** *** 1264,1276 **** case RosElements::RE_POLYGON: ! ComplexGeom geom(CG_Polygon); ! if (! ReadComplexGeom(element, geom)) ! { ! return false; ! } ! GetLog()->Debug() << "(RosImporter) read polygon with " << geom.vertices.size() << " vertices\n"; ! geomList.push_back(geom); ! break; } } --- 1359,1388 ---- case RosElements::RE_POLYGON: ! { ! ComplexGeom geom(CG_Polygon); ! if (! ReadComplexGeom(element, geom)) ! { ! return false; ! } ! GetLog()->Debug() << "(RosImporter) read polygon with " ! << geom.vertices.size() << " vertices\n"; ! geomList.push_back(geom); ! break; ! } ! ! case RosElements::RE_TRIANGLESTRIP: ! { ! ComplexGeom geom(CG_TriangleStrip); ! if (! ReadComplexGeom(element, geom)) ! { ! return false; ! } ! ! GetLog()->Debug() << "(RosImporter) read triangle strip with " ! << geom.vertices.size() << " vertices\n"; ! geomList.push_back(geom); ! break; ! } } } *************** *** 1313,1314 **** --- 1425,1685 ---- return true; } + + void RosImporter::BuildTriMesh(shared_ptr<TriMesh> mesh, TVertexList& vertexList, + const TComplexGeomList& geomList, const Appearance& appear) + { + GetLog()->Debug() << "(RosImporter) building trimesh for " << mesh->GetName() << "\n"; + mesh->SetPos(vertexList.GetPos(), vertexList.GetPosCount()); + + shared_ptr<IndexBuffer> ibuffer(new IndexBuffer); + IndexBuffer& ibufferRef = (*ibuffer); + + // build triangles + for ( + TComplexGeomList::const_iterator iter = geomList.begin(); + iter != geomList.end(); + ++iter + ) + { + const ComplexGeom& geom = (*iter); + + switch (geom.type) + { + default: + continue; + + case CG_Polygon: + BuildPolygon(ibufferRef, vertexList, geom); + break; + } + } + + mesh->AddFace(ibuffer,appear.ref); + } + + void RosImporter::BuildPolygon(IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom) + { + int nVerts = static_cast<int>(geom.vertices.size()); + int j = (nVerts - 2); + + for (int i = 0;i<j;++i) + { + ibuffer.Cache(vertexList.GetIndex(geom.vertices[0])); + ibuffer.Cache(vertexList.GetIndex(geom.vertices[i+1])); + ibuffer.Cache(vertexList.GetIndex(geom.vertices[i+2])); + } + } + + bool RosImporter::ReadPhysicalRep(shared_ptr<Transform> transform, TiXmlElement* element, ENodeContext context) + { + TiXmlElement* physicalRep = GetFirstChild(element, RosElements::RE_PHYSICALREPRESENTATION); + if (physicalRep == 0) + { + string name = S_UNNAMED; + ReadAttribute(element, RA_NAME, name, true); + + GetLog()->Error() << "(RosImporter) ERROR: missing physical representation in " + << GetXMLPath(element) << " name " << name << " \n"; + + return false; + } + + // we currently read only the first physical representation of the + // complex shape and use its translation to modify the parent + // transform under which the static mesh is registered. TODO: + // figure out how to align the graphical representation with the + // physical representation if more than one geom is present + + for ( + TiXmlNode* node = physicalRep->FirstChild(); + node != 0; + node = physicalRep->IterateChildren(node) + ) + { + if (IgnoreNode(node)) + { + continue; + } + + TiXmlElement* element = static_cast<TiXmlElement*>(node); + + RosElements::ERosElement type = GetType(element); + switch (type) + { + default: + GetLog()->Error() << "(RosImporter::ReadPhysicalRep) ERROR: skipping unknown element " + << GetXMLPath(element) << "\n"; + break; + + case RosElements::RE_SIMPLEBOX: + return ReadSimpleBox(transform, element, context); + + case RosElements::RE_SIMPLESPHERE: + return ReadSimpleSphere(transform, element, context); + + case RosElements::RE_SIMPLECYLINDER: + //! simulate cylinder with a capped cylinder + case RosElements::RE_SIMPLECAPPEDCYLINDER: + return ReadSimpleCappedCylinder(transform, element, context); + + + // RE_SIMPLECYLINDER, + // RE_SIMPLECAPPEDCYLINDER, + + } + } + + GetLog()->Debug() << "(RosImporter) read physical representation\n"; + + return true; + } + + bool RosImporter::ReadSimpleBox(shared_ptr<Transform> transform, TiXmlElement* element, ENodeContext context) + { + string name; + double length; + double width; + double height; + Trans trans; + Physical physical; + + if ( + (! ReadAttribute(element, RA_NAME, name, true)) || + (! ReadAttribute(element, RA_LENGTH, length)) || + (! ReadAttribute(element, RA_WIDTH, width)) || + (! ReadAttribute(element, RA_HEIGHT, height)) || + (! ReadTrans(element, trans)) || + (! ReadPhysical(element, physical, context)) + ) + { + return false; + } + + // transform + ApplyTransform(transform, trans); + Vector3f boxDim = Vector3f(length, width, height); + + if (HasBody(physical, context)) + { + shared_ptr<Body> body = shared_dynamic_cast<Body> + (GetCore()->New("/oxygen/Body")); + + transform->AddChildReference(body); + + body->SetName(S_BODY+name); + body->SetBoxTotal(physical.mass, boxDim); + //! TODO: set mass center + } + + // geometry + shared_ptr<BoxCollider> collider = shared_dynamic_cast<BoxCollider> + (GetCore()->New("/oxygen/BoxCollider")); + + transform->AddChildReference(collider); + collider->SetName(S_GEOM+name); + collider->SetBoxLengths(boxDim); + + // collision handler + shared_ptr<ContactJointHandler> handler = CreateContactJointHandler(); + collider->AddChildReference(handler); + + GetLog()->Debug() << "(RosImporter) created simple box " << name << "\n"; + return true; + } + + bool RosImporter::ReadSimpleSphere(shared_ptr<Transform> transform, TiXmlElement* element, ENodeContext context) + { + string name; + double radius; + Trans trans; + Physical physical; + + if ( + (! ReadAttribute(element, RA_NAME, name, true)) || + (! ReadAttribute(element, RA_RADIUS, radius)) || + (! ReadTrans(element, trans)) || + (! ReadPhysical(element, physical, context)) + ) + { + return false; + } + + // transform + ApplyTransform(transform, trans); + + if (HasBody(physical, context)) + { + shared_ptr<Body> body = shared_dynamic_cast<Body> + (GetCore()->New("/oxygen/Body")); + + transform->AddChildReference(body); + + body->SetName(S_BODY+name); + body->SetSphereTotal(physical.mass, radius); + //! TODO: set mass center + } + + // geometry + shared_ptr<SphereCollider> collider = shared_dynamic_cast<SphereCollider> + (GetCore()->New("/oxygen/SphereCollider")); + + transform->AddChildReference(collider); + collider->SetRadius(radius); + + // collision handler + shared_ptr<ContactJointHandler> handler = CreateContactJointHandler(); + collider->AddChildReference(handler); + + GetLog()->Debug() << "(RosImporter) created simple sphere " << name << "\n"; + return true; + } + + bool RosImporter::ReadSimpleCappedCylinder(shared_ptr<Transform> transform, TiXmlElement* element, ENodeContext context) + { + string name; + double radius; + double height; + Trans trans; + Physical physical; + + if ( + (! ReadAttribute(element, RA_NAME, name, true)) || + (! ReadAttribute(element, RA_RADIUS, radius)) || + (! ReadAttribute(element, RA_HEIGHT, height)) || + (! ReadTrans(element, trans)) || + (! ReadPhysical(element, physical, context)) + ) + { + return false; + } + + // transform + ApplyTransform(transform, trans); + + if (HasBody(physical, context)) + { + shared_ptr<Body> body = shared_dynamic_cast<Body> + (GetCore()->New("/oxygen/Body")); + + transform->AddChildReference(body); + + body->SetName(S_BODY+name); + body->SetCappedCylinderTotal(physical.mass, radius, height); + //! TODO: set mass center + } + + // geometry + shared_ptr<CCylinderCollider> collider = shared_dynamic_cast<CCylinderCollider> + (GetCore()->New("/oxygen/CCylinderCollider")); + collider->SetName(S_GEOM+name); + + transform->AddChildReference(collider); + collider->SetParams(radius, height); + + // collision handler + shared_ptr<ContactJointHandler> handler = CreateContactJointHandler(); + collider->AddChildReference(handler); + + GetLog()->Debug() << "(RosImporter) created simple capped cylinder " << name << "\n"; + return true; + } Index: rosimporter.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rosimporter.h 22 Feb 2006 19:42:07 -0000 1.7 --- rosimporter.h 23 Feb 2006 13:40:23 -0000 1.8 *************** *** 24,28 **** --- 24,30 ---- #include <map> + #include <boost/shared_array.hpp> #include <oxygen/sceneserver/sceneimporter.h> + #include <oxygen/geometryserver/trimesh.h> #include <tinyxml/tinyxml.h> #include "roselements.h" *************** *** 34,38 **** class ContactJointHandler; class Body; ! class TriMesh; } --- 36,40 ---- class ContactJointHandler; class Body; ! class Transform; } *************** *** 93,106 **** typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; /** define a mapping from name to vertex name as defined within a VertexList element */ ! typedef std::map<std::string, salt::Vector3f> TVertexList; /** define a mapping from name to vertex list name */ typedef std::map<std::string, TVertexList> TVertexListMap; ! /** define a list of string references into a vertex list */ ! typedef std::list<std::string> TVertexRefList; /** the possible types of complex geoms that make up a --- 95,142 ---- typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; + struct TVertex + { + public: + //! the vertex data + salt::Vector3f vec; + + //! the index into an associated flat vertex array as used in + //the TriMesh class + int idx; + public: + TVertex() : idx(-1) {} + }; + /** define a mapping from name to vertex name as defined within a VertexList element */ ! typedef std::map<std::string, TVertex> TVertexRef; ! ! struct TVertexList ! { ! protected: ! /** mapping from vertex name to vector and index into the pos ! array ! */ ! TVertexRef vertexRef; ! ! /** flat array of vertices with 3 consecutive floats ! representing a vertex vector ! */ ! boost::shared_array<float> pos; ! ! public: ! const TVertexRef& GetVertexRef() { return vertexRef; } ! void AddVertex(const std::string& name, const TVertex& vertex); ! boost::shared_array<float> GetPos(); ! int GetIndex(const std::string& name); ! int GetPosCount() const { return static_cast<int>(vertexRef.size()); } ! }; /** define a mapping from name to vertex list name */ typedef std::map<std::string, TVertexList> TVertexListMap; ! /** define a vector of string references into a vertex list */ ! typedef std::vector<std::string> TVertexRefVec; /** the possible types of complex geoms that make up a *************** *** 118,122 **** public: EComplexGeom type; ! TVertexRefList vertices; public: --- 154,158 ---- public: EComplexGeom type; ! TVertexRefVec vertices; public: *************** *** 154,157 **** --- 190,195 ---- std::string GetName(RosElements::ERosElement element) const; + void ApplyTransform(boost::shared_ptr<oxygen::Transform> transform, const Trans& trans); + boost::shared_ptr<oxygen::Transform> CreateTransform (boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); *************** *** 201,207 **** bool ReadVertexList(TiXmlElement* element); bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadGraphicalRep(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, oxygen::TriMesh& mesh); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); bool ReadComplexGeom(TiXmlElement* element, ComplexGeom& geom); protected: --- 239,252 ---- bool ReadVertexList(TiXmlElement* element); bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadGraphicalRep(TiXmlElement* element, boost::shared_ptr<oxygen::TriMesh> mesh, const Appearance& appear); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); bool ReadComplexGeom(TiXmlElement* element, ComplexGeom& geom); + void BuildTriMesh(boost::shared_ptr<oxygen::TriMesh> mesh, TVertexList& vertexList, const TComplexGeomList& geomList, const Appearance& appear); + void BuildPolygon(oxygen::IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom); + + bool ReadPhysicalRep(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); + bool ReadSimpleBox(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); + bool ReadSimpleSphere(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); + bool ReadSimpleCappedCylinder(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); protected: |