From: <yx...@us...> - 2009-12-15 11:30:07
|
Revision: 121 http://simspark.svn.sourceforge.net/simspark/?rev=121&view=rev Author: yxu Date: 2009-12-15 11:29:57 +0000 (Tue, 15 Dec 2009) Log Message: ----------- * add accelerometer in the chest of NAO * make some functions const Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg trunk/spark/lib/oxygen/physicsserver/body.cpp trunk/spark/lib/oxygen/physicsserver/body.h trunk/spark/lib/oxygen/physicsserver/odeobject.cpp trunk/spark/lib/oxygen/physicsserver/odeobject.h trunk/spark/lib/oxygen/sceneserver/basenode.cpp trunk/spark/lib/oxygen/sceneserver/basenode.h trunk/spark/plugin/CMakeLists.txt Added Paths: ----------- trunk/spark/plugin/accelerometer/ trunk/spark/plugin/accelerometer/CMakeLists.txt trunk/spark/plugin/accelerometer/accelerometer.cpp trunk/spark/plugin/accelerometer/accelerometer.h trunk/spark/plugin/accelerometer/accelerometer_c.cpp trunk/spark/plugin/accelerometer/export.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-15 11:29:57 UTC (rev 121) @@ -71,6 +71,7 @@ ) (nd GyroRatePerceptor (setName torso)) + (nd Accelerometer (setName torso)) ;(nd HMDPPerceptor) ;(nd HMDPEffector) Modified: trunk/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/body.cpp 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/physicsserver/body.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -18,6 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "salt/tvector.h" + + #include "body.h" #include "world.h" #include "../sceneserver/scene.h" @@ -413,6 +416,15 @@ return Vector3f(vel[0], vel[1], vel[2]); } +Vector3f +Body::GetLocalAngularVelocity() const +{ + const dReal* vel = dBodyGetAngularVel(mODEBody); + Vector3f w; + dBodyVectorFromWorld(mODEBody, vel[0], vel[1], vel[2], w.GetData()); + return w; +} + void Body::SetAngularVelocity(const Vector3f& vel) { @@ -531,6 +543,12 @@ dBodyAddForce(mODEBody, force.x(), force.y(), force.z()); } +Vector3f Body::GetForce() const +{ + const dReal* f = dBodyGetForce(mODEBody); + return Vector3f(f[0], f[1], f[2]); +} + void Body::AddTorque(const Vector3f& torque) { Modified: trunk/spark/lib/oxygen/physicsserver/body.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/body.h 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/physicsserver/body.h 2009-12-15 11:29:57 UTC (rev 121) @@ -205,6 +205,9 @@ /** gets the rotation of this body */ salt::Matrix GetRotation() const; + /** returns the current angular velocity of this body in local coordination */ + salt::Vector3f GetLocalAngularVelocity() const; + /** returns the current angular velocity of this body */ salt::Vector3f GetAngularVelocity() const; @@ -217,6 +220,9 @@ /** applies a force to the managed ODE body */ void AddForce(const salt::Vector3f& force); + /** returns the total force applied to this body */ + salt::Vector3f GetForce() const; + /** aplies a force to the managed ODE body */ void AddTorque(const salt::Vector3f& torque); Modified: trunk/spark/lib/oxygen/physicsserver/odeobject.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/odeobject.cpp 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/physicsserver/odeobject.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -42,7 +42,7 @@ } /** returns the world node */ -shared_ptr<World> ODEObject::GetWorld() +shared_ptr<World> ODEObject::GetWorld() const { shared_ptr<Scene> scene = GetScene(); if (scene.get() == 0) Modified: trunk/spark/lib/oxygen/physicsserver/odeobject.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/odeobject.h 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/physicsserver/odeobject.h 2009-12-15 11:29:57 UTC (rev 121) @@ -61,10 +61,10 @@ /** destroy the managed ODE object */ virtual void DestroyODEObject() = 0; -protected: /** returns the world node */ - boost::shared_ptr<World> GetWorld(); + boost::shared_ptr<World> GetWorld() const; +protected: /** finds the nearest parent space node */ boost::shared_ptr<Space> GetSpace(); Modified: trunk/spark/lib/oxygen/sceneserver/basenode.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -141,7 +141,7 @@ } } -shared_ptr<Scene> BaseNode::GetScene() +shared_ptr<Scene> BaseNode::GetScene() const { // is this node the scene node ? shared_ptr<Scene> self = Modified: trunk/spark/lib/oxygen/sceneserver/basenode.h =================================================================== --- trunk/spark/lib/oxygen/sceneserver/basenode.h 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/lib/oxygen/sceneserver/basenode.h 2009-12-15 11:29:57 UTC (rev 121) @@ -96,7 +96,7 @@ void UpdateHierarchy(); /** moves up the hierarchy, until it finds a scene */ - boost::shared_ptr<Scene> GetScene(); + boost::shared_ptr<Scene> GetScene() const; /** enables debug mode controls */ void EnableDebugMode(); Modified: trunk/spark/plugin/CMakeLists.txt =================================================================== --- trunk/spark/plugin/CMakeLists.txt 2009-12-14 11:14:38 UTC (rev 120) +++ trunk/spark/plugin/CMakeLists.txt 2009-12-15 11:29:57 UTC (rev 121) @@ -9,6 +9,7 @@ set(spark_libs ${spark_libs} /System/Library/Frameworks/CoreFoundation.framework) endif (APPLE AND USE_COREFOUNDATION) +add_subdirectory(accelerometer) add_subdirectory(filesystemstd) add_subdirectory(filesystemzip) add_subdirectory(forceeffector) Added: trunk/spark/plugin/accelerometer/CMakeLists.txt =================================================================== --- trunk/spark/plugin/accelerometer/CMakeLists.txt (rev 0) +++ trunk/spark/plugin/accelerometer/CMakeLists.txt 2009-12-15 11:29:57 UTC (rev 121) @@ -0,0 +1,16 @@ + +set(accelerometer_LIB_SRCS + export.cpp + accelerometer.h + accelerometer.cpp + accelerometer_c.cpp +) + +add_library(accelerometer MODULE ${accelerometer_LIB_SRCS}) + +target_link_libraries(accelerometer ${spark_libs} ${Boost_LIBRARIES}) + +set_target_properties(accelerometer PROPERTIES VERSION 0.0.0 SOVERSION 0) +if (NOT APPLE) + install(TARGETS accelerometer DESTINATION ${LIBDIR}/${CMAKE_PROJECT_NAME}) +endif (NOT APPLE) Added: trunk/spark/plugin/accelerometer/accelerometer.cpp =================================================================== --- trunk/spark/plugin/accelerometer/accelerometer.cpp (rev 0) +++ trunk/spark/plugin/accelerometer/accelerometer.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -0,0 +1,93 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 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 "oxygen/physicsserver/world.h" + + +#include "oxygen/physicsserver/body.h" + + +#include "accelerometer.h" +#include <oxygen/sceneserver/transform.h> + +// using namespace kerosin; +using namespace oxygen; +using namespace boost; +using namespace zeitgeist; +using namespace salt; +using namespace std; + +Accelerometer::Accelerometer() : oxygen::Perceptor() +{ +} + +Accelerometer::~Accelerometer() +{ +} + +void Accelerometer::OnLink() +{ + shared_ptr<Transform> transformParent = shared_static_cast<Transform> + (FindParentSupportingClass<Transform>().lock()); + + mBody = shared_static_cast<const Body> + (transformParent->GetChildOfClass("Body")); + + mGravity = mBody->GetWorld()->GetGravity(); + mLastVel = mBody->GetVelocity(); +} + +bool Accelerometer::Percept(boost::shared_ptr<PredicateList> predList) +{ + Predicate &predicate = predList->AddPredicate(); + predicate.name = "ACC"; + predicate.parameter.Clear(); + + ParameterList &nameElement = predicate.parameter.AddList(); + nameElement.AddValue(std::string("n")); + nameElement.AddValue(GetName()); + + ParameterList &ratesElement = predicate.parameter.AddList(); + ratesElement.AddValue(std::string("a")); + ratesElement.AddValue(mAcc.x()); + ratesElement.AddValue(mAcc.y()); + ratesElement.AddValue(mAcc.z()); + + return true; +} + +void Accelerometer::PrePhysicsUpdateInternal(float deltaTime) +{ +// Vector3f F = mBody->GetForce(); +// float mass = mBody->GetMass(); +// mAcc = F / mass - mGravity; + + Vector3f vel = mBody->GetVelocity(); + Vector3f acc = (vel - mLastVel) / deltaTime; + acc -= mGravity; + + Matrix invRot = mBody->GetRotation(); + invRot.InvertRotationMatrix(); + acc = invRot * acc; + + float k = 0.9; + mAcc = k*mAcc + (1-k)*acc; + mLastVel = vel; +} Added: trunk/spark/plugin/accelerometer/accelerometer.h =================================================================== --- trunk/spark/plugin/accelerometer/accelerometer.h (rev 0) +++ trunk/spark/plugin/accelerometer/accelerometer.h 2009-12-15 11:29:57 UTC (rev 121) @@ -0,0 +1,49 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 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. + */ + +#ifndef ACCELEROMETER_H +#define ACCELEROMETER_H + +#include <oxygen/agentaspect/perceptor.h> +#include <oxygen/physicsserver/body.h> + +class Accelerometer : public oxygen::Perceptor { +public: + Accelerometer(); + virtual ~Accelerometer(); + + //! \return true, if valid data is available and false otherwise. + bool Percept(boost::shared_ptr<oxygen::PredicateList> predList); + + virtual void OnLink(); + +protected: + virtual void PrePhysicsUpdateInternal(float deltaTime); + +private: + boost::shared_ptr<const oxygen::Body> mBody; + salt::Vector3f mAcc; + salt::Vector3f mGravity; + salt::Vector3f mLastVel; +}; + +DECLARE_CLASS(Accelerometer); + +#endif //ACCELEROMETER_H Added: trunk/spark/plugin/accelerometer/accelerometer_c.cpp =================================================================== --- trunk/spark/plugin/accelerometer/accelerometer_c.cpp (rev 0) +++ trunk/spark/plugin/accelerometer/accelerometer_c.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -0,0 +1,29 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 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 "accelerometer.h" + +using namespace boost; +using namespace oxygen; + +void CLASS(Accelerometer)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Perceptor); +} Added: trunk/spark/plugin/accelerometer/export.cpp =================================================================== --- trunk/spark/plugin/accelerometer/export.cpp (rev 0) +++ trunk/spark/plugin/accelerometer/export.cpp 2009-12-15 11:29:57 UTC (rev 121) @@ -0,0 +1,26 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008 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 "accelerometer.h" +#include <zeitgeist/zeitgeist.h> + +ZEITGEIST_EXPORT_BEGIN() + ZEITGEIST_EXPORT(Accelerometer); +ZEITGEIST_EXPORT_END() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2009-12-17 22:21:57
|
Revision: 124 http://simspark.svn.sourceforge.net/simspark/?rev=124&view=rev Author: sgvandijk Date: 2009-12-17 22:21:49 +0000 (Thu, 17 Dec 2009) Log Message: ----------- - Render transparent objects after solid objects - Comment out Accelerometer for now Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg trunk/spark/lib/kerosin/renderserver/rendernode.cpp trunk/spark/lib/kerosin/renderserver/rendernode.h trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp trunk/spark/lib/kerosin/renderserver/renderserver.cpp trunk/spark/lib/kerosin/renderserver/renderserver.h trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg 2009-12-17 22:21:49 UTC (rev 124) @@ -46,9 +46,10 @@ (setLocalPos $GoalHalfDepth 0.0 (eval -1 * $GoalHalfHeight)) (setLocalRotation 90 90 0) (nd StaticMesh - (load $GoalObj) - (setScale $ObjWidth $ObjWidth $ObjWidth) - ) + (load $GoalObj) + (setScale $ObjWidth $ObjWidth $ObjWidth) + (setTransparent) + ) ) ;; create the left goal post Modified: trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-17 22:21:49 UTC (rev 124) @@ -71,7 +71,7 @@ ) (nd GyroRatePerceptor (setName torso)) - (nd Accelerometer (setName torso)) + ;(nd Accelerometer (setName torso)) ;(nd HMDPPerceptor) ;(nd HMDPEffector) Modified: trunk/spark/lib/kerosin/renderserver/rendernode.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode.cpp 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/renderserver/rendernode.cpp 2009-12-17 22:21:49 UTC (rev 124) @@ -26,10 +26,16 @@ using namespace kerosin; RenderNode::RenderNode() - : BaseNode() + : BaseNode(), + mTransparent(false) { } RenderNode::~RenderNode() { } + +void RenderNode::SetTransparent() +{ + mTransparent = true; +} Modified: trunk/spark/lib/kerosin/renderserver/rendernode.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode.h 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/renderserver/rendernode.h 2009-12-17 22:21:49 UTC (rev 124) @@ -42,6 +42,11 @@ /** renders the node */ virtual void RenderInternal() = 0; + + bool IsTransparent() { return mTransparent; } + void SetTransparent(); +private: + bool mTransparent; }; DECLARE_ABSTRACTCLASS(RenderNode); Modified: trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp 2009-12-17 22:21:49 UTC (rev 124) @@ -23,7 +23,14 @@ using namespace kerosin; +FUNCTION(RenderNode,setTransparent) +{ + obj->SetTransparent(); + return true; +} + void CLASS(RenderNode)::DefineClass() { DEFINE_BASECLASS(oxygen/BaseNode); + DEFINE_FUNCTION(setTransparent); } Modified: trunk/spark/lib/kerosin/renderserver/renderserver.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2009-12-17 22:21:49 UTC (rev 124) @@ -123,7 +123,8 @@ } // standard rendering - RenderScene(mActiveScene); + RenderScene(mActiveScene, 0); + RenderScene(mActiveScene, 1); // reset GL lights glDisable(GL_LIGHTING); @@ -244,7 +245,7 @@ } void -RenderServer::RenderScene(boost::shared_ptr<BaseNode> node) +RenderServer::RenderScene(boost::shared_ptr<BaseNode> node, unsigned pass) { #if 0 shared_ptr<SphereCollider> collider = shared_dynamic_cast<SphereCollider>(node); @@ -254,7 +255,9 @@ } #endif shared_ptr<RenderNode> renderNode = shared_dynamic_cast<RenderNode>(node); - if (renderNode.get() != 0) + if (renderNode.get() != 0 && + ((pass == 0 && !renderNode->IsTransparent()) || (pass == 1 && renderNode->IsTransparent())) + ) { glPushMatrix(); @@ -268,7 +271,7 @@ glMultMatrixf(node->GetWorldTransform().m); - renderNode->RenderInternal(); + renderNode->RenderInternal(); if (mEnablePicking) { @@ -294,7 +297,7 @@ continue; } - RenderScene(node); + RenderScene(node, pass); } } Modified: trunk/spark/lib/kerosin/renderserver/renderserver.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.h 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/renderserver/renderserver.h 2009-12-17 22:21:49 UTC (rev 124) @@ -105,7 +105,7 @@ /** render a scene recursively. \param node the scene base node */ - void RenderScene(boost::shared_ptr<oxygen::BaseNode> node); + void RenderScene(boost::shared_ptr<oxygen::BaseNode> node, unsigned pass); /** sets the OpenGl view parameters for a camera */ Modified: trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp =================================================================== --- trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp 2009-12-17 22:21:49 UTC (rev 124) @@ -144,6 +144,12 @@ return true; } +FUNCTION(RenderNode,setTransparent) +{ + obj->SetTransparent(); + return true; +} + void CLASS(StaticMesh)::DefineClass() { DEFINE_BASECLASS(oxygen/BaseNode); @@ -154,4 +160,5 @@ DEFINE_FUNCTION(setExternalMeshName) DEFINE_FUNCTION(setExternalMeshScale) DEFINE_FUNCTION(resetMaterials) + DEFINE_FUNCTION(setTransparent); } Modified: trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2009-12-17 08:11:25 UTC (rev 123) +++ trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2009-12-17 22:21:49 UTC (rev 124) @@ -249,6 +249,11 @@ ss << "(nd StaticMesh"; } + if (mesh->IsTransparent()) + { + ss << " (setTransparent)"; + } + ss << " (load " << mesh->GetMeshName(); const ParameterList& params = mesh->GetMeshParameter(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2009-12-18 13:01:43
|
Revision: 126 http://simspark.svn.sourceforge.net/simspark/?rev=126&view=rev Author: yxu Date: 2009-12-18 13:01:31 +0000 (Fri, 18 Dec 2009) Log Message: ----------- * fix for double precision in spark/lib/oxygen/physicsserver/body.cpp * fix for Accelerometer in spark/spark/spark.rb * enable Accelerometer in rcssserver3d/data/rsg/agent/nao/nao.rsg again ;) Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg trunk/spark/lib/oxygen/physicsserver/body.cpp trunk/spark/spark/spark.rb Modified: trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-18 06:24:13 UTC (rev 125) +++ trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2009-12-18 13:01:31 UTC (rev 126) @@ -71,7 +71,7 @@ ) (nd GyroRatePerceptor (setName torso)) - ;(nd Accelerometer (setName torso)) + (nd Accelerometer (setName torso)) ;(nd HMDPPerceptor) ;(nd HMDPEffector) Modified: trunk/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/body.cpp 2009-12-18 06:24:13 UTC (rev 125) +++ trunk/spark/lib/oxygen/physicsserver/body.cpp 2009-12-18 13:01:31 UTC (rev 126) @@ -420,9 +420,9 @@ Body::GetLocalAngularVelocity() const { const dReal* vel = dBodyGetAngularVel(mODEBody); - Vector3f w; - dBodyVectorFromWorld(mODEBody, vel[0], vel[1], vel[2], w.GetData()); - return w; + dReal w[3]; + dBodyVectorFromWorld(mODEBody, vel[0], vel[1], vel[2], w); + return Vector3f(w[0],w[1],w[2]); } void Modified: trunk/spark/spark/spark.rb =================================================================== --- trunk/spark/spark/spark.rb 2009-12-18 06:24:13 UTC (rev 125) +++ trunk/spark/spark/spark.rb 2009-12-18 13:01:31 UTC (rev 126) @@ -613,3 +613,6 @@ # importBundle "collisionperceptor" + +# +importBundle "accelerometer" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-01-10 09:14:41
|
Revision: 139 http://simspark.svn.sourceforge.net/simspark/?rev=139&view=rev Author: hedayat Date: 2010-01-10 09:14:25 +0000 (Sun, 10 Jan 2010) Log Message: ----------- Fixed goal net visualization introduced in the previous commit A small fix in the release notes remove eclipse project files from rsgedit which was accidently committed Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/data/models/leftgoal.obj trunk/rcssserver3d/data/models/rightgoal.obj trunk/spark/RELEASE Removed Paths: ------------- trunk/rsgedit/.cproject trunk/rsgedit/.project Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2010-01-08 07:35:25 UTC (rev 138) +++ trunk/rcssserver3d/ChangeLog 2010-01-10 09:14:25 UTC (rev 139) @@ -1,3 +1,9 @@ +2010-01-09 Hedayat Vatankhah <he...@gr...> + + * data/models/leftgoal.obj: + * data/models/rightgoal.obj: + - fixed net visualization in the new models + 2010-01-03 Hedayat Vatankhah <he...@gr...> * data/models/leftgoal.obj: Modified: trunk/rcssserver3d/data/models/leftgoal.obj =================================================================== --- trunk/rcssserver3d/data/models/leftgoal.obj 2010-01-08 07:35:25 UTC (rev 138) +++ trunk/rcssserver3d/data/models/leftgoal.obj 2010-01-10 09:14:25 UTC (rev 139) @@ -1,235 +1,247 @@ # Blender3D v249 OBJ File: # www.blender3d.org mtllib leftgoal.mtl -o leftgoal +o Cylinder +v -0.466661 -0.000000 -0.006727 +v -0.435928 0.000000 0.031272 +v -0.439036 0.000000 0.048194 +v 0.469231 0.001554 -0.881690 +v 0.467925 1.000000 -0.096621 +v 0.467925 0.000247 -0.096621 +v -0.463784 0.001554 -0.895139 +v -0.465090 0.000247 -0.110069 +v -0.465090 1.000000 -0.110069 +v -0.463784 0.001554 -0.895139 +v -0.465090 1.000000 -0.110069 +v -0.465090 0.000247 -0.110069 +v 0.469231 0.001554 -0.881690 +v 0.467925 0.000247 -0.096621 +v 0.467925 1.000000 -0.096621 +v 0.469231 0.001554 -0.881690 +v 0.467925 1.000000 -0.096621 +v -0.465090 1.000000 -0.110069 +v -0.463784 0.001554 -0.895139 +v 0.469231 0.001554 -0.881690 +v 0.467925 1.000000 -0.096621 +v 0.466661 0.000000 0.006727 v 0.490346 -0.000000 -0.062326 v 0.494467 -0.000000 -0.047393 +v 0.466661 0.997179 0.006727 +v 0.494467 0.997179 -0.047393 +v 0.490346 0.997179 -0.062326 v 0.497519 -0.000000 -0.030383 +v 0.497519 0.997179 -0.030383 v 0.499385 -0.000000 -0.011947 +v 0.499385 0.997179 -0.011947 v 0.499994 0.000000 0.007207 +v 0.499994 0.997179 0.007207 v 0.499322 0.000000 0.026343 +v 0.499322 0.997179 0.026343 v 0.497394 0.000000 0.044726 +v 0.497394 0.997179 0.044726 v 0.494286 0.000000 0.061645 +v 0.494286 0.997179 0.061645 v 0.490116 0.000000 0.076457 +v 0.490116 0.997179 0.076457 v 0.485044 0.000000 0.088589 +v 0.485044 0.997179 0.088589 v 0.479266 0.000000 0.097575 +v 0.479266 0.997179 0.097575 v 0.473004 0.000000 0.103068 +v 0.473004 0.997179 0.103068 v 0.466498 0.000000 0.104861 +v 0.466498 0.997179 0.104861 v 0.459998 0.000000 0.102880 +v 0.459998 0.997179 0.102880 v 0.453754 0.000000 0.097207 +v 0.453754 0.997179 0.097207 v 0.448007 0.000000 0.088054 +v 0.448007 0.997179 0.088057 v 0.442976 0.000000 0.075777 +v 0.442976 0.997179 0.075777 v 0.438855 0.000000 0.060848 +v 0.438855 0.997179 0.060848 v 0.435803 0.000000 0.043837 +v 0.435803 0.997179 0.043837 v 0.433937 0.000000 0.025401 +v 0.433937 0.997179 0.025401 v 0.433328 0.000000 0.006247 +v 0.433328 0.997179 0.006247 v 0.434000 -0.000000 -0.012889 +v 0.434000 0.997179 -0.012889 v 0.435928 -0.000000 -0.031272 +v 0.435928 0.997179 -0.031272 v 0.439036 -0.000000 -0.048194 +v 0.439036 0.997179 -0.048194 v 0.443207 -0.000000 -0.063006 +v 0.443206 0.997179 -0.063003 v 0.448278 -0.000000 -0.075135 +v 0.448278 0.997179 -0.075135 v 0.454056 -0.000000 -0.084120 +v 0.454056 0.997179 -0.084120 v 0.460318 -0.000000 -0.089614 +v 0.460318 0.997179 -0.089614 v 0.466824 -0.000000 -0.091407 +v 0.466824 0.997179 -0.091407 v 0.473324 -0.000000 -0.089428 +v 0.473324 0.997179 -0.089429 v 0.479568 -0.000000 -0.083752 +v 0.479568 0.997179 -0.083752 v 0.485316 -0.000000 -0.074602 -v 0.490346 0.997179 -0.062326 -v 0.494467 0.997179 -0.047393 -v 0.497519 0.997179 -0.030383 -v 0.499385 0.997179 -0.011947 -v 0.499994 0.997179 0.007207 -v 0.499322 0.997179 0.026343 -v 0.497394 0.997179 0.044726 -v 0.494286 0.997179 0.061645 -v 0.490116 0.997179 0.076457 -v 0.485044 0.997179 0.088589 -v 0.479266 0.997179 0.097575 -v 0.473004 0.997179 0.103068 -v 0.466498 0.997179 0.104861 -v 0.459998 0.997179 0.102880 -v 0.453754 0.997179 0.097207 -v 0.448007 0.997179 0.088057 -v 0.442976 0.997179 0.075777 -v 0.438855 0.997179 0.060848 -v 0.435803 0.997179 0.043837 -v 0.433937 0.997179 0.025401 -v 0.433328 0.997179 0.006247 -v 0.434000 0.997179 -0.012889 -v 0.435928 0.997179 -0.031272 -v 0.439036 0.997179 -0.048194 -v 0.443206 0.997179 -0.063003 -v 0.448278 0.997179 -0.075135 -v 0.454056 0.997179 -0.084120 -v 0.460318 0.997179 -0.089614 -v 0.466824 0.997179 -0.091407 -v 0.473324 0.997179 -0.089429 -v 0.479568 0.997179 -0.083752 v 0.485315 0.997179 -0.074602 -v 0.466661 0.000000 0.006727 -v 0.466661 0.997179 0.006727 v -0.466661 0.997179 -0.006727 -v -0.466661 -0.000000 -0.006727 +v -0.442976 0.997179 -0.075777 v -0.448007 0.997179 -0.088057 +v -0.448007 -0.000000 -0.088054 +v -0.442976 -0.000000 -0.075777 v -0.453755 0.997179 -0.097207 +v -0.453754 -0.000000 -0.097207 v -0.459998 0.997179 -0.102883 +v -0.459998 -0.000000 -0.102880 v -0.466498 0.997179 -0.104861 +v -0.466498 -0.000000 -0.104861 v -0.473004 0.997179 -0.103068 +v -0.473004 -0.000000 -0.103068 v -0.479266 0.997179 -0.097575 +v -0.479266 -0.000000 -0.097575 v -0.485044 0.997179 -0.088589 +v -0.485044 -0.000000 -0.088589 v -0.490116 0.997179 -0.076457 +v -0.490116 -0.000000 -0.076457 v -0.494286 0.997179 -0.061646 +v -0.494286 -0.000000 -0.061645 v -0.497394 0.997179 -0.044723 +v -0.497394 -0.000000 -0.044726 v -0.499322 0.997179 -0.026343 +v -0.499322 -0.000000 -0.026343 v -0.499994 0.997179 -0.007207 +v -0.499994 -0.000000 -0.007207 v -0.499385 0.997179 0.011947 +v -0.499385 0.000000 0.011947 v -0.497519 0.997179 0.030383 +v -0.497519 0.000000 0.030383 v -0.494467 0.997179 0.047393 +v -0.494467 0.000000 0.047393 v -0.490346 0.997179 0.062326 +v -0.490346 0.000000 0.062326 v -0.485315 0.997179 0.074602 +v -0.485316 0.000000 0.074602 v -0.479568 0.997179 0.083752 +v -0.479568 0.000000 0.083752 v -0.473324 0.997179 0.089428 +v -0.473324 0.000000 0.089428 v -0.466824 0.997179 0.091407 +v -0.466824 0.000000 0.091407 v -0.460318 0.997179 0.089614 +v -0.460318 0.000000 0.089614 v -0.454056 0.997179 0.084120 +v -0.454056 0.000000 0.084120 v -0.448278 0.997179 0.075135 +v -0.448278 0.000000 0.075135 v -0.443207 0.997179 0.063006 +v -0.443207 0.000000 0.063006 v -0.439036 0.997179 0.048194 v -0.435928 0.997179 0.031272 v -0.434000 0.997179 0.012889 +v -0.434000 0.000000 0.012889 v -0.433328 0.997179 -0.006247 +v -0.433328 -0.000000 -0.006247 v -0.433937 0.997179 -0.025401 +v -0.433937 -0.000000 -0.025401 v -0.435803 0.997179 -0.043837 +v -0.435803 -0.000000 -0.043837 v -0.438855 0.997179 -0.060848 -v -0.442976 0.997179 -0.075777 -v -0.448007 -0.000000 -0.088054 -v -0.453754 -0.000000 -0.097207 -v -0.459998 -0.000000 -0.102880 -v -0.466498 -0.000000 -0.104861 -v -0.473004 -0.000000 -0.103068 -v -0.479266 -0.000000 -0.097575 -v -0.485044 -0.000000 -0.088589 -v -0.490116 -0.000000 -0.076457 -v -0.494286 -0.000000 -0.061645 -v -0.497394 -0.000000 -0.044726 -v -0.499322 -0.000000 -0.026343 -v -0.499994 -0.000000 -0.007207 -v -0.499385 0.000000 0.011947 -v -0.497519 0.000000 0.030383 -v -0.494467 0.000000 0.047393 -v -0.490346 0.000000 0.062326 -v -0.485316 0.000000 0.074602 -v -0.479568 0.000000 0.083752 -v -0.473324 0.000000 0.089428 -v -0.466824 0.000000 0.091407 -v -0.460318 0.000000 0.089614 -v -0.454056 0.000000 0.084120 -v -0.448278 0.000000 0.075135 -v -0.443207 0.000000 0.063006 -v -0.439036 0.000000 0.048194 -v -0.435928 0.000000 0.031272 -v -0.434000 0.000000 0.012889 -v -0.433328 -0.000000 -0.006247 -v -0.433937 -0.000000 -0.025401 -v -0.435803 -0.000000 -0.043837 v -0.438855 -0.000000 -0.060848 -v -0.442976 -0.000000 -0.075777 +v -0.465871 0.964236 -0.006715 v -0.465814 0.986271 -0.041411 v -0.465804 0.981550 -0.047514 +v 0.467451 0.964236 0.006739 +v 0.467519 0.981550 -0.034060 +v 0.467508 0.986271 -0.027957 v -0.465796 0.976161 -0.052048 +v 0.467526 0.976161 -0.038594 v -0.465791 0.970316 -0.054839 +v 0.467531 0.970316 -0.041385 v -0.465790 0.964236 -0.055781 +v 0.467532 0.964236 -0.042330 v -0.465791 0.958158 -0.054839 +v 0.467531 0.958158 -0.041385 v -0.465796 0.952311 -0.052048 +v 0.467526 0.952311 -0.038594 v -0.465804 0.946925 -0.047514 +v 0.467519 0.946925 -0.034060 v -0.465814 0.942202 -0.041411 +v 0.467508 0.942202 -0.027957 v -0.465826 0.938326 -0.033974 +v 0.467496 0.938326 -0.020523 v -0.465840 0.935446 -0.025493 +v 0.467482 0.935446 -0.012038 v -0.465855 0.933674 -0.016287 +v 0.467467 0.933674 -0.002835 v -0.465871 0.933074 -0.006715 +v 0.467451 0.933074 0.006739 v -0.465887 0.933674 0.002859 +v 0.467435 0.933674 0.016310 v -0.465903 0.935446 0.012062 +v 0.467420 0.935446 0.025516 v -0.465917 0.938326 0.020544 +v 0.467405 0.938326 0.033998 v -0.465929 0.942202 0.027980 +v 0.467393 0.942202 0.041435 v -0.465939 0.946925 0.034083 +v 0.467383 0.946925 0.047535 v -0.465947 0.952311 0.038617 +v 0.467375 0.952311 0.052071 v -0.465951 0.958158 0.041408 +v 0.467371 0.958158 0.054862 v -0.465953 0.964236 0.042353 +v 0.467369 0.964236 0.055804 v -0.465951 0.970316 0.041408 +v 0.467371 0.970316 0.054862 v -0.465947 0.976161 0.038617 +v 0.467375 0.976161 0.052071 v -0.465939 0.981550 0.034083 +v 0.467383 0.981550 0.047535 v -0.465929 0.986271 0.027980 +v 0.467393 0.986271 0.041435 v -0.465917 0.990147 0.020544 +v 0.467405 0.990147 0.033998 v -0.465903 0.993026 0.012062 +v 0.467420 0.993026 0.025516 v -0.465887 0.994800 0.002859 +v 0.467435 0.994800 0.016310 v -0.465871 0.995399 -0.006715 +v 0.467451 0.995399 0.006739 v -0.465855 0.994800 -0.016287 +v 0.467467 0.994800 -0.002835 v -0.465840 0.993026 -0.025493 +v 0.467482 0.993026 -0.012038 v -0.465826 0.990147 -0.033974 -v 0.467508 0.986271 -0.027957 -v 0.467519 0.981550 -0.034060 -v 0.467526 0.976161 -0.038594 -v 0.467531 0.970316 -0.041385 -v 0.467532 0.964236 -0.042330 -v 0.467531 0.958158 -0.041385 -v 0.467526 0.952311 -0.038594 -v 0.467519 0.946925 -0.034060 -v 0.467508 0.942202 -0.027957 -v 0.467496 0.938326 -0.020523 -v 0.467482 0.935446 -0.012038 -v 0.467467 0.933674 -0.002835 -v 0.467451 0.933074 0.006739 -v 0.467435 0.933674 0.016310 -v 0.467420 0.935446 0.025516 -v 0.467405 0.938326 0.033998 -v 0.467393 0.942202 0.041435 -v 0.467383 0.946925 0.047535 -v 0.467375 0.952311 0.052071 -v 0.467371 0.958158 0.054862 -v 0.467369 0.964236 0.055804 -v 0.467371 0.970316 0.054862 -v 0.467375 0.976161 0.052071 -v 0.467383 0.981550 0.047535 -v 0.467393 0.986271 0.041435 -v 0.467405 0.990147 0.033998 -v 0.467420 0.993026 0.025516 -v 0.467435 0.994800 0.016310 -v 0.467451 0.995399 0.006739 -v 0.467467 0.994800 -0.002835 -v 0.467482 0.993026 -0.012038 v 0.467496 0.990147 -0.020523 -v -0.465871 0.964236 -0.006715 -v 0.467451 0.964236 0.006739 +v -0.458524 0.001554 -0.890770 +v -0.459830 0.498835 -0.105700 v -0.459830 0.000247 -0.105700 -v -0.459830 0.498835 -0.105700 -v -0.458524 0.001554 -0.890770 -v 0.469231 0.001554 -0.881690 -v 0.467925 1.000000 -0.096621 -v 0.467925 0.000247 -0.096621 -v 0.467925 1.000000 -0.096621 -v 0.469231 0.001554 -0.881690 -v -0.463784 0.001554 -0.895139 -v -0.465090 1.000000 -0.110069 -v -0.465090 0.000247 -0.110069 -v -0.465090 1.000000 -0.110069 -v -0.463784 0.001554 -0.895139 -v 0.467925 1.000000 -0.096621 -v 0.469231 0.001554 -0.881690 -v -0.465090 0.000247 -0.110069 -v -0.465090 1.000000 -0.110069 -v -0.463784 0.001554 -0.895139 v -0.465191 0.001554 -0.890770 +v -0.466496 0.000247 -0.105700 v -0.466496 0.498835 -0.105700 -v -0.466496 0.000247 -0.105700 v 0.474809 0.001554 -0.890770 v 0.473504 0.498835 -0.105700 v 0.473504 0.000247 -0.105700 v 0.468143 0.001554 -0.890770 +v 0.466837 0.000247 -0.105700 v 0.466837 0.498835 -0.105700 -v 0.466837 0.000247 -0.105700 -v 0.469231 0.001554 -0.881690 -v 0.467925 1.000000 -0.096621 -v 0.467925 0.000247 -0.096621 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.478737 0.520656 +vt 0.239368 1.000000 +vt 0.239368 0.520028 +vt 0.239368 0.520656 +vt 0.000000 0.520028 +vt 0.812878 0.000000 +vt 0.812878 0.520028 +vt 0.000000 0.520027 +vt 1.000000 1.000000 vn -0.000000 -1.000000 0.000000 vn 0.999999 0.000000 0.001664 vn -0.999999 -0.000000 -0.001664 @@ -428,400 +440,400 @@ vn 0.963964 -0.000000 -0.266033 usemtl grey_naogoalnet.png s off -f 68//1 126//1 125//1 -f 206//2 205//2 204//2 -f 207//3 209//3 208//3 -f 216//2 215//2 214//2 -f 226//3 228//3 227//3 -f 213//4 212//4 210//4 -f 213//4 210//4 211//4 -f 202//5 207//5 208//5 -f 202//5 208//5 203//5 +f 1/1/1 2/2/1 3/3/1 +f 4/4/2 5/5/2 6/6/2 +f 7/7/3 8/8/3 9/1/3 +f 10/7/2 11/1/2 12/8/2 +f 13/4/3 14/6/3 15/5/3 +f 16/9/4 17/10/4 18/11/4 +f 16/9/4 18/11/4 19/2/4 +f 20/9/5 7/2/5 9/11/5 +f 20/9/5 9/11/5 21/10/5 usemtl yellow -f 65//1 1//1 2//1 -f 66//6 34//6 33//6 -f 65//1 2//1 3//1 -f 66//6 35//6 34//6 -f 65//1 3//1 4//1 -f 66//6 36//6 35//6 -f 65//1 4//1 5//1 -f 66//6 37//6 36//6 -f 65//1 5//1 6//1 -f 66//6 38//6 37//6 -f 65//1 6//1 7//1 -f 66//6 39//6 38//6 -f 65//1 7//1 8//1 -f 66//6 40//6 39//6 -f 65//1 8//1 9//1 -f 66//6 41//6 40//6 -f 65//1 9//1 10//1 -f 66//6 42//6 41//6 -f 65//1 10//1 11//1 -f 66//6 43//6 42//6 -f 65//1 11//1 12//1 -f 66//6 44//6 43//6 -f 65//1 12//1 13//1 -f 66//6 45//6 44//6 -f 65//1 13//1 14//1 -f 66//6 46//6 45//6 -f 65//1 14//1 15//1 -f 66//6 47//6 46//6 -f 65//1 15//1 16//1 -f 66//6 48//6 47//6 -f 65//1 16//1 17//1 -f 66//6 49//6 48//6 -f 65//1 17//1 18//1 -f 66//6 50//6 49//6 -f 65//1 18//1 19//1 -f 66//6 51//6 50//6 -f 65//1 19//1 20//1 -f 66//6 52//6 51//6 -f 65//1 20//1 21//1 -f 66//6 53//6 52//6 -f 65//1 21//1 22//1 -f 66//6 54//6 53//6 -f 65//1 22//1 23//1 -f 66//6 55//6 54//6 -f 65//1 23//1 24//1 -f 66//6 56//6 55//6 -f 65//1 24//1 25//1 -f 66//6 57//6 56//6 -f 65//1 25//1 26//1 -f 66//6 58//6 57//6 -f 65//1 26//1 27//1 -f 66//6 59//6 58//6 -f 65//1 27//1 28//1 -f 66//6 60//6 59//6 -f 65//1 28//1 29//1 -f 66//6 61//6 60//6 -f 65//1 29//1 30//1 -f 66//6 62//6 61//6 -f 65//1 30//1 31//1 -f 66//6 63//6 62//6 -f 65//1 31//1 32//1 -f 66//6 64//6 63//6 -f 32//1 1//1 65//1 -f 66//6 33//6 64//6 -f 67//6 100//6 69//6 -f 68//1 101//1 132//1 -f 67//6 69//6 70//6 -f 68//1 102//1 101//1 -f 67//6 70//6 71//6 -f 68//1 103//1 102//1 -f 67//6 71//6 72//6 -f 68//1 104//1 103//1 -f 67//6 72//6 73//6 -f 68//1 105//1 104//1 -f 67//6 73//6 74//6 -f 68//1 106//1 105//1 -f 67//6 74//6 75//6 -f 68//1 107//1 106//1 -f 67//6 75//6 76//6 -f 68//1 108//1 107//1 -f 67//6 76//6 77//6 -f 68//1 109//1 108//1 -f 67//6 77//6 78//6 -f 68//1 110//1 109//1 -f 67//6 78//6 79//6 -f 68//1 111//1 110//1 -f 67//6 79//6 80//6 -f 68//1 112//1 111//1 -f 67//6 80//6 81//6 -f 68//1 113//1 112//1 -f 67//6 81//6 82//6 -f 68//1 114//1 113//1 -f 67//6 82//6 83//6 -f 68//1 115//1 114//1 -f 67//6 83//6 84//6 -f 68//1 116//1 115//1 -f 67//6 84//6 85//6 -f 68//1 117//1 116//1 -f 67//6 85//6 86//6 -f 68//1 118//1 117//1 -f 67//6 86//6 87//6 -f 68//1 119//1 118//1 -f 67//6 87//6 88//6 -f 68//1 120//1 119//1 -f 67//6 88//6 89//6 -f 68//1 121//1 120//1 -f 67//6 89//6 90//6 -f 68//1 122//1 121//1 -f 67//6 90//6 91//6 -f 68//1 123//1 122//1 -f 67//6 91//6 92//6 -f 68//1 124//1 123//1 -f 67//6 92//6 93//6 -f 68//1 125//1 124//1 -f 67//6 93//6 94//6 -f 67//6 94//6 95//6 -f 68//1 127//1 126//1 -f 67//6 95//6 96//6 -f 68//1 128//1 127//1 -f 67//6 96//6 97//6 -f 68//1 129//1 128//1 -f 67//6 97//6 98//6 -f 68//1 130//1 129//1 -f 67//6 98//6 99//6 -f 68//1 131//1 130//1 -f 67//6 99//6 100//6 -f 68//1 132//1 131//1 -f 197//7 133//7 134//7 -f 198//8 166//8 165//8 -f 197//9 134//9 135//9 -f 198//10 167//10 166//10 -f 197//11 135//11 136//11 -f 198//12 168//12 167//12 -f 197//13 136//13 137//13 -f 198//14 169//14 168//14 -f 197//15 137//15 138//15 -f 198//16 170//16 169//16 -f 197//17 138//17 139//17 -f 198//18 171//18 170//18 -f 197//19 139//19 140//19 -f 198//20 172//20 171//20 -f 197//21 140//21 141//21 -f 198//22 173//22 172//22 -f 197//23 141//23 142//23 -f 198//24 174//24 173//24 -f 197//25 142//25 143//25 -f 198//26 175//26 174//26 -f 197//27 143//27 144//27 -f 198//28 176//28 175//28 -f 197//29 144//29 145//29 -f 198//30 177//30 176//30 -f 197//29 145//29 146//29 -f 198//30 178//30 177//30 -f 197//31 146//31 147//31 -f 198//32 179//32 178//32 -f 197//33 147//33 148//33 -f 198//34 180//34 179//34 -f 197//35 148//35 149//35 -f 198//36 181//36 180//36 -f 197//37 149//37 150//37 -f 198//38 182//38 181//38 -f 197//39 150//39 151//39 -f 198//40 183//40 182//40 -f 197//41 151//41 152//41 -f 198//42 184//42 183//42 -f 197//43 152//43 153//43 -f 198//44 185//44 184//44 -f 197//45 153//45 154//45 -f 198//46 186//46 185//46 -f 197//47 154//47 155//47 -f 198//48 187//48 186//48 -f 197//49 155//49 156//49 -f 198//50 188//50 187//50 -f 197//51 156//51 157//51 -f 198//52 189//52 188//52 -f 197//53 157//53 158//53 -f 198//54 190//54 189//54 -f 197//55 158//55 159//55 -f 198//56 191//56 190//56 -f 197//57 159//57 160//57 -f 198//28 192//28 191//28 -f 197//29 160//29 161//29 -f 198//30 193//30 192//30 -f 197//29 161//29 162//29 -f 198//30 194//30 193//30 -f 197//58 162//58 163//58 -f 198//32 195//32 194//32 -f 197//25 163//25 164//25 -f 198//26 196//26 195//26 -f 197//59 164//59 133//59 -f 198//60 165//60 196//60 -f 201//2 200//2 199//2 -f 217//61 219//61 218//61 -f 220//62 221//62 222//62 -f 223//3 225//3 224//3 -f 164//63 196//63 165//63 -f 164//64 165//64 133//64 -f 163//65 195//65 196//65 -f 163//66 196//66 164//66 -f 162//67 194//67 195//67 -f 162//68 195//68 163//68 -f 161//69 193//69 194//69 -f 161//70 194//70 162//70 -f 160//71 192//71 193//71 -f 160//72 193//72 161//72 -f 159//73 191//73 192//73 -f 159//74 192//74 160//74 -f 158//75 190//75 191//75 -f 158//76 191//76 159//76 -f 157//77 189//77 190//77 -f 157//78 190//78 158//78 -f 156//79 188//79 189//79 -f 156//80 189//80 157//80 -f 155//81 187//81 188//81 -f 155//82 188//82 156//82 -f 154//83 186//83 187//83 -f 154//84 187//84 155//84 -f 153//85 185//85 186//85 -f 153//86 186//86 154//86 -f 152//87 184//87 185//87 -f 152//88 185//88 153//88 -f 151//89 183//89 184//89 -f 151//89 184//89 152//89 -f 150//90 182//90 183//90 -f 150//91 183//91 151//91 -f 149//92 181//92 182//92 -f 149//93 182//93 150//93 -f 148//94 180//94 181//94 -f 148//94 181//94 149//94 -f 147//95 179//95 180//95 -f 147//96 180//96 148//96 -f 146//97 178//97 179//97 -f 146//98 179//98 147//98 -f 145//99 177//99 178//99 -f 145//100 178//100 146//100 -f 144//101 176//101 177//101 -f 144//102 177//102 145//102 -f 143//103 175//103 176//103 -f 143//104 176//104 144//104 -f 142//105 174//105 175//105 -f 142//106 175//106 143//106 -f 141//107 173//107 174//107 -f 141//108 174//108 142//108 -f 140//109 172//109 173//109 -f 140//110 173//110 141//110 -f 139//111 171//111 172//111 -f 139//112 172//112 140//112 -f 138//113 170//113 171//113 -f 138//114 171//114 139//114 -f 137//115 169//115 170//115 -f 137//116 170//116 138//116 -f 136//117 168//117 169//117 -f 136//118 169//118 137//118 -f 135//119 167//119 168//119 -f 135//120 168//120 136//120 -f 134//121 166//121 167//121 -f 134//122 167//122 135//122 -f 133//123 165//123 166//123 -f 133//124 166//124 134//124 -f 132//125 100//125 99//125 -f 132//125 99//125 131//125 -f 131//126 99//126 98//126 -f 131//126 98//126 130//126 -f 130//127 98//127 97//127 -f 130//127 97//127 129//127 -f 129//128 97//128 96//128 -f 129//128 96//128 128//128 -f 128//129 96//129 95//129 -f 128//129 95//129 127//129 -f 127//130 95//130 94//130 -f 127//130 94//130 126//130 -f 126//131 94//131 93//131 -f 126//131 93//131 125//131 -f 125//132 93//132 92//132 -f 125//132 92//132 124//132 -f 124//133 92//133 91//133 -f 124//133 91//133 123//133 -f 123//134 91//134 90//134 -f 123//134 90//134 122//134 -f 122//135 90//135 89//135 -f 122//135 89//135 121//135 -f 121//136 89//136 88//136 -f 121//136 88//136 120//136 -f 120//137 88//137 87//137 -f 120//137 87//137 119//137 -f 119//138 87//138 86//138 -f 119//138 86//138 118//138 -f 118//139 86//139 85//139 -f 118//140 85//140 117//140 -f 117//141 85//141 84//141 -f 117//142 84//142 116//142 -f 116//143 84//143 83//143 -f 116//143 83//143 115//143 -f 115//144 83//144 82//144 -f 115//144 82//144 114//144 -f 114//145 82//145 81//145 -f 114//145 81//145 113//145 -f 113//146 81//146 80//146 -f 113//146 80//146 112//146 -f 112//147 80//147 79//147 -f 112//147 79//147 111//147 -f 111//148 79//148 78//148 -f 111//149 78//149 110//149 -f 110//150 78//150 77//150 -f 110//151 77//151 109//151 -f 109//152 77//152 76//152 -f 109//152 76//152 108//152 -f 108//153 76//153 75//153 -f 108//153 75//153 107//153 -f 107//154 75//154 74//154 -f 107//154 74//154 106//154 -f 106//155 74//155 73//155 -f 106//155 73//155 105//155 -f 105//156 73//156 72//156 -f 105//156 72//156 104//156 -f 104//157 72//157 71//157 -f 104//158 71//158 103//158 -f 103//159 71//159 70//159 -f 103//160 70//160 102//160 -f 102//161 70//161 69//161 -f 102//162 69//162 101//162 -f 101//163 69//163 100//163 -f 101//164 100//164 132//164 -f 33//165 1//165 32//165 -f 33//166 32//166 64//166 -f 31//167 63//167 64//167 -f 31//168 64//168 32//168 -f 30//169 62//169 63//169 -f 30//169 63//169 31//169 -f 29//170 61//170 62//170 -f 29//170 62//170 30//170 -f 28//171 60//171 61//171 -f 28//171 61//171 29//171 -f 27//172 59//172 60//172 -f 27//172 60//172 28//172 -f 26//173 58//173 59//173 -f 26//173 59//173 27//173 -f 25//153 57//153 58//153 -f 25//174 58//174 26//174 -f 24//175 56//175 57//175 -f 24//176 57//176 25//176 -f 23//177 55//177 56//177 -f 23//177 56//177 24//177 -f 22//149 54//149 55//149 -f 22//149 55//149 23//149 -f 21//178 53//178 54//178 -f 21//178 54//178 22//178 -f 20//146 52//146 53//146 -f 20//146 53//146 21//146 -f 19//179 51//179 52//179 -f 19//180 52//180 20//180 -f 18//144 50//144 51//144 -f 18//144 51//144 19//144 -f 17//181 49//181 50//181 -f 17//181 50//181 18//181 -f 16//182 48//182 49//182 -f 16//183 49//183 17//183 -f 15//184 47//184 48//184 -f 15//185 48//185 16//185 -f 14//186 46//186 47//186 -f 14//186 47//186 15//186 -f 13//187 45//187 46//187 -f 13//187 46//187 14//187 -f 12//188 44//188 45//188 -f 12//188 45//188 13//188 -f 11//189 43//189 44//189 -f 11//189 44//189 12//189 -f 10//190 42//190 43//190 -f 10//190 43//190 11//190 -f 9//191 41//191 42//191 -f 9//191 42//191 10//191 -f 8//192 40//192 41//192 -f 8//192 41//192 9//192 -f 7//193 39//193 40//193 -f 7//193 40//193 8//193 -f 6//130 38//130 39//130 -f 6//130 39//130 7//130 -f 5//194 37//194 38//194 -f 5//194 38//194 6//194 -f 4//128 36//128 37//128 -f 4//128 37//128 5//128 -f 3//195 35//195 36//195 -f 3//195 36//195 4//195 -f 2//126 34//126 35//126 -f 2//126 35//126 3//126 -f 1//196 33//196 34//196 -f 1//196 34//196 2//196 +f 22/1/1 23/2/1 24/3/1 +f 25/1/6 26/2/6 27/3/6 +f 22/1/1 24/2/1 28/3/1 +f 25/1/6 29/2/6 26/3/6 +f 22/1/1 28/2/1 30/3/1 +f 25/1/6 31/2/6 29/3/6 +f 22/1/1 30/2/1 32/3/1 +f 25/1/6 33/2/6 31/3/6 +f 22/1/1 32/2/1 34/3/1 +f 25/1/6 35/2/6 33/3/6 +f 22/1/1 34/2/1 36/3/1 +f 25/1/6 37/2/6 35/3/6 +f 22/1/1 36/2/1 38/3/1 +f 25/1/6 39/2/6 37/3/6 +f 22/1/1 38/2/1 40/3/1 +f 25/1/6 41/2/6 39/3/6 +f 22/1/1 40/2/1 42/3/1 +f 25/1/6 43/2/6 41/3/6 +f 22/1/1 42/2/1 44/3/1 +f 25/1/6 45/2/6 43/3/6 +f 22/1/1 44/2/1 46/3/1 +f 25/1/6 47/2/6 45/3/6 +f 22/1/1 46/2/1 48/3/1 +f 25/1/6 49/2/6 47/3/6 +f 22/1/1 48/2/1 50/3/1 +f 25/1/6 51/2/6 49/3/6 +f 22/1/1 50/2/1 52/3/1 +f 25/1/6 53/2/6 51/3/6 +f 22/1/1 52/2/1 54/3/1 +f 25/1/6 55/2/6 53/3/6 +f 22/1/1 54/2/1 56/3/1 +f 25/1/6 57/2/6 55/3/6 +f 22/1/1 56/2/1 58/3/1 +f 25/1/6 59/2/6 57/3/6 +f 22/1/1 58/2/1 60/3/1 +f 25/1/6 61/2/6 59/3/6 +f 22/1/1 60/2/1 62/3/1 +f 25/1/6 63/2/6 61/3/6 +f 22/1/1 62/2/1 64/3/1 +f 25/1/6 65/2/6 63/3/6 +f 22/1/1 64/2/1 66/3/1 +f 25/1/6 67/2/6 65/3/6 +f 22/1/1 66/2/1 68/3/1 +f 25/1/6 69/2/6 67/3/6 +f 22/1/1 68/2/1 70/3/1 +f 25/1/6 71/2/6 69/3/6 +f 22/1/1 70/2/1 72/3/1 +f 25/1/6 73/2/6 71/3/6 +f 22/1/1 72/2/1 74/3/1 +f 25/1/6 75/2/6 73/3/6 +f 22/1/1 74/2/1 76/3/1 +f 25/1/6 77/2/6 75/3/6 +f 22/1/1 76/2/1 78/3/1 +f 25/1/6 79/2/6 77/3/6 +f 22/1/1 78/2/1 80/3/1 +f 25/1/6 81/2/6 79/3/6 +f 22/1/1 80/2/1 82/3/1 +f 25/1/6 83/2/6 81/3/6 +f 22/1/1 82/2/1 84/3/1 +f 25/1/6 85/2/6 83/3/6 +f 22/1/1 84/2/1 86/3/1 +f 25/1/6 87/2/6 85/3/6 +f 86/1/1 23/2/1 22/3/1 +f 25/1/6 27/2/6 87/3/6 +f 88/1/6 89/2/6 90/3/6 +f 1/1/1 91/2/1 92/3/1 +f 88/1/6 90/2/6 93/3/6 +f 1/1/1 94/2/1 91/3/1 +f 88/1/6 93/2/6 95/3/6 +f 1/1/1 96/2/1 94/3/1 +f 88/1/6 95/2/6 97/3/6 +f 1/1/1 98/2/1 96/3/1 +f 88/1/6 97/2/6 99/3/6 +f 1/1/1 100/2/1 98/3/1 +f 88/1/6 99/2/6 101/3/6 +f 1/1/1 102/2/1 100/3/1 +f 88/1/6 101/2/6 103/3/6 +f 1/1/1 104/2/1 102/3/1 +f 88/1/6 103/2/6 105/3/6 +f 1/1/1 106/2/1 104/3/1 +f 88/1/6 105/2/6 107/3/6 +f 1/1/1 108/2/1 106/3/1 +f 88/1/6 107/2/6 109/3/6 +f 1/1/1 110/2/1 108/3/1 +f 88/1/6 109/2/6 111/3/6 +f 1/1/1 112/2/1 110/3/1 +f 88/1/6 111/2/6 113/3/6 +f 1/1/1 114/2/1 112/3/1 +f 88/1/6 113/2/6 115/3/6 +f 1/1/1 116/2/1 114/3/1 +f 88/1/6 115/2/6 117/3/6 +f 1/1/1 118/2/1 116/3/1 +f 88/1/6 117/2/6 119/3/6 +f 1/1/1 120/2/1 118/3/1 +f 88/1/6 119/2/6 121/3/6 +f 1/1/1 122/2/1 120/3/1 +f 88/1/6 121/2/6 123/3/6 +f 1/1/1 124/2/1 122/3/1 +f 88/1/6 123/2/6 125/3/6 +f 1/1/1 126/2/1 124/3/1 +f 88/1/6 125/2/6 127/3/6 +f 1/1/1 128/2/1 126/3/1 +f 88/1/6 127/2/6 129/3/6 +f 1/1/1 130/2/1 128/3/1 +f 88/1/6 129/2/6 131/3/6 +f 1/1/1 132/2/1 130/3/1 +f 88/1/6 131/2/6 133/3/6 +f 1/1/1 134/2/1 132/3/1 +f 88/1/6 133/2/6 135/3/6 +f 1/1/1 136/2/1 134/3/1 +f 88/1/6 135/2/6 137/3/6 +f 1/1/1 138/2/1 136/3/1 +f 88/1/6 137/2/6 139/3/6 +f 1/1/1 3/2/1 138/3/1 +f 88/1/6 139/2/6 140/3/6 +f 88/1/6 140/2/6 141/3/6 +f 1/1/1 142/2/1 2/3/1 +f 88/1/6 141/2/6 143/3/6 +f 1/1/1 144/2/1 142/3/1 +f 88/1/6 143/2/6 145/3/6 +f 1/1/1 146/2/1 144/3/1 +f 88/1/6 145/2/6 147/3/6 +f 1/1/1 148/2/1 146/3/1 +f 88/1/6 147/2/6 149/3/6 +f 1/1/1 150/2/1 148/3/1 +f 88/1/6 149/2/6 89/3/6 +f 1/1/1 92/2/1 150/3/1 +f 151/1/7 152/2/7 153/3/7 +f 154/1/8 155/2/8 156/3/8 +f 151/1/9 153/2/9 157/3/9 +f 154/1/10 158/2/10 155/3/10 +f 151/1/11 157/2/11 159/3/11 +f 154/1/12 160/2/12 158/3/12 +f 151/1/13 159/2/13 161/3/13 +f 154/1/14 162/2/14 160/3/14 +f 151/1/15 161/2/15 163/3/15 +f 154/1/16 164/2/16 162/3/16 +f 151/1/17 163/2/17 165/3/17 +f 154/1/18 166/2/18 164/3/18 +f 151/1/19 165/2/19 167/3/19 +f 154/1/20 168/2/20 166/3/20 +f 151/1/21 167/2/21 169/3/21 +f 154/1/22 170/2/22 168/3/22 +f 151/1/23 169/2/23 171/3/23 +f 154/1/24 172/2/24 170/3/24 +f 151/1/25 171/2/25 173/3/25 +f 154/1/26 174/2/26 172/3/26 +f 151/1/27 173/2/27 175/3/27 +f 154/1/28 176/2/28 174/3/28 +f 151/1/29 175/2/29 177/3/29 +f 154/1/30 178/2/30 176/3/30 +f 151/1/29 177/2/29 179/3/29 +f 154/1/30 180/2/30 178/3/30 +f 151/1/31 179/2/31 181/3/31 +f 154/1/32 182/2/32 180/3/32 +f 151/1/33 181/2/33 183/3/33 +f 154/1/34 184/2/34 182/3/34 +f 151/1/35 183/2/35 185/3/35 +f 154/1/36 186/2/36 184/3/36 +f 151/1/37 185/2/37 187/3/37 +f 154/1/38 188/2/38 186/3/38 +f 151/1/39 187/2/39 189/3/39 +f 154/1/40 190/2/40 188/3/40 +f 151/1/41 189/2/41 191/3/41 +f 154/1/42 192/2/42 190/3/42 +f 151/1/43 191/2/43 193/3/43 +f 154/1/44 194/2/44 192/3/44 +f 151/1/45 193/2/45 195/3/45 +f 154/1/46 196/2/46 194/3/46 +f 151/1/47 195/2/47 197/3/47 +f 154/1/48 198/2/48 196/3/48 +f 151/1/49 197/2/49 199/3/49 +f 154/1/50 200/2/50 198/3/50 +f 151/1/51 199/2/51 201/3/51 +f 154/1/52 202/2/52 200/3/52 +f 151/1/53 201/2/53 203/3/53 +f 154/1/54 204/2/54 202/3/54 +f 151/1/55 203/2/55 205/3/55 +f 154/1/56 206/2/56 204/3/56 +f 151/1/57 205/2/57 207/3/57 +f 154/1/28 208/2/28 206/3/28 +f 151/1/29 207/2/29 209/3/29 +f 154/1/30 210/2/30 208/3/30 +f 151/1/29 209/2/29 211/3/29 +f 154/1/30 212/2/30 210/3/30 +f 151/1/58 211/2/58 213/3/58 +f 154/1/32 214/2/32 212/3/32 +f 151/1/25 213/2/25 215/3/25 +f 154/1/26 216/2/26 214/3/26 +f 151/1/59 215/2/59 152/3/59 +f 154/1/60 156/2/60 216/3/60 +f 217/1/2 218/2/2 219/3/2 +f 220/1/61 221/3/61 222/2/61 +f 223/1/62 224/2/62 225/3/62 +f 226/1/3 227/3/3 228/2/3 +f 215/1/63 216/2/63 156/3/63 +f 215/1/64 156/3/64 152/12/64 +f 213/1/65 214/2/65 216/3/65 +f 213/1/66 216/3/66 215/12/66 +f 211/1/67 212/2/67 214/3/67 +f 211/1/68 214/3/68 213/12/68 +f 209/1/69 210/2/69 212/3/69 +f 209/1/70 212/3/70 211/12/70 +f 207/1/71 208/2/71 210/3/71 +f 207/1/72 210/3/72 209/12/72 +f 205/1/73 206/2/73 208/3/73 +f 205/1/74 208/3/74 207/12/74 +f 203/1/75 204/2/75 206/3/75 +f 203/1/76 206/3/76 205/12/76 +f 201/1/77 202/2/77 204/3/77 +f 201/1/78 204/3/78 203/12/78 +f 199/1/79 200/2/79 202/3/79 +f 199/1/80 202/3/80 201/12/80 +f 197/1/81 198/2/81 200/3/81 +f 197/1/82 200/3/82 199/12/82 +f 195/1/83 196/2/83 198/3/83 +f 195/1/84 198/3/84 197/12/84 +f 193/1/85 194/2/85 196/3/85 +f 193/1/86 196/3/86 195/12/86 +f 191/1/87 192/2/87 194/3/87 +f 191/1/88 194/3/88 193/12/88 +f 189/1/89 190/2/89 192/3/89 +f 189/1/89 192/3/89 191/12/89 +f 187/1/90 188/2/90 190/3/90 +f 187/1/91 190/3/91 189/12/91 +f 185/1/92 186/2/92 188/3/92 +f 185/1/93 188/3/93 187/12/93 +f 183/1/94 184/2/94 186/3/94 +f 183/1/94 186/3/94 185/12/94 +f 181/1/95 182/2/95 184/3/95 +f 181/1/96 184/3/96 183/12/96 +f 179/1/97 180/2/97 182/3/97 +f 179/1/98 182/3/98 181/12/98 +f 177/1/99 178/2/99 180/3/99 +f 177/1/100 180/3/100 179/12/100 +f 175/1/101 176/2/101 178/3/101 +f 175/1/102 178/3/102 177/12/102 +f 173/1/103 174/2/103 176/3/103 +f 173/1/104 176/3/104 175/12/104 +f 171/1/105 172/2/105 174/3/105 +f 171/1/106 174/3/106 173/12/106 +f 169/1/107 170/2/107 172/3/107 +f 169/1/108 172/3/108 171/12/108 +f 167/1/109 168/2/109 170/3/109 +f 167/1/110 170/3/110 169/12/110 +f 165/1/111 166/2/111 168/3/111 +f 165/1/112 168/3/112 167/12/112 +f 163/1/113 164/2/113 166/3/113 +f 163/1/114 166/3/114 165/12/114 +f 161/1/115 162/2/115 164/3/115 +f 161/1/116 164/3/116 163/12/116 +f 159/1/117 160/2/117 162/3/117 +f 159/1/118 162/3/118 161/12/118 +f 157/1/119 158/2/119 160/3/119 +f 157/1/120 160/3/120 159/12/120 +f 153/1/121 155/2/121 158/3/121 +f 153/1/122 158/3/122 157/12/122 +f 152/1/123 156/2/123 155/3/123 +f 152/1/124 155/3/124 153/12/124 +f 92/1/125 89/2/125 149/3/125 +f 92/1/125 149/3/125 150/12/125 +f 150/1/126 149/2/126 147/3/126 +f 150/1/126 147/3/126 148/12/126 +f 148/1/127 147/2/127 145/3/127 +f 148/1/127 145/3/127 146/12/127 +f 146/1/128 145/2/128 143/3/128 +f 146/1/128 143/3/128 144/12/128 +f 144/1/129 143/2/129 141/3/129 +f 144/1/129 141/3/129 142/12/129 +f 142/1/130 141/2/130 140/3/130 +f 142/1/130 140/3/130 2/12/130 +f 2/1/131 140/2/131 139/3/131 +f 2/1/131 139/3/131 3/12/131 +f 3/1/132 139/2/132 137/3/132 +f 3/1/132 137/3/132 138/12/132 +f 138/1/133 137/2/133 135/3/133 +f 138/1/133 135/3/133 136/12/133 +f 136/1/134 135/2/134 133/3/134 +f 136/1/134 133/3/134 134/12/134 +f 134/1/135 133/2/135 131/3/135 +f 134/1/135 131/3/135 132/12/135 +f 132/1/136 131/2/136 129/3/136 +f 132/1/136 129/3/136 130/12/136 +f 130/1/137 129/2/137 127/3/137 +f 130/1/137 127/3/137 128/12/137 +f 128/1/138 127/2/138 125/3/138 +f 128/1/138 125/3/138 126/12/138 +f 126/1/139 125/2/139 123/3/139 +f 126/1/140 123/3/140 124/12/140 +f 124/1/141 123/2/141 121/3/141 +f 124/1/142 121/3/142 122/12/142 +f 122/1/143 121/2/143 119/3/143 +f 122/1/143 119/3/143 120/12/143 +f 120/1/144 119/2/144 117/3/144 +f 120/1/144 117/3/144 118/12/144 +f 118/1/145 117/2/145 115/3/145 +f 118/1/145 115/3/145 116/12/145 +f 116/1/146 115/2/146 113/3/146 +f 116/1/146 113/3/146 114/12/146 +f 114/1/147 113/2/147 111/3/147 +f 114/1/147 111/3/147 112/12/147 +f 112/1/148 111/2/148 109/3/148 +f 112/1/149 109/3/149 110/12/149 +f 110/1/150 109/2/150 107/3/150 +f 110/1/151 107/3/151 108/12/151 +f 108/1/152 107/2/152 105/3/152 +f 108/1/152 105/3/152 106/12/152 +f 106/1/153 105/2/153 103/3/153 +f 106/1/153 103/3/153 104/12/153 +f 104/1/154 103/2/154 101/3/154 +f 104/1/154 101/3/154 102/12/154 +f 102/1/155 101/2/155 99/3/155 +f 102/1/155 99/3/155 100/12/155 +f 100/1/156 99/2/156 97/3/156 +f 100/1/156 97/3/156 98/12/156 +f 98/1/157 97/2/157 95/3/157 +f 98/1/158 95/3/158 96/12/158 +f 96/1/159 95/2/159 93/3/159 +f 96/1/160 93/3/160 94/12/160 +f 94/1/161 93/2/161 90/3/161 +f 94/1/162 90/3/162 91/12/162 +f 91/1/163 90/2/163 89/3/163 +f 91/1/164 89/3/164 92/12/164 +f 27/1/165 23/2/165 86/3/165 +f 27/1/166 86/3/166 87/12/166 +f 84/1/167 85/2/167 87/3/167 +f 84/1/168 87/3/168 86/12/168 +f 82/1/169 83/2/169 85/3/169 +f 82/1/169 85/3/169 84/12/169 +f 80/1/170 81/2/170 83/3/170 +f 80/1/170 83/3/170 82/12/170 +f 78/1/171 79/2/171 81/3/171 +f 78/1/171 81/3/171 80/12/171 +f 76/1/172 77/2/172 79/3/172 +f 76/1/172 79/3/172 78/12/172 +f 74/1/173 75/2/173 77/3/173 +f 74/1/173 77/3/173 76/12/173 +f 72/1/153 73/2/153 75/3/153 +f 72/1/174 75/3/174 74/12/174 +f 70/1/175 71/2/175 73/3/175 +f 70/1/176 73/3/176 72/12/176 +f 68/1/177 69/2/177 71/3/177 +f 68/1/177 71/3/177 70/12/177 +f 66/1/149 67/2/149 69/3/149 +f 66/1/149 69/3/149 68/12/149 +f 64/1/178 65/2/178 67/3/178 +f 64/1/178 67/3/178 66/12/178 +f 62/1/146 63/2/146 65/3/146 +f 62/1/146 65/3/146 64/12/146 +f 60/1/179 61/2/179 63/3/179 +f 60/1/180 63/3/180 62/12/180 +f 58/1/144 59/2/144 61/3/144 +f 58/1/144 61/3/144 60/12/144 +f 56/1/181 57/2/181 59/3/181 +f 56/1/181 59/3/181 58/12/181 +f 54/1/182 55/2/182 57/3/182 +f 54/1/183 57/3/183 56/12/183 +f 52/1/184 53/2/184 55/3/184 +f 52/1/185 55/3/185 54/12/185 +f 50/1/186 51/2/186 53/3/186 +f 50/1/186 53/3/186 52/12/186 +f 48/1/187 49/2/187 51/3/187 +f 48/1/187 51/3/187 50/12/187 +f 46/1/188 47/2/188 49/3/188 +f 46/1/188 49/3/188 48/12/188 +f 44/1/189 45/2/189 47/3/189 +f 44/1/189 47/3/189 46/12/189 +f 42/1/190 43/2/190 45/3/190 +f 42/1/190 45/3/190 44/12/190 +f 40/1/191 41/2/191 43/3/191 +f 40/1/191 43/3/191 42/12/191 +f 38/1/192 39/2/192 41/3/192 +f 38/1/192 41/3/192 40/12/192 +f 36/1/193 37/2/193 39/3/193 +f 36/1/193 39/3/193 38/12/193 +f 34/1/130 35/2/130 37/3/130 +f 34/1/130 37/3/130 36/12/130 +f 32/1/194 33/2/194 35/3/194 +f 32/1/194 35/3/194 34/12/194 +f 30/1/128 31/2/128 33/3/128 +f 30/1/128 33/3/128 32/12/128 +f 28/1/195 29/2/195 31/3/195 +f 28/1/195 31/3/195 30/12/195 +f 24/1/126 26/2/126 29/3/126 +f 24/1/126 29/3/126 28/12/126 +f 23/1/196 27/2/196 26/3/196 +f 23/1/196 26/3/196 24/12/196 Modified: trunk/rcssserver3d/data/models/rightgoal.obj =================================================================== --- trunk/rcssserver3d/data/models/rightgoal.obj 2010-01-08 07:35:25 UTC (rev 138) +++ trunk/rcssserver3d/data/models/rightgoal.obj 2010-01-10 09:14:25 UTC (rev 139) @@ -1,235 +1,247 @@ # Blender3D v249 OBJ File: # www.blender3d.org mtllib rightgoal.mtl -o rightgoal +o Cylinder +v 0.466661 0.000000 0.006727 v 0.490346 -0.000000 -0.062326 v 0.494467 -0.000000 -0.047393 +v 0.466661 0.997179 0.006727 +v 0.494467 0.997179 -0.047393 +v 0.490346 0.997179 -0.062326 v 0.497519 -0.000000 -0.030383 +v 0.497519 0.997179 -0.030383 v 0.499385 -0.000000 -0.011947 +v 0.499385 0.997179 -0.011947 v 0.499994 0.000000 0.007207 +v 0.499994 0.997179 0.007207 v 0.499322 0.000000 0.026343 +v 0.499322 0.997179 0.026343 v 0.497394 0.000000 0.044726 +v 0.497394 0.997179 0.044726 v 0.494286 0.000000 0.061645 +v 0.494286 0.997179 0.061645 v 0.490116 0.000000 0.076457 +v 0.490116 0.997179 0.076457 v 0.485044 0.000000 0.088589 +v 0.485044 0.997179 0.088589 v 0.479266 0.000000 0.097575 +v 0.479266 0.997179 0.097575 v 0.473004 0.000000 0.103068 +v 0.473004 0.997179 0.103068 v 0.466498 0.000000 0.104861 +v 0.466498 0.997179 0.104861 v 0.459998 0.000000 0.102880 +v 0.459998 0.997179 0.102880 v 0.453754 0.000000 0.097207 +v 0.453754 0.997179 0.097207 v 0.448007 0.000000 0.088054 +v 0.448007 0.997179 0.088057 v 0.442976 0.000000 0.075777 +v 0.442976 0.997179 0.075777 v 0.438855 0.000000 0.060848 +v 0.438855 0.997179 0.060848 v 0.435803 0.000000 0.043837 +v 0.435803 0.997179 0.043837 v 0.433937 0.000000 0.025401 +v 0.433937 0.997179 0.025401 v 0.433328 0.000000 0.006247 +v 0.433328 0.997179 0.006247 v 0.434000 -0.000000 -0.012889 +v 0.434000 0.997179 -0.012889 v 0.435928 -0.000000 -0.031272 +v 0.435928 0.997179 -0.031272 v 0.439036 -0.000000 -0.048194 +v 0.439036 0.997179 -0.048194 v 0.443207 -0.000000 -0.063006 +v 0.443206 0.997179 -0.063003 v 0.448278 -0.000000 -0.075135 +v 0.448278 0.997179 -0.075135 v 0.454056 -0.000000 -0.084120 +v 0.454056 0.997179 -0.084120 v 0.460318 -0.000000 -0.089614 +v 0.460318 0.997179 -0.089614 v 0.466824 -0.000000 -0.091407 +v 0.466824 0.997179 -0.091407 v 0.473324 -0.000000 -0.089428 +v 0.473324 0.997179 -0.089429 v 0.479568 -0.000000 -0.083752 +v 0.479568 0.997179 -0.083752 v 0.485316 -0.000000 -0.074602 -v 0.490346 0.997179 -0.062326 -v 0.494467 0.997179 -0.047393 -v 0.497519 0.997179 -0.030383 -v 0.499385 0.997179 -0.011947 -v 0.499994 0.997179 0.007207 -v 0.499322 0.997179 0.026343 -v 0.497394 0.997179 0.044726 -v 0.494286 0.997179 0.061645 -v 0.490116 0.997179 0.076457 -v 0.485044 0.997179 0.088589 -v 0.479266 0.997179 0.097575 -v 0.473004 0.997179 0.103068 -v 0.466498 0.997179 0.104861 -v 0.459998 0.997179 0.102880 -v 0.453754 0.997179 0.097207 -v 0.448007 0.997179 0.088057 -v 0.442976 0.997179 0.075777 -v 0.438855 0.997179 0.060848 -v 0.435803 0.997179 0.043837 -v 0.433937 0.997179 0.025401 -v 0.433328 0.997179 0.006247 -v 0.434000 0.997179 -0.012889 -v 0.435928 0.997179 -0.031272 -v 0.439036 0.997179 -0.048194 -v 0.443206 0.997179 -0.063003 -v 0.448278 0.997179 -0.075135 -v 0.454056 0.997179 -0.084120 -v 0.460318 0.997179 -0.089614 -v 0.466824 0.997179 -0.091407 -v 0.473324 0.997179 -0.089429 -v 0.479568 0.997179 -0.083752 v 0.485315 0.997179 -0.074602 -v 0.466661 0.000000 0.006727 -v 0.466661 0.997179 0.006727 v -0.466661 0.997179 -0.006727 +v -0.442976 0.997179 -0.075777 +v -0.448007 0.997179 -0.088057 v -0.466661 -0.000000 -0.006727 -v -0.448007 0.997179 -0.088057 +v -0.448007 -0.000000 -0.088054 +v -0.442976 -0.000000 -0.075777 v -0.453755 0.997179 -0.097207 +v -0.453754 -0.000000 -0.097207 v -0.459998 0.997179 -0.102883 +v -0.459998 -0.000000 -0.102880 v -0.466498 0.997179 -0.104861 +v -0.466498 -0.000000 -0.104861 v -0.473004 0.997179 -0.103068 +v -0.473004 -0.000000 -0.103068 v -0.479266 0.997179 -0.097575 +v -0.479266 -0.000000 -0.097575 v -0.485044 0.997179 -0.088589 +v -0.485044 -0.000000 -0.088589 v -0.490116 0.997179 -0.076457 +v -0.490116 -0.000000 -0.076457 v -0.494286 0.997179 -0.061646 +v -0.494286 -0.000000 -0.061645 v -0.497394 0.997179 -0.044723 +v -0.497394 -0.000000 -0.044726 v -0.499322 0.997179 -0.026343 +v -0.499322 -0.000000 -0.026343 v -0.499994 0.997179 -0.007207 +v -0.499994 -0.000000 -0.007207 v -0.499385 0.997179 0.011947 +v -0.499385 0.000000 0.011947 v -0.497519 0.997179 0.030383 +v -0.497519 0.000000 0.030383 v -0.494467 0.997179 0.047393 +v -0.494467 0.000000 0.047393 v -0.490346 0.997179 0.062326 +v -0.490346 0.000000 0.062326 v -0.485315 0.997179 0.074602 +v -0.485316 0.000000 0.074602 v -0.479568 0.997179 0.083752 +v -0.479568 0.000000 0.083752 v -0.473324 0.997179 0.089428 +v -0.473324 0.000000 0.089428 v -0.466824 0.997179 0.091407 +v -0.466824 0.000000 0.091407 v -0.460318 0.997179 0.089614 +v -0.460318 0.000000 0.089614 v -0.454056 0.997179 0.084120 +v -0.454056 0.000000 0.084120 v -0.448278 0.997179 0.075135 +v -0.448278 0.000000 0.075135 v -0.443207 0.997179 0.063006 +v -0.443207 0.000000 0.063006 v -0.439036 0.997179 0.048194 +v -0.439036 0.000000 0.048194 v -0.435928 0.997179 0.031272 v -0.434000 0.997179 0.012889 +v -0.434000 0.000000 0.012889 +v -0.435928 0.000000 0.031272 v -0.433328 0.997179 -0.006247 +v -0.433328 -0.000000 -0.006247 v -0.433937 0.997179 -0.025401 +v -0.433937 -0.000000 -0.025401 v -0.435803 0.997179 -0.043837 +v -0.435803 -0.000000 -0.043837 v -0.438855 0.997179 -0.060848 -v -0.442976 0.997179 -0.075777 -v -0.448007 -0.000000 -0.088054 -v -0.453754 -0.000000 -0.097207 -v -0.459998 -0.000000 -0.102880 -v -0.466498 -0.000000 -0.104861 -v -0.473004 -0.000000 -0.103068 -v -0.479266 -0.000000 -0.097575 -v -0.485044 -0.000000 -0.088589 -v -0.490116 -0.000000 -0.076457 -v -0.494286 -0.000000 -0.061645 -v -0.497394 -0.000000 -0.044726 -v -0.499322 -0.000000 -0.026343 -v -0.499994 -0.000000 -0.007207 -v -0.499385 0.000000 0.011947 -v -0.497519 0.000000 0.030383 -v -0.494467 0.000000 0.047393 -v -0.490346 0.000000 0.062326 -v -0.485316 0.000000 0.074602 -v -0.479568 0.000000 0.083752 -v -0.473324 0.000000 0.089428 -v -0.466824 0.000000 0.091407 -v -0.460318 0.000000 0.089614 -v -0.454056 0.000000 0.084120 -v -0.448278 0.000000 0.075135 -v -0.443207 0.000000 0.063006 -v -0.439036 0.000000 0.048194 -v -0.435928 0.000000 0.031272 -v -0.434000 0.000000 0.012889 -v -0.433328 -0.000000 -0.006247 -v -0.433937 -0.000000 -0.025401 -v -0.435803 -0.000000 -0.043837 v -0.438855 -0.000000 -0.060848 -v -0.442976 -0.000000 -0.075777 +v -0.465871 0.964236 -0.006715 v -0.465814 0.986271 -0.041411 v -0.465804 0.981550 -0.047514 +v 0.467451 0.964236 0.006739 +v 0.467519 0.981550 -0.034060 +v 0.467508 0.986271 -0.027957 v -0.465796 0.976161 -0.052048 +v 0.467526 0.976161 -0.038594 v -0.465791 0.970316 -0.054839 +v 0.467531 0.970316 -0.041385 v -0.465790 0.964236 -0.055781 +v 0.467532 0.964236 -0.042330 v -0.465791 0.958158 -0.054839 +v 0.467531 0.958158 -0.041385 v -0.465796 0.952311 -0.052048 +v 0.467526 0.952311 -0.038594 v -0.465804 0.946925 -0.047514 +v 0.467519 0.946925 -0.034060 v -0.465814 0.942202 -0.041411 +v 0.467508 0.942202 -0.027957 v -0.465826 0.938326 -0.033974 +v 0.467496 0.938326 -0.020523 v -0.465840 0.935446 -0.025493 +v 0.467482 0.935446 -0.012038 v -0.465855 0.933674 -0.016287 +v 0.467467 0.933674 -0.002835 v -0.465871 0.933074 -0.006715 +v 0.467451 0.933074 0.006739 v -0.465887 0.933674 0.002859 +v 0.467435 0.933674 0.016310 v -0.465903 0.935446 0.012062 +v 0.467420 0.935446 0.025516 v -0.465917 0.938326 0.020544 +v 0.467405 0.938326 0.033998 v -0.465929 0.942202 0.027980 +v 0.467393 0.942202 0.041435 v -0.465939 0.946925 0.034083 +v 0.467383 0.946925 0.047535 v -0.465947 0.952311 0.038617 +v 0.467375 0.952311 0.052071 v -0.465951 0.958158 0.041408 +v 0.467371 0.958158 0.054862 v -0.465953 0.964236 0.042353 +v 0.467369 0.964236 0.055804 v -0.465951 0.970316 0.041408 +v 0.467371 0.970316 0.054862 v -0.465947 0.976161 0.038617 +v 0.467375 0.976161 0.052071 v -0.465939 0.981550 0.034083 +v 0.467383 0.981550 0.047535 v -0.465929 0.986271 0.027980 +v 0.467393 0.986271 0.041435 v -0.465917 0.990147 0.020544 +v 0.467405 0.990147 0.033998 v -0.465903 0.993026 0.012062 +v 0.467420 0.993026 0.025516 v -0.465887 0.994800 0.002859 +v 0.467435 0.994800 0.016310 v -0.465871 0.995399 -0.006715 +v 0.467451 0.995399 0.006739 v -0.465855 0.994800 -0.016287 +v 0.467467 0.994800 -0.002835 v -0.465840 0.993026 -0.025493 +v 0.467482 0.993026 -0.012038 v -0.465826 0.990147 -0.033974 -v 0.467508 0.986271 -0.027957 -v 0.467519 0.981550 -0.034060 -v 0.467526 0.976161 -0.038594 -v 0.467531 0.970316 -0.041385 -v 0.467532 0.964236 -0.042330 -v 0.467531 0.958158 -0.041385 -v 0.467526 0.952311 -0.038594 -v 0.467519 0.946925 -0.034060 -v 0.467508 0.942202 -0.027957 -v 0.467496 0.938326 -0.020523 -v 0.467482 0.935446 -0.012038 -v 0.467467 0.933674 -0.002835 -v 0.467451 0.933074 0.006739 -v 0.467435 0.933674 0.016310 -v 0.467420 0.935446 0.025516 -v 0.467405 0.938326 0.033998 -v 0.467393 0.942202 0.041435 -v 0.467383 0.946925 0.047535 -v 0.467375 0.952311 0.052071 -v 0.467371 0.958158 0.054862 -v 0.467369 0.964236 0.055804 -v 0.467371 0.970316 0.054862 -v 0.467375 0.976161 0.052071 -v 0.467383 0.981550 0.047535 -v 0.467393 0.986271 0.041435 -v 0.467405 0.990147 0.033998 -v 0.467420 0.993026 0.025516 -v 0.467435 0.994800 0.016310 -v 0.467451 0.995399 0.006739 -v 0.467467 0.994800 -0.002835 -v 0.467482 0.993026 -0.012038 v 0.467496 0.990147 -0.020523 -v -0.465871 0.964236 -0.006715 -v 0.467451 0.964236 0.006739 +v -0.458524 0.001554 -0.890770 +v -0.459830 0.498835 -0.105700 v -0.459830 0.000247 -0.105700 -v -0.459830 0.498835 -0.105700 -v -0.458524 0.001554 -0.890770 +v -0.465191 0.001554 -0.890770 +v -0.466496 0.000247 -0.105700 +v -0.466496 0.498835 -0.105700 +v 0.474809 0.001554 -0.890770 +v 0.473504 0.498835 -0.105700 +v 0.473504 0.000247 -0.105700 +v 0.468143 0.001554 -0.890770 +v 0.466837 0.000247 -0.105700 +v 0.466837 0.498835 -0.105700 v 0.469231 0.001554 -0.881690 v 0.467925 1.000000 -0.096621 v 0.467925 0.000247 -0.096621 -v 0.467925 1.000000 -0.096621 -v 0.469231 0.001554 -0.881690 v -0.463784 0.001554 -0.895139 -v -0.465090 1.000000 -0.110069 v -0.465090 0.000247 -0.110069 v -0.465090 1.000000 -0.110069 v -0.463784 0.001554 -0.895139 +v -0.465090 1.000000 -0.110069 +v -0.465090 0.000247 -0.110069 +v 0.469231 0.001554 -0.881690 +v 0.467925 0.000247 -0.096621 v 0.467925 1.000000 -0.096621 v 0.469231 0.001554 -0.881690 -v -0.465090 0.000247 -0.110069 +v 0.467925 1.000000 -0.096621 v -0.465090 1.000000 -0.110069 v -0.463784 0.001554 -0.895139 -v -0.465191 0.001554 -0.890770 -v -0.466496 0.498835 -0.105700 -v -0.466496 0.000247 -0.105700 -v 0.474809 0.001554 -0.890770 -v 0.473504 0.498835 -0.105700 -v 0.473504 0.000247 -0.105700 -v 0.468143 0.001554 -0.890770 -v 0.466837 0.498835 -0.105700 -v 0.466837 0.000247 -0.105700 v 0.469231 0.001554 -0.881690 v 0.467925 1.000000 -0.096621 -v 0.467925 0.000247 -0.096621 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.478737 0.520656 +vt 0.239368 1.000000 +vt 0.239368 0.520028 +vt 0.239368 0.520656 +vt 0.000000 0.520028 +vt 0.812878 0.000000 +vt 0.812878 0.520028 +vt 0.000000 0.520027 +vt 1.000000 1.000000 vn -0.000000 -1.000000 0.000000 vn 0.999999 0.000000 0.001664 vn -0.999999 -0.000000 -0.001664 @@ -428,401 +440,401 @@ vn 0.963964 -0.000000 -0.266033 usemtl grey_naogoalnet.png s off -f 68//1 126//1 125//1 -f 206//2 205//2 204//2 -f 207//3 209//3 208//3 -f 216//2 215//2 214//2 -f 226//3 228//3 227//3 -f 213//4 212//4 210//4 -f 213//4 210//4 211//4 -f 202//5 207//5 208//5 -f 202//5 208//5 203//5 +f 70/1/1 124/2/1 120/3/1 +f 211/4/2 212/5/2 213/6/2 +f 214/7/3 215/8/3 216/1/3 +f 217/7/2 218/1/2 219/8/2 +f 220/4/3 221/6/3 222/5/3 +f 223/9/4 224/10/4 225/11/4 +f 223/9/4 225/11/4 226/2/4 +f 227/9/5 214/2/5 216/11/5 +f 227/9/5 216/11/5 228/10/5 usemtl white -f 201//2 200//2 199//2 -f 217//6 219//6 218//6 -f 220//7 221//7 222//7 -f 223//3 225//3 224//3 +f 199/1/2 200/2/2 201/3/2 +f 202/1/6 203/3/6 204/2/6 +f 205/1/7 206/2/7 207/3/7 +f 208/1/3 209/3/3 210/2/3 usemtl sky-blue -f 65//1 1//1 2//1 -f 66//8 34//8 33//8 -f 65//1 2//1 3//1 -f 66//8 35//8 34//8 -f 65//1 3//1 4//1 -f 66//8 36//8 35//8 -f 65//1 4//1 5//1 -f 66//8 37//8 36//8 -f 65//1 5//1 6//1 -f 66//8 38//8 37//8 -f 65//1 6//1 7//1 -f 66//8 39//8 38//8 -f 65//1 7//1 8//1 -f 66//8 40//8 39//8 -f 65//1 8//1 9//1 -f 66//8 41//8 40//8 -f 65//1 9//1 10//1 -f 66//8 42//8 41//8 -f 65//1 10//1 11//1 -f 66//8 43//8 42//8 -f 65//1 11//1 12//1 -f 66//8 44//8 43//8 -f 65//1 12//1 13//1 -f 66//8 45//8 44//8 -f 65//1 13//1 14//1 -f 66//8 46//8 45//8 -f 65//1 14//1 15//1 -f 66//8 47//8 46//8 -f 65//1 15//1 16//1 -f 66//8 48//8 47//8 -f 65//1 16//1 17//1 -f 66//8 49//8 48//8 -f 65//1 17//1 18//1 -f 66//8 50//8 49//8 -f 65//1 18//1 19//1 -f 66//8 51//8 50//8 -f 65//1 19//1 20//1 -f 66//8 52//8 51//8 -f 65//1 20//1 21//1 -f 66//8 53//8 52//8 -f 65//1 21//1 22//1 -f 66//8 54//8 53//8 -f 65//1 22//1 23//1 -f 66//8 55//8 54//8 -f 65//1 23//1 24//1 -f 66//8 56//8 55//8 -f 65//1 24//1 25//1 -f 66//8 57//8 56//8 -f 65//1 25//1 26//1 -f 66//8 58//8 57//8 -f 65//1 26//1 27//1 -f 66//8 59//8 58//8 -f 65//1 27//1 28//1 -f 66//8 60//8 59//8 -f 65//1 28//1 29//1 -f 66//8 61//8 60//8 -f 65//1 29//1 30//1 -f 66//8 62//8 61//8 -f 65//1 30//1 31//1 -f 66//8 63//8 62//8 -f 65//1 31//1 32//1 -f 66//8 64//8 63//8 -f 32//1 1//1 65//1 -f 66//8 33//8 64//8 -f 67//8 100//8 69//8 -f 68//1 101//1 132//1 -f 67//8 69//8 70//8 -f 68//1 102//1 101//1 -f 67//8 70//8 71//8 -f 68//1 103//1 102//1 -f 67//8 71//8 72//8 -f 68//1 104//1 103//1 -f 67//8 72//8 73//8 -f 68//1 105//1 104//1 -f 67//8 73//8 74//8 -f 68//1 106//1 105//1 -f 67//8 74//8 75//8 -f 68//1 107//1 106//1 -f 67//8 75//8 76//8 -f 68//1 108//1 107//1 -f 67//8 76//8 77//8 -f 68//1 109//1 108//1 -f 67//8 77//8 78//8 -f 68//1 110//1 109//1 -f 67//8 78//8 79//8 -f 68//1 111//1 110//1 -f 67//8 79//8 80//8 -f 68//1 112//1 111//1 -f 67//8 80//8 81//8 -f 68//1 113//1 112//1 -f 67//8 81//8 82//8 -f 68//1 114//1 113//1 -f 67//8 82//8 83//8 -f 68//1 115//1 114//1 -f 67//8 83//8 84//8 -f 68//1 116//1 115//1 -f 67//8 84//8 85//8 -f 68//1 117//1 116//1 -f 67//8 85//8 86//8 -f 68//1 118//1 117//1 -f 67//8 86//8 87//8 -f 68//1 119//1 118//1 -f 67//8 87//8 88//8 -f 68//1 120//1 119//1 -f 67//8 88//8 89//8 -f 68//1 121//1 120//1 -f 67//8 89//8 90//8 -f 68//1 122//1 121//1 -f 67//8 90//8 91//8 -f 68//1 123//1 122//1 -f 67//8 91//8 92//8 -f 68//1 124//1 123//1 -f 67//8 92//8 93//8 -f 68//1 125//1 124//1 -f 67//8 93//8 94//8 -f 67//8 94//8 95//8 -f 68//1 127//1 126//1 -f 67//8 95//8 96//8 -f 68//1 128//1 127//1 -f 67//8 96//8 97//8 -f 68//1 129//1 128//1 -f 67//8 97//8 98//8 -f 68//1 130//1 129//1 -f 67//8 98//8 99//8 -f 68//1 131//1 130//1 -f 67//8 99//8 100//8 -f 68//1 132//1 131//1 -f 197//9 133//9 134//9 -f 198//10 166//10 165//10 -f 197//11 134//11 135//11 -f 198//12 167//12 166//12 -f 197//13 135//13 136//13 -f 198//14 168//14 167//14 -f 197//15 136//15 137//15 -f 198//16 169//16 168//16 -f 197//17 137//17 138//17 -f 198//18 170//18 169//18 -f 197//19 138//19 139//19 -f 198//20 171//20 170//20 -f 197//21 139//21 140//21 -f 198//22 172//22 171//22 -f 197//23 140//23 141//23 -f 198//24 173//24 172//24 -f 197//25 141//25 142//25 -f 198//26 174//26 173//26 -f 197//27 142//27 143//27 -f 198//28 175//28 174//28 -f 197//29 143//29 144//29 -f 198//30 176//30 175//30 -f 197//31 144//31 145//31 -f 198//32 177//32 176//32 -f 197//31 145//31 146//31 -f 198//32 178//32 177//32 -f 197//33 146//33 147//33 -f 198//34 179//34 178//34 -f 197//35 147//35 148//35 -f 198//36 180//36 179//36 -f 197//37 148//37 149//37 -f 198//38 181//38 180//38 -f 197//39 149//39 150//39 -f 198//40 182//40 181//40 -f 197//41 150//41 151//41 -f 198//42 183//42 182//42 -f 197//43 151//43 152//43 -f 198//44 184//44 183//44 -f 197//45 152//45 153//45 -f 198//46 185//46 184//46 -f 197//47 153//47 154//47 -f 198//48 186//48 185//48 -f 197//49 154//49 155//49 -f 198//50 187//50 186//50 -f 197//51 155//51 156//51 -f 198//52 188//52 187//52 -f 197//53 156//53 157//53 -f 198//54 189//54 188//54 -f 197//55 157//55 158//55 -f 198//56 190//56 189//56 -f 197//57 158//57 159//57 -f 198//58 191//58 190//58 -f 197//59 159//59 160//59 -f 198//30 192//30 191//30 -f 197//31 160//31 161//31 -f 198//32 193//32 192//32 -f 197//31 161//31 162//31 -f 198//32 194//32 193//32 -f 197//60 162//60 163//60 -f 198//34 195//34 194//34 -f 197//27 163//27 164//27 -f 198//28 196//28 195//28 -f 197//61 164//61 133//61 -f 198//62 165//62 196//62 -f 164//63 196//63 165//63 -f 164//64 165//64 133//64 -f 163//65 195//65 196//65 -f 163//66 196//66 164//66 -f 162//67 194//67 195//67 -f 162//68 195//68 163//68 -f 161//69 193//69 194//69 -f 161//70 194//70 162//70 -f 160//71 192//71 193//71 -f 160//72 193//72 161//72 -f 159//73 191//73 192//73 -f 159//74 192//74 160//74 -f 158//75 190//75 191//75 -f 158//76 191//76 159//76 -f 157//77 189//77 190//77 -f 157//78 190//78 158//78 -f 156//79 188//79 189//79 -f 156//80 189//80 157//80 -f 155//81 187//81 188//81 -f 155//82 188//82 156//82 -f 154//83 186//83 187//83 -f 154//84 187//84 155//84 -f 153//85 185//85 186//85 -f 153//86 186//86 154//86 -f 152//87 184//87 185//87 -f 152//88 185//88 153//88 -f 151//89 183//89 184//89 -f 151//89 184//89 152//89 -f 150//90 182//90 183//90 -f 150//91 183//91 151//91 -f 149//92 181//92 182//92 -f 149//93 182//93 150//93 -f 148//94 180//94 181//94 -f 148//94 181//94 149//94 -f 147//95 179//95 180//95 -f 147//96 180//96 148//96 -f 146//97 178//97 179//97 -f 146//98 179//98 147//98 -f 145//99 177//99 178//99 -f 145//100 178//100 146//100 -f 144//101 176//101 177//101 -f 144//102 177//102 145//102 -f 143//103 175//103 176//103 -f 143//104 176//104 144//104 -f 142//105 174//105 175//105 -f 142//106 175//106 143//106 -f 141//107 173//107 174//107 -f 141//108 174//108 142//108 -f 140//109 172//109 173//109 -f 140//110 173//110 141//110 -f 139//111 171//111 172//111 -f 139//112 172//112 140//112 -f 138//113 170//113 171//113 -f 138//114 171//114 139//114 -f 137//115 169//115 170//115 -f 137//116 170//116 138//116 -f 136//117 168//117 169//117 -f 136//118 169//118 137//118 -f 135//119 167//119 168//119 -f 135//120 168//120 136//120 -f 134//121 166//121 167//121 -f 134//122 167//122 135//122 -f 133//123 165//123 166//123 -f 133//124 166//124 134//124 -f 132//125 100//125 99//125 -f 132//125 99//125 131//125 -f 131//126 99//126 98//126 -f 131//126 98//126 130//126 -f 130//127 98//127 97//127 -f 130//127 97//127 129//127 -f 129//128 97//128 96//128 -f 129//128 96//128 128//128 -f 128//129 96//129 95//129 -f 128//129 95//129 127//129 -f 127//130 95//130 94//130 -f 127//130 94//130 126//130 -f 126//131 94//131 93//131 -f 126//131 93//131 125//131 -f 125//132 93//132 92//132 -f 125//132 92//132 124//132 -f 124//133 92//133 91//133 -f 124//133 91//133 123//133 -f 123//134 91//134 90//134 -f 123//134 90//134 122//134 -f 122//135 90//135 89//135 -f 122//135 89//135 121//135 -f 121//136 89//136 88//136 -f 121//136 88//136 120//136 -f 120//137 88//137 87//137 -f 120//137 87//137 119//137 -f 119//138 87//138 86//138 -f 119//138 86//138 118//138 -f 118//139 86//139 85//139 -f 118//140 85//140 117//140 -f 117//141 85//141 84//141 -f 117//142 84//142 116//142 -f 116//143 84//143 83//143 -f 116//143 83//143 115//143 -f 115//144 83//144 82//144 -f 115//144 82//144 114//144 -f 114//145 82//145 81//145 -f 114//145 81//145 113//145 -f 113//146 81//146 80//146 -f 113//146 80//146 112//146 -f 112//147 80//147 79//147 -f 112//147 79//147 111//147 -f 111//148 79//148 78//148 -f 111//149 78//149 110//149 -f 110//150 78//150 77//150 -f 110//151 77//151 109//151 -f 109//152 77//152 76//152 -f 109//152 76//152 108//152 -f 108//153 76//153 75//153 -f 108//153 75//153 107//153 -f 107//154 75//154 74//154 -f 107//154 74//154 106//154 -f 106//155 74//155 73//155 -f 106//155 73//155 105//155 -f 105//156 73//156 72//156 -f 105//156 72//156 104//156 -f 104//157 72//157 71//157 -f 104//158 71//158 103//158 -f 103//159 71//159 70//159 -f 103//160 70//160 102//160 -f 102//161 70//161 69//161 -f 102//162 69//162 101//162 -f 101//163 69//163 100//163 -f 101//164 100//164 132//164 -f 33//165 1//165 32//165 -f 33//166 32//166 64//166 -f 31//167 63//167 64//167 -f 31//168 64//168 32//168 -f 30//169 62//169 63//169 -f 30//169 63//169 31//169 -f 29//170 61//170 62//170 -f 29//170 62//170 30//170 -f 28//171 60//171 61//171 -f 28//171 61//171 29//171 -f 27//172 59//172 60//172 -f 27//172 60//172 28//172 -f 26//173 58//173 59//173 -f 26//173 59//173 27//173 -f 25//153 57//153 58//153 -f 25//174 58//174 26//174 -f 24//175 56//175 57//175 -f 24//176 57//176 25//176 -f 23//177 55//177 56//177 -f 23//177 56//177 24//177 -f 22//149 54//149 55//149 -f 22//149 55//149 23//149 -f 21//178 53//178 54//178 -f 21//178 54//178 22//178 -f 20//146 52//146 53//146 -f 20//146 53//146 21//146 -f 19//179 51//179 52//179 -f 19//180 52//180 20//180 -f 18//144 50//144 51//144 -f 18//144 51//144 19//144 -f 17//181 49//181 50//181 -f 17//181 50//181 18//181 -f 16//182 48//182 49//182 -f 16//183 49//183 17//183 -f 15//184 47//184 48//184 -f 15//185 48//185 16//185 -f 14//186 46//186 47//186 -f 14//186 47//186 15//186 -f 13//187 45//187 46//187 -f 13//187 46//187 14//187 -f 12//188 44//188 45//188 -f 12//188 45//188 13//188 -f 11//189 43//189 44//189 -f 11//189 44//189 12//189 -f 10//190 42//190 43//190 -f 10//190 43//190 11//190 -f 9//191 41//191 42//191 -f 9//191 42//191 10//191 -f 8//192 40//192 41//192 -f 8//192 41//192 9//192 -f 7//193 39//193 40//193 -f 7//193 40//193 8//193 -f 6//130 38//130 39//130 -f 6//130 39//130 7//130 -f 5//194 37//194 38//194 -f 5//194 38//194 6//194 -f 4//128 36//128 37//128 -f 4//128 37//128 5//128 -f 3//195 35//195 36//195 -f 3//195 36//195 4//195 -f 2//126 34//126 35//126 -f 2//126 35//126 3//126 -f 1//196 33//196 34//196 -f 1//196 34//196 2//196 +f 1/1/1 2/2/1 3/3/1 +f 4/1/8 5/2/8 6/3/8 +f 1/1/1 3/2/1 7/3/1 +f 4/1/8 8/2/8 5/3/8 +f 1/1/1 7/2/1 9/3/1 +f 4/1/8 10/2/8 8/3/8 +f 1/1/1 9/2/1 11/3/1 +f 4/1/8 12/2/8 10/3/8 +f 1/1/1 11/2/1 13/3/1 +f 4/1/8 14/2/8 12/3/8 +f 1/1/1 13/2/1 15/3/1 +f 4/1/8 16/2/8 14/3/8 +f 1/1/1 15/2/1 17/3/1 +f 4/1/8 18/2/8 16/3/8 +f 1/1/1 17/2/1 19/3/1 +f 4/1/8 20/2/8 18/3/8 +f 1/1/1 19/2/1 21/3/1 +f 4/1/8 22/2/8 20/3/8 +f 1/1/1 21/2/1 23/3/1 +f 4/1/8 24/2/8 22/3/8 +f 1/1/1 23/2/1 25/3/1 +f 4/1/8 26/2/8 24/3/8 +f 1/1/1 25/2/1 27/3/1 +f 4/1/8 28/2/8 26/3/8 +f 1/1/1 27/2/1 29/3/1 +f 4/1/8 30/2/8 28/3/8 +f 1/1/1 29/2/1 31/3/1 +f 4/1/8 32/2/8 30/3/8 +f 1/1/1 31/2/1 33/3/1 +f 4/1/8 34/2/8 32/3/8 +f 1/1/1 33/2/1 35/3/1 +f 4/1/8 36/2/8 34/3/8 +f 1/1/1 35/2/1 37/3/1 +f 4/1/8 38/2/8 36/3/8 +f 1/1/1 37/2/1 39/3/1 +f 4/1/8 40/2/8 38/3/8 +f 1/1/1 39/2/1 41/3/1 +f 4/1/8 42/2/8 40/3/8 +f 1/1/1 41/2/1 43/3/1 +f 4/1/8 44/2/8 42/3/8 +f 1/1/1 43/2/1 45/3/1 +f 4/1/8 46/2/8 44/3/8 +f 1/1/1 45/2/1 47/3/1 +f 4/1/8 48/2/8 46/3/8 +f 1/1/1 47/2/1 49/3/1 +f 4/1/8 50/2/8 48/3/8 +f 1/1/1 49/2/1 51/3/1 +f 4/1/8 52/2/8 50/3/8 +f 1/1/1 51/2/1 53/3/1 +f 4/1/8 54/2/8 52/3/8 +f 1/1/1 53/2/1 55/3/1 +f 4/1/8 56/2/8 54/3/8 +f 1/1/1 55/2/1 57/3/1 +f 4/1/8 58/2/8 56/3/8 +f 1/1/1 57/2/1 59/3/1 +f 4/1/8 60/2/8 58/3/8 +f 1/1/1 59/2/1 61/3/1 +f 4/1/8 62/2/8 60/3/8 +f 1/1/1 61/2/1 63/3/1 +f 4/1/8 64/2/8 62/3/8 +f 1/1/1 63/2/1 65/3/1 +f 4/1/8 66/2/8 64/3/8 +f 2/2/1 1/3/1 65/1/1 +f 4/1/8 6/2/8 66/3/8 +f 67/1/8 68/2/8 69/3/8 +f 70/1/1 71/2/1 72/3/1 +f 67/1/8 69/2/8 73/3/8 +f 70/1/1 74/2/1 71/3/1 +f 67/1/8 73/2/8 75/3/8 +f 70/1/1 76/2/1 74/3/1 +f 67/1/8 75/2/8 77/3/8 +f 70/1/1 78/2/1 76/3/1 +f 67/1/8 77/2/8 79/3/8 +f 70/1/1 80/2/1 78/3/1 +f 67/1/8 79/2/8 81/3/8 +f 70/1/1 82/2/1 80/3/1 +f 67/1/8 81/2/8 83/3/8 +f 70/1/1 84/2/1 82/3/1 +f 67/1/8 83/2/8 85/3/8 +f 70/1/1 86/2/1 84/3/1 +f 67/1/8 85/2/8 87/3/8 +f 70/1/1 88/2/1 86/3/1 +f 67/1/8 87/2/8 89/3/8 +f 70/1/1 90/2/1 88/3/1 +f 67/1/8 89/2/8 91/3/8 +f 70/1/1 92/2/1 90/3/1 +f 67/1/8 91/2/8 93/3/8 +f 70/1/1 94/2/1 92/3/1 +f 67/1/8 93/2/8 95/3/8 +f 70/1/1 96/2/1 94/3/1 +f 67/1/8 95/2/8 97/3/8 +f 70/1/1 98/2/1 96/3/1 +f 67/1/8 97/2/8 99/3/8 +f 70/1/1 100/2/1 98/3/1 +f 67/1/8 99/2/8 101/3/8 +f 70/1/1 102/2/1 100/3/1 +f 67/1/8 101/2/8 103/3/8 +f 70/1/1 104/2/1 102/3/1 +f 67/1/8 103/2/8 105/3/8 +f 70/1/1 106/2/1 104/3/1 +f 67/1/8 105/2/8 107/3/8 +f 70/1/1 108/2/1 106/3/1 +f 67/1/8 107/2/8 109/3/8 +f 70/1/1 110/2/1 108/3/1 +f 67/1/8 109/2/8 111/3/8 +f 70/1/1 112/2/1 110/3/1 +f 67/1/8 111/2/8 113/3/8 +f 70/1/1 114/2/1 112/3/1 +f 67/1/8 113/2/8 115/3/8 +f 70/1/1 116/2/1 114/3/1 +f 67/1/8 115/2/8 117/3/8 +f 70/1/1 118/2/1 116/3/1 +f 67/1/8 117/2/8 119/3/8 +f 70/1/1 120/2/1 118/3/1 +f 67/1/8 119/2/8 121/3/8 +f 67/1/8 121/2/8 122/3/8 +f 70/1/1 123/2/1 124/3/1 +f 67/1/8 122/2/8 125/3/8 +f 70/1/1 126/2/1 123/3/1 +f 67/1/8 125/2/8 127/3/8 +f 70/1/1 128/2/1 126/3/1 +f 67/1/8 127/2/8 129/3/8 +f 70/1/1 130/2/1 128/3/1 +f 67/1/8 129/2/8 131/3/8 +f 70/1/1 132/2/1 130/3/1 +f 67/1/8 131/2/8 68/3/8 +f 70/1/1 72/2/1 132/3/1 +f 133/1/9 134/2/9 135/3/9 +f 136/1/10 137/2/10 138/3/10 +f 133/1/11 135/2/11 139/3/11 +f 136/1/12 140/2/12 137/3/12 +f 133/1/13 139/2/13 141/3/13 +f 136/1/14 142/2/14 140/3/14 +f 133/1/15 141/2/15 143/3/15 +f 136/1/16 144/2/16 142/3/16 +f 133/1/17 143/2/17 145/3/17 +f 136/1/18 146/2/18 144/3/18 +f 133/1/19 145/2/19 147/3/19 +f 136/1/20 148/2/20 146/3/20 +f 133/1/21 147/2/21 149/3/21 +f 136/1/22 150/2/22 148/3/22 +f 133/1/23 149/2/23 151/3/23 +f 136/1/24 152/2/24 150/3/24 +f 133/1/25 151/2/25 153/3/25 +f 136/1/26 154/2/26 152/3/26 +f 133/1/27 153/2/27 155/3/27 +f 136/1/28 156/2/28 154/3/28 +f 133/1/29 155/2/29 157/3/29 +f 136/1/30 158/2/30 156/3/30 +f 133/1/31 157/2/31 159/3/31 +f 136/1/32 160/2/32 158/3/32 +f 133/1/31 159/2/31 161/3/31 +f 136/1/32 162/2/32 160/3/32 +f 133/1/33 161/2/33 163/3/33 +f 136/1/34 164/2/34 162/3/34 +f 133/1/35 163/2/35 165/3/35 +f 136/1/36 166/2/36 164/3/36 +f 133/1/37 165/2/37 167/3/37 +f 136/1/38 168/2/38 166/3/38 +f 133/1/39 167/2/39 169/3/39 +f 136/1/40 170/2/40 168/3/40 +f 133/1/41 169/2/41 171/3/41 +f 136/1/42 172/2/42 170/3/42 +f 133/1/43 171/2/43 173/3/43 +f 136/1/44 174/2/44 172/3/44 +f 133/1/45 173/2/45 175/3/45 +f 136/1/46 176/2/46 174/3/46 +f 133/1/47 175/2/47 177/3/47 +f 136/1/48 178/2/48 176/3/48 +f 133/1/49 177/2/49 179/3/49 ... [truncated message content] |
From: <he...@us...> - 2010-01-17 09:30:32
|
Revision: 146 http://simspark.svn.sourceforge.net/simspark/?rev=146&view=rev Author: hedayat Date: 2010-01-17 09:30:24 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Updated some documentation Updated simspark release notes and NEWS file Bumped simspark package and library versions Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/doc/users/definitions.tex trunk/rcssserver3d/doc/users/gettingstarted.tex trunk/rcssserver3d/doc/users/simulations.tex trunk/rcssserver3d/doc/users/user-manual.tex trunk/spark/CMakeLists.txt trunk/spark/ChangeLog trunk/spark/NEWS trunk/spark/RELEASE Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/rcssserver3d/ChangeLog 2010-01-17 09:30:24 UTC (rev 146) @@ -1,5 +1,10 @@ 2010-01-17 Hedayat Vatankhah <he...@gr...> + * doc/users/gettingstarted.tex: + * doc/users/simulations.tex: + * doc/users/user-manual.tex: + - updated to reflect some new changes + * RELEASE: * NEWS: - preparing for a new release Modified: trunk/rcssserver3d/doc/users/definitions.tex =================================================================== --- trunk/rcssserver3d/doc/users/definitions.tex 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/rcssserver3d/doc/users/definitions.tex 2010-01-17 09:30:24 UTC (rev 146) @@ -128,7 +128,7 @@ \vspace*{-0.25cm} \hspace*{-3cm}% \begin{minipage}[b]{3cm} - \textsf{\Large\flushleft{February 2009}} + \textsf{\Large\flushleft{January 2010}} \end{minipage} \end{titlepage}% Modified: trunk/rcssserver3d/doc/users/gettingstarted.tex =================================================================== --- trunk/rcssserver3d/doc/users/gettingstarted.tex 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/rcssserver3d/doc/users/gettingstarted.tex 2010-01-17 09:30:24 UTC (rev 146) @@ -5,8 +5,6 @@ \section{Download and Installation Instructions} \label{section:install} -%Currently the simspark SVN builds only for Linux (the Win32 build system is not yet ported/tested, so we should focus on *nix systems. - This chapter explains how to install SimSpark on an Ubuntu Linux. It should work with slight modifications on other distributions like Fedora, Suse and especially Debian system\footnote{For more guides please visit Simspark Wiki: @@ -50,18 +48,21 @@ \begin{enumerate} \item Ruby \item The Open Dynamics Engine (ODE) -\item The boost C++ libraries +\item The Boost C++ Libraries +\item Freetype +\item Developer Image Library (DevIL) +\item OpenGL +\item SDL \end{enumerate} -The rendering of SimSpark can be omitted from the build process +Some parts of SimSpark can be omitted from the build process therefore these packages are optional: \begin{enumerate} -\item OpenGL -\item SDL -\item Freetype -\item Developer Image Library (DevIL) -\item Tiff library (libtiff) +\item wxWidgets Library +\item FMOD Sound Library +\item Latex (pdflatex): to generate developers manual +\item Doxygen: to generate API documentation \end{enumerate} \texttt{\$ sudo apt-get install g++ subversion cmake libfreetype6-dev libode0-dev libsdl-dev ruby1.8 ruby1.8-dev libdevil-dev libboost-dev libboost-thread-dev libboost-regex-dev} @@ -145,7 +146,7 @@ \item Run the simulation -\texttt{\$ simspark} +\texttt{\$ rcsoccersim3d} \item Optionally @@ -197,7 +198,7 @@ \item{Start the Server} The first step is to start the simulation server. To do this type -\texttt{simspark} on the console. The server is by default configured +\texttt{rcssserver3d} on the console. The server is by default configured to run without internal monitor support and to start the soccer simulation. @@ -206,7 +207,7 @@ \begin{verbatim} -simspark, a monolithic simulator 0.1 +rcssserver3d, a monolithic simulator 0.6.x Copyright (C) 2004 Markus Rollmann, Universit�t Koblenz. Copyright (C) 2004, The RoboCup Soccer Server Maintenance Group. Modified: trunk/rcssserver3d/doc/users/simulations.tex =================================================================== --- trunk/rcssserver3d/doc/users/simulations.tex 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/rcssserver3d/doc/users/simulations.tex 2010-01-17 09:30:24 UTC (rev 146) @@ -9,7 +9,7 @@ \subsection{Overview} -We implemented a simulation for SimSpark where two teams of up to 5 +We implemented a simulation for SimSpark where two teams of up to 6 humanoid robots play soccer against each other. This seemingly simple setup poses a challenge to agent implementers on several levels. @@ -48,12 +48,12 @@ \subsection{Environment and Objects on the Field} -The dimensions of the soccer field are 50 by 32 meters. The center -spot has a radius of 4.5 meters. Each goal is 9 by 2 meter with a -height of 4 meters. The soccer field is surrounded by a border of 10 +The dimensions of the soccer field are 18 by 12 meters. The center +spot has a radius of 4.5 meters. Each goal is 2.1 by 0.6 meter with a +height of 0.8 meters. The soccer field is surrounded by a border of 10 meters in each direction. Space outside this border area is not -reachable by an agent. The soccer ball has a radius of 0.4 meter and a -mass of 430 gram. +reachable by an agent. The soccer ball has a radius of 0.04 meter and a +mass of 26 grams. At each corner of the soccer field, and at the goal posts, a distinctive flag is placed. The positions of these flags are fixed and known to Modified: trunk/rcssserver3d/doc/users/user-manual.tex =================================================================== --- trunk/rcssserver3d/doc/users/user-manual.tex 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/rcssserver3d/doc/users/user-manual.tex 2010-01-17 09:30:24 UTC (rev 146) @@ -4,7 +4,7 @@ \\ Feng Xue \\ Marian Buchta \\ Hedayat Vatankhah} \title{Simspark User Manual} -\date{February 2009} +\date{January 2010} \begin{document} Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/spark/CMakeLists.txt 2010-01-17 09:30:24 UTC (rev 146) @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(simspark CXX C) -set(PACKAGE_VERSION "0.1.2") +set(PACKAGE_VERSION "0.2") ########## check for headerfiles/libraries ########## include(CheckIncludeFile) @@ -143,15 +143,15 @@ set(SALT_SO_VERSION 0) set(SALT_VERSION ${SALT_SO_VERSION}.3.2) set(ZEITGEIST_SO_VERSION 3) -set(ZEITGEIST_VERSION ${ZEITGEIST_SO_VERSION}.0.2) +set(ZEITGEIST_VERSION ${ZEITGEIST_SO_VERSION}.1.0) set(OXYGEN_SO_VERSION 3) -set(OXYGEN_VERSION ${OXYGEN_SO_VERSION}.2.4) +set(OXYGEN_VERSION ${OXYGEN_SO_VERSION}.3.0) set(KEROSIN_SO_VERSION 1) set(KEROSIN_VERSION ${KEROSIN_SO_VERSION}.0.2) set(SPARK_SO_VERSION 0) set(SPARK_VERSION ${SPARK_SO_VERSION}.0.0) set(RCSSNET_SO_VERSION 0) -set(RCSSNET_VERSION ${RCSSNET_SO_VERSION}.0.0) +set(RCSSNET_VERSION ${RCSSNET_SO_VERSION}.1.0) ########## additional variables for -config scripts ########## set(prefix ${CMAKE_INSTALL_PREFIX}) Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/spark/ChangeLog 2010-01-17 09:30:24 UTC (rev 146) @@ -1,5 +1,9 @@ 2010-01-17 Hedayat Vatankhah <he...@gr...> + * NEWS: + * RELEASE: + - preparing for the new release (0.2) + * lib/oxygen/proxyserver/agentproxy.cpp: - added a temporary workaround to allow compilation under windows @@ -7,6 +11,8 @@ - add required third party .dlls on windows to simspark rather than rcssserver3d, which will be installed in lib/thirdparty directory. ruby dlls will be included too. + - bumped library major versions: zeitgeist, oxygen and rcssnet + - bumped package version to 0.2 2010-01-01 Hedayat Vatankhah <he...@gr...> Modified: trunk/spark/NEWS =================================================================== --- trunk/spark/NEWS 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/spark/NEWS 2010-01-17 09:30:24 UTC (rev 146) @@ -1,3 +1,37 @@ +[0.2] +In this release you can find some bug and compilation fixes, improved Windows +support and some new features including a new sensor and features to facilitate +agent debugging and development. It also provides a more deterministic behavior +for agents which should make them more reliable. + +* New features: + - An Accelerometer sensor which reports the linear acceleration + - A "Sync Mode" operation is introduced. In this mode, the server will not + advance to the next cycle until all connected agents send a "(syn)" command + to the server. You can use this mode by setting "agentSyncMode" to true in + simspark.rb (or spark.rb) + - Simulator will run in simulation time mode instead of real time + if "useRealTime" variable is set to false in simspark.rb (or spark.rb) + +* More deterministic agent-server communication + - Simspark will now collect received commands right before sending + sense data of the last cycle. So, any commands which is sent by agents + after receiving new sense data will be executed in the next cycle, not the + current one. This results in a more deterministic behavior, and agents' + efficiency should not change between remote and local runs considerably. + +* More convenience: + - Simspark should always accept connections. No more "Connection refused" + messages and the need to wait for simspark's network port to be freed! + - To make changes to most of the resource files (e.g. simspark.rb), you can + create a copy in ~/.simspark directory and make desired changes there. The + directory structure of the original files should be preserved (e.g. + rsg/agent/nao/nao.rgs) + +* Fixes: + - Compilation fixes + - Fixed some rendering bugs (agents not visible through goals) + [0.1.2] This release brings some bugfixes, better performance and also better Windows support. A Windows installer will be available too. This is the first version Modified: trunk/spark/RELEASE =================================================================== --- trunk/spark/RELEASE 2010-01-16 23:52:20 UTC (rev 145) +++ trunk/spark/RELEASE 2010-01-17 09:30:24 UTC (rev 146) @@ -1,29 +1,37 @@ -RELEASE News of simspark-0.1.3 (in progress) +RELEASE News of simspark-0.2 -SOME INTERESTING COMMENTS! +In this release you can find some bug and compilation fixes, improved Windows +support and some new features including a new sensor and features to facilitate +agent debugging and development. It also provides a more deterministic behavior +for agents which should make them more reliable. -Main changes of this release are: - - Compilation fixes - - Improved Windows support - - Simspark should always accept connections. No more "Connection refused" - messages and the need to wait for simspark's network port to be freed! +* New features: + - An Accelerometer sensor which reports the linear acceleration + - A "Sync Mode" operation is introduced. In this mode, the server will not + advance to the next cycle until all connected agents send a "(syn)" command + to the server. You can use this mode by setting "agentSyncMode" to true in + simspark.rb (or spark.rb) + - Simulator will run in simulation time mode instead of real time + if "useRealTime" variable is set to false in simspark.rb (or spark.rb) + +* More deterministic agent-server communication - Simspark will now collect received commands right before sending sense data of the last cycle. So, any commands which is sent by agents after receiving new sense data will be executed in the next cycle, not the current one. This results in a more deterministic behavior, and agents' efficiency should not change between remote and local runs considerably. - - An Accelerometer sensor - - Fixed some rendering bugs (agents not visible through goals) - - A "Sync Mode" operation is introduced. In this mode, the server will not - advance to the next cycle untill all connected agents send a "(syn)" command - to the server. You can use this mode by setting "agentSyncMode" to true in - simspark.rb (or spark.rb) - - Simulator will run in simulation time mode instead of real time - if "useRealTime" variable is set to false in simspark.rb (or spark.rb) + +* More convenience: + - Simspark should always accept connections. No more "Connection refused" + messages and the need to wait for simspark's network port to be freed! - To make changes to most of the resource files (e.g. simspark.rb), you can create a copy in ~/.simspark directory and make desired changes there. The directory structure of the original files should be preserved (e.g. rsg/agent/nao/nao.rgs) +* Fixes: + - Compilation fixes + - Fixed some rendering bugs (agents not visible through goals) + You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-28 21:10:11
|
Revision: 185 http://simspark.svn.sourceforge.net/simspark/?rev=185&view=rev Author: a-held Date: 2010-02-28 21:10:01 +0000 (Sun, 28 Feb 2010) Log Message: ----------- Replace some ODE constants with their actual values in rsgedit files Declare SetParameter in joint.h because rsgedit calls it (even though it's not implemented and not meant to be implemented there) Modified Paths: -------------- trunk/rsgedit/src/kinematicframe.cpp trunk/rsgedit/src/property.cpp trunk/spark/lib/oxygen/physicsserver/joint.h Modified: trunk/rsgedit/src/kinematicframe.cpp =================================================================== --- trunk/rsgedit/src/kinematicframe.cpp 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/rsgedit/src/kinematicframe.cpp 2010-02-28 21:10:01 UTC (rev 185) @@ -101,17 +101,17 @@ strType = wxT("?"); break; - case dJointTypeUniversal: + case /*dJointTypeUniversal*/ 5: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpUniversal); strType = wxT("Universal"); break; - case dJointTypeHinge: + case /*dJointTypeHinge*/ 2: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpHinge); strType = wxT("Hinge"); break; - case dJointTypeSlider: + case /*dJointTypeSlider*/ 3: bmp = new wxStaticBitmap(mCtrScrollWnd, wxID_ANY, mBmpSlider); strType = wxT("Slider"); break; @@ -209,10 +209,10 @@ switch (jt) { - case dJointTypeFixed: + case 7 /*dJointTypeFixed*/: break; - case dJointTypeUniversal: + case 5 /*dJointTypeUniversal*/: AddJointDescription(joint); AddJointControl(joint, 0); AddJointControl(joint, 1); @@ -280,7 +280,7 @@ default: break; - case dJointTypeSlider: + case 3: //dJointTypeSlider: { shared_ptr<SliderJoint> sliderJoint = shared_static_cast<SliderJoint>(entry.joint.lock()); @@ -288,7 +288,7 @@ break; } - case dJointTypeUniversal: + case 5: //dJointTypeUniversal: { shared_ptr<UniversalJoint> universal = shared_static_cast<UniversalJoint>(entry.joint.lock()); @@ -296,7 +296,7 @@ break; } - case dJointTypeHinge: + case 2: //dJointTypeHinge: { shared_ptr<HingeJoint> hinge = shared_static_cast<HingeJoint>(entry.joint.lock()); @@ -323,7 +323,7 @@ JointControl& entry = (*iter).second; shared_ptr<Joint> joint(shared_static_cast<Joint>(entry.joint.lock())); - joint->SetParameter(dParamVel, 0); + joint->SetParameter(2 /*dParamVel*/, 0); } float kinematicFrame::GetJointVel(float diff) @@ -334,7 +334,7 @@ int kinematicFrame::GetParamVel(int axis) const { - return (axis == 0) ? dParamVel : dParamVel2; + return (axis == 0) ? 2 /*dParamVel*/ : 258 /*dParamVel2*/; } void kinematicFrame::MoveJoint(JointControl& entry) @@ -346,7 +346,7 @@ default: break; - case dJointTypeHinge: + case 2: //dJointTypeHinge: { shared_ptr<HingeJoint> hinge = shared_static_cast<HingeJoint>(entry.joint.lock()); @@ -363,7 +363,7 @@ break; } - case dJointTypeUniversal: + case 5: //dJointTypeUniversal: { shared_ptr<UniversalJoint> universal = shared_static_cast<UniversalJoint>(entry.joint.lock()); Modified: trunk/rsgedit/src/property.cpp =================================================================== --- trunk/rsgedit/src/property.cpp 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/rsgedit/src/property.cpp 2010-02-28 21:10:01 UTC (rev 185) @@ -274,20 +274,20 @@ const ContactJointHandler& cjh = *shared_static_cast<ContactJointHandler>(leaf); int mode = cjh.GetContactMode(); - wxString strMode = - FORMAT_FLAG(mode, dContactMu2) + - FORMAT_FLAG(mode, dContactFDir1) + - FORMAT_FLAG(mode, dContactBounce) + - FORMAT_FLAG(mode, dContactSoftERP) + - FORMAT_FLAG(mode, dContactSoftCFM) + - FORMAT_FLAG(mode, dContactMotion1) + - FORMAT_FLAG(mode, dContactMotion2) + - FORMAT_FLAG(mode, dContactSlip1) + - FORMAT_FLAG(mode, dContactSlip2) + - FORMAT_FLAG(mode, dContactApprox0) + - FORMAT_FLAG(mode, dContactApprox1_1) + - FORMAT_FLAG(mode, dContactApprox1_2) + - FORMAT_FLAG(mode, dContactApprox1); + wxString strMode = //replace ODE constants with their actual values + FORMAT_FLAG(mode, 1 /*dContactMu2*/) + + FORMAT_FLAG(mode, 2 /*dContactFDir1*/) + + FORMAT_FLAG(mode, 4 /*dContactBounce*/) + + FORMAT_FLAG(mode, 8 /*dContactSoftERP*/) + + FORMAT_FLAG(mode, 16 /*dContactSoftCFM*/) + + FORMAT_FLAG(mode, 32 /*dContactMotion1*/) + + FORMAT_FLAG(mode, 64 /*dContactMotion2*/) + + FORMAT_FLAG(mode, 256 /*dContactSlip1*/) + + FORMAT_FLAG(mode, 512 /*dContactSlip2*/) + + FORMAT_FLAG(mode, 0 /*dContactApprox0*/) + + FORMAT_FLAG(mode, 4096 /*dContactApprox1_1*/) + + FORMAT_FLAG(mode, 8192 /*dContactApprox1_2*/) + + FORMAT_FLAG(mode, 12288 /*dContactApprox1*/); entries.push_back(Entry(wxT("GetContactMode"),strMode)); entries.push_back(Entry(wxT("GetBounceValue"),FormatFloat(cjh.GetBounceValue()))); Modified: trunk/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/joint.h 2010-02-28 12:56:26 UTC (rev 184) +++ trunk/spark/lib/oxygen/physicsserver/joint.h 2010-02-28 21:10:01 UTC (rev 185) @@ -270,6 +270,11 @@ /** Whether limit jointMaxSpeed2 */ bool IsLimitJointMaxSpeed2() const; + + /** This has to be declared here because rsgedit upcasts to Joint + at one point and then calls this. + */ + virtual void SetParameter(int parameter, float value){}; protected: /** associates the created joint with this node */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2010-03-30 11:33:09
|
Revision: 190 http://simspark.svn.sourceforge.net/simspark/?rev=190&view=rev Author: yxu Date: 2010-03-30 11:33:03 +0000 (Tue, 30 Mar 2010) Log Message: ----------- Sense lines on the field (the first working version) Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg trunk/rcssserver3d/plugin/soccer/CMakeLists.txt trunk/rcssserver3d/plugin/soccer/export.cpp trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp trunk/spark/lib/salt/CMakeLists.txt Added Paths: ----------- trunk/rcssserver3d/data/rsg/agent/fieldline.rsg trunk/rcssserver3d/data/rsg/agent/fieldring.rsg trunk/rcssserver3d/plugin/soccer/line/ trunk/rcssserver3d/plugin/soccer/line/line.cpp trunk/rcssserver3d/plugin/soccer/line/line.h trunk/rcssserver3d/plugin/soccer/line/line_c.cpp trunk/spark/lib/salt/line2.h trunk/spark/lib/salt/linesegment2.h Added: trunk/rcssserver3d/data/rsg/agent/fieldline.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/fieldline.rsg (rev 0) +++ trunk/rcssserver3d/data/rsg/agent/fieldline.rsg 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,27 @@ +; -*- mode: lisp; -*- +; +; create a field line from ($BegX $BegY) to ($EndX $EndY) +; + +(RSG 0 1) +( + (templ $BegX $BegY $EndX $EndY) + + (nd Transform + (nd Line + (setBeginPoint $BegX $BegY 0) + (setEndPoint $EndX $EndY 0) + ) + ) + + ;; (def $centerX (eval (eval $BegX + $EndX) / 2.0)) + ;; (def $centerY (eval (eval $BegY + $EndY) / 2.0)) + ;; (def $lengthY (eval (eval $EndY - $BegY) / 2.0)) + + ;; (nd Transform + ;; (setLocalPos $centerX $centerY 0) + ;; (nd Box + ;; (setExtents 0.1 $lengthY 0.1) + ;; ) + ;; ) + ) \ No newline at end of file Added: trunk/rcssserver3d/data/rsg/agent/fieldring.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/fieldring.rsg (rev 0) +++ trunk/rcssserver3d/data/rsg/agent/fieldring.rsg 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,89 @@ +; -*- mode: lisp; -*- +; +; create a field ring with radius $Radius +; + +(RSG 0 1) +( + (templ $Radius) + + (def $px0 1.0) + (def $py0 0.0) + + (def $px36 0.80901699437494745) + (def $py36 0.58778525229247314) + + (def $px72 0.30901699437494745) + (def $py72 0.95105651629515353) + + (def $px108 -0.30901699437494734) + (def $py108 0.95105651629515364) + + (def $px144 -0.80901699437494734) + (def $py144 0.58778525229247325) + + (def $px180 -1.0) + (def $py180 0.0) + + (def $px216 $px144) + (def $py216 (eval -1 * $py144)) + + (def $px252 $px108) + (def $py252 (eval -1 * $py108)) + + (def $px288 $px72) + (def $py288 (eval -1 * $py72)) + + (def $px324 $px36) + (def $py324 (eval -1 * $py36)) + + (importScene rsg/agent/fieldline.rsg + $px0 $py0 + $px36 $py36 + ) + + (importScene rsg/agent/fieldline.rsg + $px36 $py36 + $px72 $py72 + ) + + (importScene rsg/agent/fieldline.rsg + $px72 $py72 + $px108 $py108 + ) + + (importScene rsg/agent/fieldline.rsg + $px108 $py108 + $px144 $py144 + ) + + (importScene rsg/agent/fieldline.rsg + $px144 $py144 + $px180 $py180 + ) + + (importScene rsg/agent/fieldline.rsg + $px180 $py180 + $px216 $py216 + ) + + (importScene rsg/agent/fieldline.rsg + $px216 $py216 + $px252 $py252 + ) + + (importScene rsg/agent/fieldline.rsg + $px252 $py252 + $px288 $py288 + ) + + (importScene rsg/agent/fieldline.rsg + $px288 $py288 + $px324 $py324 + ) + + (importScene rsg/agent/fieldline.rsg + $px324 $py324 + $px0 $py0 + ) + ) Modified: trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2010-03-30 11:33:03 UTC (rev 190) @@ -10,6 +10,8 @@ (def $FieldWidth (eval Soccer.FieldWidth)) (def $FieldHeight (eval Soccer.FieldHeight)) (def $GoalDepth (eval Soccer.GoalDepth)) + (def $PenaltyLength (eval Soccer.PenaltyLength)) + (def $PenaltyWidth (eval Soccer.PenaltyWidth)) ;; height of the field ground plane (def $FieldMaterial matGrass) @@ -22,6 +24,8 @@ (def $GoalHalfDepth (eval $GoalDepth / 2.0)) (def $FieldLengthTextureSize (eval $FieldLength / 12.0 )) (def $FieldWidthTextureSize (eval $FieldWidth / 8.0 )) + (def $PenaltyX (eval $FieldHalfLength - $PenaltyLength )) + (def $PenaltyHalfWidth (eval $PenaltyWidth * 0.5 )) (def $BorderLength (eval $FieldLength * 0.333)) (def $BorderWidth (eval $FieldWidth * 0.75)) @@ -193,7 +197,72 @@ 0 F2R ) +;; +;; add field lines +;; +;; middle line +(importScene rsg/agent/fieldline.rsg + 0 (eval -1 * $FieldHalfWidth) + 0 $FieldHalfWidth + ) +;; ground lines +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength (eval -1 * $FieldHalfWidth) + $FieldHalfLength $FieldHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $FieldHalfLength) (eval -1 * $FieldHalfWidth) + (eval -1 * $FieldHalfLength) $FieldHalfWidth + ) + +;; side lines +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength $FieldHalfWidth + (eval -1 * $FieldHalfLength) $FieldHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength (eval -1 * $FieldHalfWidth) + (eval -1 * $FieldHalfLength) (eval -1 * $FieldHalfWidth) + ) + +;; penalty lines +(importScene rsg/agent/fieldline.rsg + $PenaltyX $PenaltyHalfWidth + $PenaltyX (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + $PenaltyX $PenaltyHalfWidth + $FieldHalfLength $PenaltyHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + $PenaltyX (eval -1 * $PenaltyHalfWidth) + $FieldHalfLength (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) $PenaltyHalfWidth + (eval -1 * $PenaltyX) (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) $PenaltyHalfWidth + (eval -1 * $FieldHalfLength) $PenaltyHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) (eval -1 * $PenaltyHalfWidth) + (eval -1 * $FieldHalfLength) (eval -1 * $PenaltyHalfWidth) + ) + +;; ring +(importScene rsg/agent/fieldring.rsg + 1.8) + ;; ;; add the ball ;; Modified: trunk/rcssserver3d/plugin/soccer/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2010-03-30 11:33:03 UTC (rev 190) @@ -44,7 +44,8 @@ hmdp_effector/hmdpaction.h hmdp_effector/hmdpeffector.h hmdp_effector/hmdpperceptor.h - hmdp_effector/naospecific.h + hmdp_effector/naospecific.h + line/line.h ) set(soccer_LIB_SRCS @@ -117,6 +118,8 @@ hmdp_effector/hmdpperceptor.cpp hmdp_effector/hmdpwrapper.cpp hmdp_effector/naospecific.cpp + line/line.cpp + line/line_c.cpp ) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} Modified: trunk/rcssserver3d/plugin/soccer/export.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/export.cpp 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/plugin/soccer/export.cpp 2010-03-30 11:33:03 UTC (rev 190) @@ -53,6 +53,7 @@ #include "agentintegration/soccerbotbehavior.h" #include "hmdp_effector/hmdpeffector.h" #include "hmdp_effector/hmdpperceptor.h" +#include "line/line.h" ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(SoccerControlAspect); @@ -88,5 +89,6 @@ ZEITGEIST_EXPORT(SoccerbotBehavior); ZEITGEIST_EXPORT(HMDPPerceptor); ZEITGEIST_EXPORT(HMDPEffector); + ZEITGEIST_EXPORT(Line); ZEITGEIST_EXPORT_END() Added: trunk/rcssserver3d/plugin/soccer/line/line.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/line/line.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/line/line.cpp 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,31 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 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 "line.h" + +Line::Line() +{ + +} + +Line::~Line() +{ + +} Added: trunk/rcssserver3d/plugin/soccer/line/line.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/line/line.h (rev 0) +++ trunk/rcssserver3d/plugin/soccer/line/line.h 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,44 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 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. +*/ +#ifndef LINE_H +#define LINE_H + +#include "../soccernode/soccernode.h" + +class Line : public SoccerNode +{ +public: + Line(); + virtual ~Line(); + + salt::Vector3f& BeginPoint() { return mBeginPoint; } + salt::Vector3f& EndPoint() { return mEndPoint; } + const salt::Vector3f& BeginPoint() const { return mBeginPoint; } + const salt::Vector3f& EndPoint() const { return mEndPoint; } + +protected: + + salt::Vector3f mBeginPoint; + salt::Vector3f mEndPoint; +}; + +DECLARE_CLASS(Line); + +#endif // LINE_H Added: trunk/rcssserver3d/plugin/soccer/line/line_c.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/line/line_c.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/line/line_c.cpp 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,65 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 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 "line.h" + +using namespace boost; +using namespace oxygen; +using namespace std; + +FUNCTION(Line,setBeginPoint) +{ + salt::Vector3f& value = obj->BeginPoint(); + + if ( + (in.GetSize() != 3) || + (! in.GetValue(in[0], value[0])) || + (! in.GetValue(in[1], value[1])) || + (! in.GetValue(in[2], value[2])) + ) + { + return false; + } + return true; +} + +FUNCTION(Line,setEndPoint) +{ + salt::Vector3f& value = obj->EndPoint(); + + if ( + (in.GetSize() != 3) || + (! in.GetValue(in[0], value[0])) || + (! in.GetValue(in[1], value[1])) || + (! in.GetValue(in[2], value[2])) + ) + { + return false; + } + return true; +} + +void +CLASS(Line)::DefineClass() +{ + DEFINE_BASECLASS(SoccerNode); + DEFINE_FUNCTION(setBeginPoint); + DEFINE_FUNCTION(setEndPoint); +} Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-03-30 11:33:03 UTC (rev 190) @@ -25,6 +25,12 @@ #include <oxygen/sceneserver/transform.h> #include <soccerbase/soccerbase.h> #include <salt/gmath.h> +#include <list> +#include <X11/X.h> +#include <math.h> +#include <salt/linesegment2.h> +#include <limits> +#include <iostream> using namespace zeitgeist; using namespace oxygen; @@ -34,7 +40,8 @@ RestrictedVisionPerceptor::RestrictedVisionPerceptor() : Perceptor(), mSenseMyPos(false), mAddNoise(true), - mStaticSenseAxis(true) + mStaticSenseAxis(true), + mSenseLine(false) { // set predicate name SetPredicateName("See"); @@ -454,6 +461,11 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseLine) + { + SenseLine(predicate); + } + return true; } @@ -551,6 +563,11 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseLine) + { + SenseLine(predicate); + } + return true; } @@ -616,3 +633,233 @@ { mSenseMyPos = sense; } + +bool RestrictedVisionPerceptor::checkVisuable(RestrictedVisionPerceptor::ObjectData& od) const +{ + // theta is the angle in horizontal plane, with fwAngle as 0 degree + od.mTheta = gNormalizeDeg(gRadToDeg(gNormalizeRad( + gArcTan2(od.mRelPos[1], od.mRelPos[0]) + )) - 90); + + // latitude with fwPhi as 0 degreee + od.mPhi = gRadToDeg(gNormalizeRad( + gArcTan2(od.mRelPos[2], + Vector2f(od.mRelPos[0], od.mRelPos[1]).Length() + ) + ) + ); + + od.mDist = od.mRelPos.Length(); + if (od.mDist <= 0.1) + { + // object is too close + return false; + } + + const int hAngle_2 = mHViewCone >> 1; + if (gAbs(od.mTheta) > hAngle_2) + { + // object is out of view range + return false; + } + + const int vAngle_2 = mVViewCone >> 1; + if (gAbs(od.mPhi) > vAngle_2) + { + return false; + } + + return true; +} + +void RestrictedVisionPerceptor::SenseLine(Predicate& predicate) +{ + const float focalLength = 0.1f; + TLineList visibleLines; + SetupLines(visibleLines); + + // TODO: precalculate it + // visual range + Vector2f ru(tan(gDegToRad<double>(mHViewCone*0.5))*focalLength, tan(gDegToRad<double>(mVViewCone*0.5))*focalLength); + Vector2f rb(ru.x(), -ru.y()); + Vector2f lu(-ru.x(), ru.y()); + Vector2f lb(-ru.x(), -ru.y()); + LineSegment2f viewRangeLine[4]; + viewRangeLine[0] = LineSegment2f(lu, ru); + viewRangeLine[1] = LineSegment2f(lb, rb); + viewRangeLine[2] = LineSegment2f(lu, lb); + viewRangeLine[3] = LineSegment2f(ru, rb); + + for (TLineList::iterator i = visibleLines.begin(); i != visibleLines.end(); ) + { + LineData& ld = (*i); + + bool seeBeginPoint = checkVisuable(ld.mBeginPoint); + bool seeEndPoint = checkVisuable(ld.mEndPoint); + + if (!(seeBeginPoint && seeEndPoint)) + { + Vector3f bp3 = ld.mBeginPoint.mRelPos; + Vector3f ep3 = ld.mEndPoint.mRelPos; + + if ( bp3.y() < focalLength && ep3.y() >= focalLength ) + { + float t = ( focalLength - ep3.y() ) / ( bp3.y() - ep3.y() ); + bp3 = ep3 + ( bp3 - ep3 ) * t; + } + else if ( ep3.y() < focalLength && bp3.y() >= focalLength ) + { + float t = ( focalLength - bp3.y() ) / ( ep3.y() - bp3.y() ); + ep3 = bp3 + ( ep3 - bp3 ) * t; + } + + if ( bp3.y() > 0 && ep3.y() > 0 ) + { + Vector2f bp = Vector2f(bp3.x(), bp3.z()) * focalLength / bp3.y(); + Vector2f ep = Vector2f(ep3.x(), ep3.z()) * focalLength / ep3.y(); + LineSegment2f l(bp, ep); + + float CB = bp3.Length(); + float CE = ep3.Length(); + float BE = (bp3 - ep3).Length(); + float CEB = acos((BE * BE + CE * CE - CB * CB) / (2 * BE * CE)); + Vector3f Ef(ep.x(), focalLength, ep.y()); + float CEf = Ef.Length(); + + Vector3f X[2]; + int inum = 0; + for ( int i=0; i<4 && inum < 2; i++) + { + Vector2f ip; + if ( l.Intersection(viewRangeLine[i], ip) ) + { + Vector3f Xf(ip.x(), focalLength, ip.y()); + float CXf = Xf.Length(); + float XfEf = (Xf - Ef).Length(); + float XfCEf = acos((CXf * CXf + CEf * CEf - XfEf * XfEf) / (2 * CXf * CEf)); + float CXE = gPI - CEB - XfCEf; + float EX = CE / sin(CXE) * sin(XfCEf); + X[inum] = ep3 + (bp3 - ep3) * (EX / BE); + inum++; + } + } + + if ( inum == 2 ) + { + ld.mBeginPoint.mRelPos = X[0]; + checkVisuable(ld.mBeginPoint); + seeBeginPoint = true; + + ld.mEndPoint.mRelPos = X[1]; + checkVisuable(ld.mEndPoint); + seeEndPoint = true; + } + else if ( inum == 1 ) + { + if ( !seeBeginPoint ) + { + ld.mBeginPoint.mRelPos = X[0]; + checkVisuable(ld.mBeginPoint); + seeBeginPoint = true; + } + else + { + ld.mEndPoint.mRelPos = X[0]; + checkVisuable(ld.mEndPoint); + seeEndPoint = true; + } + } + } + } + + if (seeBeginPoint && seeEndPoint) + { + // make some noise + ApplyNoise(ld.mBeginPoint); + ApplyNoise(ld.mEndPoint); + + ++i; + } + else + { + i = visibleLines.erase(i); + } + } + + // generate a sense entry + AddSense(predicate, visibleLines); +} + +void +RestrictedVisionPerceptor::SetupLines(TLineList& visibleLines) +{ + TLeafList lineList; + mActiveScene->GetChildrenOfClass("Line", lineList, true); + + // determine position relative to the local reference frame + const Matrix& mat = mTransformParent->GetWorldTransform(); + + // get the transformation matrix describing the current orientation + Vector3f myPos = mat.Pos(); + if (mAddNoise) + { + myPos -= mError; + } + + + for (TLeafList::iterator i = lineList.begin(); i != lineList.end(); ++i) + { + LineData ld; + + ld.mLine = shared_static_cast<Line > (*i); + + if (ld.mLine.get() == 0) + { + GetLog()->Error() << "Error: (RestrictedVisionPerceptor) skipped line: " + << (*i)->GetName() << "\n"; + continue; // this should never happen + } + + boost::shared_ptr<Transform> j = ld.mLine->GetTransformParent(); + + if (j.get() == 0) + { + GetLog()->Error() << "Error: (RestrictedVisionPerceptor) skipped line (2): " + << (*i)->GetName() << "\n"; + continue; // this should never happen + } + + const salt::Matrix& t = j->GetWorldTransform(); + ld.mBeginPoint.mRelPos = mat.InverseRotate( t * ld.mLine->BeginPoint() - myPos ); + ld.mEndPoint.mRelPos = mat.InverseRotate( t * ld.mLine->EndPoint() - myPos ); + + visibleLines.push_back(ld); + } +} + +void RestrictedVisionPerceptor::AddSense(Predicate& predicate, const TLineList& lineList) const +{ + for (TLineList::const_iterator i = lineList.begin(); i != lineList.end(); ++i) + { + const LineData& ld = (*i); + ParameterList& element = predicate.parameter.AddList(); + element.AddValue(std::string("L")); + + ParameterList& begPos = element.AddList(); + begPos.AddValue(std::string("pol")); + begPos.AddValue(ld.mBeginPoint.mDist); + begPos.AddValue(ld.mBeginPoint.mTheta); + begPos.AddValue(ld.mBeginPoint.mPhi); + + ParameterList& endPos = element.AddList(); + endPos.AddValue(std::string("pol")); + endPos.AddValue(ld.mEndPoint.mDist); + endPos.AddValue(ld.mEndPoint.mTheta); + endPos.AddValue(ld.mEndPoint.mPhi); + } +} + +void RestrictedVisionPerceptor::SetSenseLine(bool sense) +{ + mSenseLine = sense; +} \ No newline at end of file Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2010-03-30 11:33:03 UTC (rev 190) @@ -29,6 +29,7 @@ #include <oxygen/sceneserver/transform.h> #include <oxygen/agentaspect/agentaspect.h> #include <agentstate/agentstate.h> +#include "../line/line.h" class RestrictedVisionPerceptor : public oxygen::Perceptor { @@ -67,6 +68,15 @@ typedef std::map<boost::shared_ptr<oxygen::BaseNode>, TObjectList> TNodeObjectsMap; + struct LineData + { + boost::shared_ptr<Line> mLine; + ObjectData mBeginPoint; + ObjectData mEndPoint; + }; + + typedef std::list<LineData> TLineList; + public: RestrictedVisionPerceptor(); virtual ~RestrictedVisionPerceptor(); @@ -94,6 +104,9 @@ //! Turn sensing of agent position on/off void SetSenseMyPos(bool sense); + // turn sensing of lines on/off + void SetSenseLine(bool sense); + /** Turn noise off/on. \param add_noise flag if noise should be used at all. */ @@ -162,6 +175,13 @@ */ bool DynamicAxisPercept(boost::shared_ptr<oxygen::PredicateList> predList); + /** Percept lines in the world */ + void SenseLine(oxygen::Predicate& predicate); + + void SetupLines(TLineList& visibleLines); + + bool checkVisuable(ObjectData& od) const; + /** Checks if the given object is occluded, seen from from my_pos */ bool CheckOcclusion(const salt::Vector3f& my_pos, const ObjectData& od) const; @@ -172,6 +192,9 @@ boost::shared_ptr<BaseNode> node, TObjectList& objectList) const; + void AddSense(oxygen::Predicate& predicate, + const TLineList& lineList) const; + /** applies noise to the setup ObjectData */ void ApplyNoise(ObjectData& od) const; @@ -201,6 +224,9 @@ */ bool mStaticSenseAxis; + /** flag if the lines can be sensed */ + bool mSenseLine; + //! horizontal opening of the vision cone unsigned int mHViewCone; //! vertical opening of the vision cone Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2010-03-30 11:33:03 UTC (rev 190) @@ -150,6 +150,22 @@ return true; } +FUNCTION(RestrictedVisionPerceptor,setSenseLine) +{ + bool inSenseLine; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inSenseLine)) + ) + { + return false; + } + + obj->SetSenseLine(inSenseLine); + return true; +} + void CLASS(RestrictedVisionPerceptor)::DefineClass() { DEFINE_BASECLASS(oxygen/Perceptor); @@ -160,4 +176,5 @@ DEFINE_FUNCTION(setViewCones); DEFINE_FUNCTION(setPanRange); DEFINE_FUNCTION(setTiltRange); + DEFINE_FUNCTION(setSenseLine); } Modified: trunk/spark/lib/salt/CMakeLists.txt =================================================================== --- trunk/spark/lib/salt/CMakeLists.txt 2010-03-28 08:27:22 UTC (rev 189) +++ trunk/spark/lib/salt/CMakeLists.txt 2010-03-30 11:33:03 UTC (rev 190) @@ -15,6 +15,8 @@ sharedlibrary.h vector.h salt_defines.h + line2.h + linesegment2.h ) set(salt_LIB_SRCS Added: trunk/spark/lib/salt/line2.h =================================================================== --- trunk/spark/lib/salt/line2.h (rev 0) +++ trunk/spark/lib/salt/line2.h 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,305 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008,2009 SEU RoboCup Simulation Team, Southeast University , Nanjing, China. + Copyright (C) 2010 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. + */ + +#ifndef _LINE2_H +#define _LINE2_H + +#include <limits> +#include "tvector.h" + +namespace salt { + +template <typename DATATYPE> +class TLine2 +{ + // a line is defined by the formula: ay + bx + c = 0 + DATATYPE mA; + DATATYPE mB; + DATATYPE mC; +public: + + /** + * create line by given coefficients + * + * @param a the a coefficients + * @param b the b coefficients + * @param c the c coefficients + */ + TLine2(DATATYPE a = 1, DATATYPE b = 0, DATATYPE c = -1) + : mA(a), mB(b), mC(c) + { + } + + /** + * create line from tow points + * + * @param pos1 the one point + * @param pos2 the other point + */ + template <typename P_T> + TLine2(const P_T &pos1, + const P_T &pos2) + { + // 1*y + bx + c = 0 => y = -bx - c + // with -b the direction coefficient (or slope) + // and c = - y - bx + DATATYPE dTemp = pos2[0] - pos1[0]; // determine the slope + if (fabs(dTemp) < std::numeric_limits<DATATYPE>::epsilon() ) { + // ay + bx + c = 0 with vertical slope=> a = 0, b = 1 + mA = 0.0; + mB = 1.0; + } else { + // y = (-b)x -c with -b the slope of the line + mA = 1.0; + mB = -(pos2[1] - pos1[1]) / dTemp; + } + // ay + bx + c = 0 ==> c = -a*y - b*x + mC = -mA * pos2.y() - mB * pos2.x(); + } + + /** + * create line from one point and an angle + * + * @param pos the point in line + * @param angle the sclope angle + */ + template <typename P_T> + TLine2(const P_T &pos, DATATYPE angle) + { + // calculate point somewhat further in direction 'angle' + // and make line from these two points. + P_T pos2 = pos; + pos2.x() += cosDeg(angle); + pos2.y() += sinDeg(angle); + *this = TLine2(pos, pos2); + } + + DATATYPE a() const + { + return mA; + } + + DATATYPE b() const + { + return mB; + } + + DATATYPE c() const + { + return mC; + } + + DATATYPE& a() + { + return mA; + } + + DATATYPE& b() + { + return mB; + } + + DATATYPE& c() + { + return mC; + } + + /** + * calculate the intersection of two lines + * + * @param line the other line + * + * @return the intersection + */ + template <typename P_T> + bool Intersection(const TLine2 &line, P_T &p) const + { + DATATYPE L = line.a() * mB - mA * line.b(); + if (abs(L) < std::numeric_limits<DATATYPE>::epsilon()) { + // lines are parallel, no intersection + return false; + } + if (mA == 0) { + // bx + c = 0 and a2*y + b2*x + c2 = 0 ==> x = -c/b + // calculate x using the current line + p.x() = -mC / mB; // and calculate the y using the second line + p.y() = line.YGivenX(p.x()); + } else if (line.a() == 0) { + // ay + bx + c = 0 and b2*x + c2 = 0 ==> x = -c2/b2 + p.x() = -line.c() / line.b(); + // calculate x using + p.y() = YGivenX(p.x()); + // 2nd line and calculate y using current line + } else { + // ay + bx + c = 0 and a2y + b2*x + c2 = 0 + // y = (-b2/a2)x - c2/a2 + // bx = -a*y - c => bx = -a*(-b2/a2)x -a*(-c2/a2) - c + // ==> a2*bx = a*b2*x + a*c2 - a2*c + // ==> x = (a*c2 - a2*c)/(a2*b - a*b2) + p.x() = (mA * line.c() - line.a() * mC) / L; + p.y() = YGivenX(p.x()); + } + return true; + } + + /** + * ay + bx + c = 0 -> y = (-b/a)x + (-c/a) + * tangent: y = (a/b)*x + C1 -> by - ax + C2 = 0 => C2 = ax - by + * with pos.y = y, pos.x = x + * + * @param pos the tangent intersection + * + * @return the tangent line of this line + */ + template<typename P_T> + TLine2 TangentLine(const P_T &pos) const + { + return TLine2(mB, -mA, mA * pos.x() - mB * pos.y()); + } + + /** + * calculate the closest point of a given point to this line + * + * @param pos the given point + * + * @return the closest point + */ + template<typename P_T> + P_T PointOnLineClosestTo(const P_T &pos) const + { + TLine2 l2 = TangentLine(pos); // get tangent line + // and intersection between the two lines + return Intersection(l2); + } + + /** + * calculate the distance from a given point to this line + * + * @param pos the given point + * + * @return the distance from the pos to this line + */ + template<typename P_T> + DATATYPE DistanceToPoint(const P_T &pos) const + { + return (PointOnLineClosestTo(pos) - pos).length(); + } + + /** + * calculate the Y value by given X value + * + * @param x the given x coordinate value + * + * @return the Y coordinate value + */ + DATATYPE YGivenX(DATATYPE x) const + { + if (mA == 0) { + std::cerr << __FILE__ << __LINE__ << __FUNCTION__ + << " Cannot calculate Y coordinate: " << std::endl; + return 0; + } + // ay + bx + c = 0 ==> y = -(b*x + c)/a + return -(mB * x + mC) / mA; + } + + /** + * calculate the X value by given Y value + * + * @param y the given Y coordinate value + * + * @return the X coordinate value + */ + DATATYPE XGivenY(DATATYPE y) const + { + if (mB == 0) { + std::cerr << __FILE__ << __LINE__ << __FUNCTION__ + << "Cannot calculate X coordinate\n" << std::endl; + return 0; + } + // ay + bx + c = 0 ==> x = -(a*y + c)/b + return -(mA * y + mC) / mB; + } + + /** + * calculate the location of point to the line + * + * @param p the given point + * + * @return +1 means upper the line + * 0 means on the line + * -1 means lower the line + */ + template <typename P_T> + int Location(const P_T & p)const + { + return sign(mA * p.y() + mB * p.x() + mC); + } + + /** + * calculate the ang for line + */ + DATATYPE GetAngle() + { + return atan2(-mB, mA); + } + + /** + * @param[in] pos1 first point + * @param pos2 second point + * @return + */ + template<typename P_T> + static TLine2 MidperpendicularFromTwoPoints(const P_T &pos1, const P_T &pos2) + { + TLine2 l1(pos1, pos2); + P_T posMid = (pos1 + pos2)*0.5; + return l1.TangentLine(posMid); + } + +}; + +/// dump + +template<typename DATATYPE> +std::ostream & operator <<(std::ostream & os, TLine2<DATATYPE> l) +{ + DATATYPE a = l.a(); + DATATYPE b = l.b(); + DATATYPE c = l.c(); + // ay + bx + c = 0 -> y = -b/a x - c/a + if (a == 0) { + os << "x = " << -c / b; + } else { + os << "y = "; + if (b != 0) + os << -b / a << "x "; + if (c > 0) + os << "- " << fabs(c / a); + else if (c < 0) + os << "+ " << fabs(c / a); + } + return os; +} + +} // namespace salt +#endif /* _LINE2_H */ + Added: trunk/spark/lib/salt/linesegment2.h =================================================================== --- trunk/spark/lib/salt/linesegment2.h (rev 0) +++ trunk/spark/lib/salt/linesegment2.h 2010-03-30 11:33:03 UTC (rev 190) @@ -0,0 +1,129 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2008,2009 SEU RoboCup Simulation Team, Southeast University , Nanjing, China. + Copyright (C) 2010 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. + */ + +#ifndef _LINESEGMENT2_H +#define _LINESEGMENT2_H + +#include "line2.h" + +namespace salt { + +template <typename DATATYPE, typename P_T> +class TLineSegment2 : public TLine2<DATATYPE> +{ + /// endpoints + P_T mP[2]; +public: + + TLineSegment2() + { + } + + TLineSegment2(const P_T & p0, const P_T & p1) + : TLine2<DATATYPE>(p0, p1) + { + mP[0] = p0; + mP[1] = p1; + } + + const P_T & p0() const + { + return mP[0]; + } + + const P_T & p1() const + { + return mP[1]; + } + + bool IsBetween(const P_T & p) const + { + return p[0] <= std::max(mP[0][0], mP[1][0]) + && p[0] >= std::min(mP[0][0], mP[1][0]) + && p[1] <= std::max(mP[0][1], mP[1][1]) + && p[1] >= std::min(mP[0][1], mP[1][1]); + } + + DATATYPE Length() const + { + return ( mP[0] - mP[1]).Length(); + } + + bool IsContain(const P_T & p) const + { + return (p - mP[0]).Length() + (p - mP[1]).Length() + < Length() + std::numeric_limits<DATATYPE>::epsilon(); + } + + /** + * calculate the intersection of the segment and a given line + * + * @param line the given line + * @param intersection retrun the intersection + * + * @return if the segment and line have intersection + */ + bool IntersectionWithLine(const TLine2<DATATYPE>& line, + P_T & intersection)const + { + if ( TLine2<DATATYPE>::Intersection(line, intersection) ) + { + return IsBetween(intersection); + } + return false; + } + + /** + * calculate the interseciton of two segment + * + * @param seg2 the other segment + * @param intersection return the intersection + * + * @return if the tow segments have intersection + */ + bool Intersection(const TLineSegment2& seg2, + P_T & intersection)const + { + if (IntersectionWithLine(seg2, intersection)) { + return seg2.IsBetween(intersection); + } + return false; + } + + /** + * if there is an intersection of two segment + * + * @param seg2 the other segment + * + * @return if the tow segments have intersection + */ + bool IsIntersect(const TLineSegment2& seg2) const + { + P_T intersection; + return Intersection(seg2, intersection); + } +}; + +typedef TLineSegment2<float, Vector2f> LineSegment2f; + +} // namespace salt +#endif /* _LINESEGMENT2_H */ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2010-06-01 13:05:11
|
Revision: 207 http://simspark.svn.sourceforge.net/simspark/?rev=207&view=rev Author: sgvandijk Date: 2010-06-01 13:04:58 +0000 (Tue, 01 Jun 2010) Log Message: ----------- - Merge agentselection branch -r206 into trunk Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg trunk/rcssserver3d/data/scripts/rcs-materials-textures.rb trunk/rcssserver3d/data/scripts/rcs-materials.rb trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h trunk/rcssserver3d/plugin/soccermonitor/soccerinput.cpp trunk/rcssserver3d/plugin/soccermonitor/soccerinput.h trunk/rcssserver3d/plugin/soccermonitor/soccerrender.cpp trunk/rcssserver3d/plugin/soccermonitor/soccerrender.h trunk/rcssserver3d/rcssmonitor3d/soccerbindings.rb trunk/rcssserver3d/rcssmonitor3d/soccersim-monitor.rb trunk/spark/data/scripts/materials.rb trunk/spark/lib/kerosin/inputserver/input.h trunk/spark/lib/kerosin/inputserver/inputcontrol.cpp trunk/spark/lib/kerosin/inputserver/inputserver.cpp trunk/spark/lib/kerosin/renderserver/rendernode.cpp trunk/spark/lib/kerosin/renderserver/rendernode.h trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp trunk/spark/lib/kerosin/renderserver/renderserver.cpp trunk/spark/lib/kerosin/sceneserver/singlematnode_c.cpp trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp trunk/spark/plugin/inputsdl/keyboardsdl.cpp trunk/spark/plugin/inputsdl/mousesdl.cpp trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/treehole:175 + /branches/agentselection:195-206 /branches/treehole:175 Modified: trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/data/rsg/agent/nao/nao.rsg 2010-06-01 13:04:58 UTC (rev 207) @@ -68,6 +68,15 @@ (setName AgentState) (nd GameStatePerceptor) (nd HearPerceptor) + (nd Transform + (nd Cylinder + (setName SelectionMarker) + (setParams 1.0 1.0) + (setScale 0.2 0.2 0.02) + (setMaterial matSelect) + (setTransparent) + ) + ) ) (nd GyroRatePerceptor (setName torso)) Modified: trunk/rcssserver3d/data/scripts/rcs-materials-textures.rb =================================================================== --- trunk/rcssserver3d/data/scripts/rcs-materials-textures.rb 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/data/scripts/rcs-materials-textures.rb 2010-06-01 13:04:58 UTC (rev 207) @@ -19,7 +19,6 @@ material.setDiffuse(1.0,0.64,0.4,1.0) material.setAmbient(0.2,0.01,0.0,1.0) - # grass # without lines Modified: trunk/rcssserver3d/data/scripts/rcs-materials.rb =================================================================== --- trunk/rcssserver3d/data/scripts/rcs-materials.rb 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/data/scripts/rcs-materials.rb 2010-06-01 13:04:58 UTC (rev 207) @@ -22,7 +22,6 @@ material.setDiffuse(0.1,0.6,0.1,1.0) material.setAmbient(0.1,0.3,0.1,1.0) - #---------------------------------------------------------------- # left team #---------------------------------------------------------------- Modified: trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -23,9 +23,11 @@ #include <soccertypes.h> #include <soccerbase/soccerbase.h> #include <gamestateaspect/gamestateaspect.h> +#include <kerosin/renderserver/rendernode.h> #include <sstream> using namespace oxygen; +using namespace kerosin; using namespace std; AgentState::AgentState() : ObjectState(), mTeamIndex(TI_NONE), @@ -33,7 +35,8 @@ mHearMax(2), mHearInc(1), mHearDecay(2), mHearMateCap(2), mHearOppCap(2), mIfSelfMsg(false), - mIfMateMsg(false), mIfOppMsg(false) + mIfMateMsg(false), mIfOppMsg(false), + mSelected(false) { // set mID and mUniformNumber into a joint state SetUniformNumber(0); @@ -211,6 +214,18 @@ } void +AgentState::UpdateHierarchyInternal() +{ + boost::shared_ptr<RenderNode> node = boost::shared_dynamic_cast<RenderNode>(GetChild("SelectionMarker", true)); + if (!node) + { + GetLog()->Error() << "ERROR: (AgentState::UpdateHierarchyInternal) could not find selection marker\n"; + return; + } + node->SetVisible(mSelected); +} + +void AgentState::OnUnlink() { ObjectState::OnUnlink(); @@ -226,3 +241,20 @@ game_state->ReturnUniform(GetTeamIndex(), GetUniformNumber()); } +bool +AgentState::IsSelected() const +{ + return mSelected; +} + +void +AgentState::Select(bool s) +{ + mSelected = s; +} + +void +AgentState::UnSelect() +{ + mSelected = false; +} Modified: trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h 2010-06-01 13:04:58 UTC (rev 207) @@ -91,6 +91,10 @@ bool GetMessage(std::string& msg, float& direction, bool teamMate); bool GetSelfMessage(std::string& msg); + bool IsSelected() const; + void Select(bool s = true); + void UnSelect(); + protected: /** team index */ TTeamIndex mTeamIndex; @@ -134,7 +138,9 @@ /** is there any message from oponnent */ bool mIfOppMsg; + bool mSelected; protected: + virtual void UpdateHierarchyInternal(); virtual void OnUnlink(); }; Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -486,6 +486,48 @@ } void +SoccerRuleAspect::ClearSelectedPlayers() +{ + float min_dist = mFreeKickMoveDist; + std::list<boost::shared_ptr<AgentState> > agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) + return; + + boost::shared_ptr<oxygen::Transform> agent_aspect; + std::list<boost::shared_ptr<AgentState> >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + { + SoccerBase::GetTransformParent(**i, agent_aspect); + + // if agent is selected, move it away + Vector3f new_pos = agent_aspect->GetWorldTransform().Pos(); + + if ((*i)->IsSelected()) + { + float dist = salt::UniformRNG<>(min_dist, min_dist + 2.0)(); + + if ((*i)->GetTeamIndex() == TI_LEFT) + { + if (new_pos[0] - dist < -mFieldLength/2.0) + { + new_pos[1] = new_pos[1] < 0 ? new_pos[1] + dist : new_pos[1] - dist; + } else { + new_pos[0] = new_pos[0] - dist; + } + } else { + if (new_pos[0] + dist > mFieldLength/2.0) + { + new_pos[1] = new_pos[1] < 0 ? new_pos[1] + dist : new_pos[1] - dist; + } else { + new_pos[0] = new_pos[0] + dist; + } + } + SoccerBase::MoveAgent(agent_aspect, new_pos); + } + } +} + +void SoccerRuleAspect::DropBall() { DropBall(mBallBody->GetPosition()); @@ -1638,7 +1680,51 @@ } } -Vector2f SoccerRuleAspect::GetFieldSize() const +Vector2f +SoccerRuleAspect::GetFieldSize() const { return Vector2f(mFieldLength,mFieldWidth); } + +void +SoccerRuleAspect::ResetAgentSelection() +{ + std::list<boost::shared_ptr<AgentState> > agent_states; + if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) + { + + std::list<boost::shared_ptr<AgentState> >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + (*i)->UnSelect(); + } +} + +void +SoccerRuleAspect::SelectNextAgent() +{ + std::list<boost::shared_ptr<AgentState> > agent_states; + bool selectNext = false; + if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE) && agent_states.size() > 0) + { + boost::shared_ptr<AgentState> first = agent_states.front(); + + std::list<boost::shared_ptr<AgentState> >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + { + if ((*i)->IsSelected()) + { + (*i)->UnSelect(); + selectNext = true; + continue; + } + else if (selectNext) + { + (*i)->Select(); + return; + } + } + + // No agent selected, select first + first->Select(); + } +} Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2010-06-01 13:04:58 UTC (rev 207) @@ -45,7 +45,7 @@ { public: typedef std::list<boost::shared_ptr<AgentState> > TAgentStateList; - + public: SoccerRuleAspect(); virtual ~SoccerRuleAspect(); @@ -139,6 +139,12 @@ salt::Vector2f GetFieldSize() const; + void ResetAgentSelection(); + + void SelectNextAgent(); + + void ClearSelectedPlayers(); + protected: /** rereads the current soccer script values */ virtual void UpdateCachedInternal(); @@ -233,7 +239,7 @@ * @param idx the team which kick off */ void ClearPlayersBeforeKickOff(TTeamIndex idx); - + protected: /** reference to the body node of the Ball */ boost::shared_ptr<oxygen::RigidBody> mBallBody; Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -29,10 +29,12 @@ #include <agentstate/agentstate.h> #include <soccertypes.h> #include <gamestateaspect/gamestateaspect.h> +#include <oxygen/agentaspect/agentaspect.h> #include "trainercommandparser.h" using namespace std; using namespace boost; +using namespace salt; using namespace zeitgeist; using namespace oxygen; @@ -45,7 +47,10 @@ mCommandMap["dropBall"] = CT_DROP_BALL; mCommandMap["kickOff"] = CT_KICK_OFF; mCommandMap["getAck"] = CT_ACK; - + mCommandMap["select"] = CT_SELECT; + mCommandMap["kill"] = CT_KILL; + mCommandMap["repos"] = CT_REPOS; + // setup team index map // Originally team sides were "L","R" and "N" // But this seems to be unused @@ -106,6 +111,15 @@ GetLog()->Error() << "ERROR: (TrainerCommnadParser) failed to create SexpParser\n"; return; } + + mGameControl = shared_dynamic_cast<GameControlServer> + (GetCore()->Get("/sys/server/gamecontrol")); + + if (mGameControl.get() == 0) + { + GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get GameControlServer\n"; + } + } void TrainerCommandParser::OnUnlink() @@ -145,6 +159,8 @@ bool TrainerCommandParser::ParsePredicate(const oxygen::Predicate & predicate) { + cerr << "repos 1" << endl; + SoccerBase::GetGameState(*this,mGameState); SoccerBase::GetSoccerRuleAspect(*this,mSoccerRule); @@ -189,6 +205,15 @@ break; } + case CT_SELECT: + ParseSelectCommand(predicate); + break; + case CT_KILL: + ParseKillCommand(predicate); + break; + case CT_REPOS: + ParseReposCommand(predicate); + break; default: return false; } @@ -200,17 +225,17 @@ { Predicate::Iterator unumParam(predicate); int unum; + bool specified = true; // extract unum if (predicate.FindParameter(unumParam, "unum")) { if (! predicate.GetValue(unumParam, unum)) - { - GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get unum\n"; - return; - } + specified = false; } - + else + specified = false; + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -219,26 +244,29 @@ if (predicate.FindParameter(teamParam, "team")) { if (! predicate.GetValue(teamParam, team)) - { - GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get team name\n"; - return; - } - - idx = mTeamIndexMap[team]; + specified = false; + else + idx = mTeamIndexMap[team]; } + else + specified = false; + if (!specified) + { + mSoccerRule->ClearSelectedPlayers(); + return; + } SoccerBase::TAgentStateList agentStates; - SoccerBase::GetAgentStates(*this, agentStates, idx); + SoccerBase::GetAgentStates(*this, agentStates, (specified ? idx : TI_NONE)); SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); bool found = false; while (iter != agentStates.end() && !found) { - if ((*iter)->GetUniformNumber() == unum) - { - found = true; - } + if ((specified && (*iter)->GetUniformNumber() == unum && (*iter)->GetTeamIndex() == idx) || + (!specified && (*iter)->IsSelected())) + found = true; else ++iter; } @@ -250,7 +278,6 @@ } Predicate::Iterator posParam(predicate); - if (predicate.FindParameter(posParam, "pos")) { salt::Vector3f pos; @@ -477,3 +504,200 @@ } } +void TrainerCommandParser::ParseSelectCommand(const oxygen::Predicate & predicate) +{ + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr<SoccerRuleAspect> soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + if (specified && unum == -1) + { + soccerRuleAspect->ResetAgentSelection(); + return; + } + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + if (!specified) + { + soccerRuleAspect->SelectNextAgent(); + return; + } + + SoccerBase::TAgentStateList agentStates; + SoccerBase::GetAgentStates(*this, agentStates, idx); + SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); + bool found = false; + + while (iter != agentStates.end() && !found) + { + if ((*iter)->GetUniformNumber() == unum) + { + found = true; + } + else + ++iter; + } + + if (!found) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get correct AgentState\n"; + return; + } + + soccerRuleAspect->ResetAgentSelection(); + (*iter)->Select(); +} + +void TrainerCommandParser::ParseKillCommand(const oxygen::Predicate & predicate) +{ + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr<SoccerRuleAspect> soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + GameControlServer::TAgentAspectList agentAspects; + mGameControl->GetAgentAspectList(agentAspects); + GameControlServer::TAgentAspectList::iterator aaiter; + for ( + aaiter = agentAspects.begin(); + aaiter != agentAspects.end(); + ++aaiter + ) + { + // search for the first agent of the left/right side + boost::shared_ptr<AgentState> agentState = + shared_dynamic_cast<AgentState>((*aaiter)->GetChild("AgentState", true)); + + if ((specified && agentState->GetUniformNumber() == unum && agentState->GetTeamIndex() == idx) || + (!specified && agentState->IsSelected())) + { + mGameControl->pushDisappearedAgent((*aaiter)->ID()); + break; + } + } +} + +void TrainerCommandParser::ParseReposCommand(const oxygen::Predicate & predicate) +{ + cerr << "repos 2" << endl; + + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr<SoccerRuleAspect> soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + SoccerBase::TAgentStateList agentStates; + SoccerBase::GetAgentStates(*this, agentStates, TI_NONE); + SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); + boost::shared_ptr<oxygen::Transform> agent_aspect; + for (;iter != agentStates.end(); ++iter) + { + if ((specified && (*iter)->GetUniformNumber() == unum && (*iter)->GetTeamIndex() == idx) || + (!specified && (*iter)->IsSelected())) + { + Vector3f ballPos(0,0,0); + boost::shared_ptr<RigidBody> ballBody; + + if (SoccerBase::GetBallBody(*this, ballBody)) + ballPos = ballBody->GetPosition(); + + SoccerBase::GetTransformParent(**iter, agent_aspect); + cerr << "repos 3" << endl; + Vector3f new_pos = mSoccerRule->RepositionOutsidePos(ballPos, (*iter)->GetUniformNumber(), (*iter)->GetTeamIndex()); + SoccerBase::MoveAgent(agent_aspect, new_pos); + + break; + } + } +} + Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h 2010-06-01 13:04:58 UTC (rev 207) @@ -33,6 +33,11 @@ #include <soccertypes.h> #include <soccerruleaspect/soccerruleaspect.h> +namespace oxygen +{ + class GameControlServer; +} + class TrainerCommandParser : public oxygen::MonitorCmdParser { public: @@ -44,7 +49,10 @@ CT_PLAYMODE, CT_DROP_BALL, CT_KICK_OFF, - CT_ACK + CT_ACK, + CT_SELECT, + CT_KILL, + CT_REPOS }; typedef std::map<std::string, ECommandType> TCommandMap; @@ -100,7 +108,21 @@ predicate */ void ParseKickOffCommand(const oxygen::Predicate & predicate); + + /** parses and executes the select command contained in the given + predicate + */ + void ParseSelectCommand(const oxygen::Predicate & predicate); + /** parses and executes the kill command contained in the given + predicate + */ + void ParseKillCommand(const oxygen::Predicate & predicate); + + /** parses and executes the reposition command contained in the given + predicate + */ + void ParseReposCommand(const oxygen::Predicate & predicate); protected: TCommandMap mCommandMap; @@ -114,6 +136,8 @@ boost::shared_ptr<SoccerRuleAspect> mSoccerRule; //! the parser used to create the PredicateList boost::shared_ptr<oxygen::BaseParser> mSexpParser; + //! cached reference to the game control server + boost::shared_ptr<oxygen::GameControlServer> mGameControl; bool mGetAck; std::string mAckString; Modified: trunk/rcssserver3d/plugin/soccermonitor/soccerinput.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/soccerinput.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccermonitor/soccerinput.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -28,9 +28,11 @@ using namespace zeitgeist; using namespace oxygen; using namespace kerosin; +using namespace std; SoccerInput::SoccerInput() - : InputItem() + : InputItem(), + mCmdMode(CmdModeDefault) { } @@ -55,9 +57,25 @@ scriptServer->CreateVariable("Command.CameraRightCorner", CmdCameraRightCorner); scriptServer->CreateVariable("Command.CameraRightGoal", CmdCameraRightGoal); //JAN - scriptServer->CreateVariable("Command.FreeKickLeft", CmdFreeKickLeft); - scriptServer->CreateVariable("Command.FreeKickRight", CmdFreeKickRight); - + scriptServer->CreateVariable("Command.One", CmdOne); + scriptServer->CreateVariable("Command.Two", CmdTwo); + scriptServer->CreateVariable("Command.Three", CmdThree); + scriptServer->CreateVariable("Command.Four", CmdFour); + scriptServer->CreateVariable("Command.Five", CmdFive); + scriptServer->CreateVariable("Command.Six", CmdSix); + scriptServer->CreateVariable("Command.Seven", CmdSeven); + scriptServer->CreateVariable("Command.Eight", CmdEight); + scriptServer->CreateVariable("Command.Nine", CmdNine); + scriptServer->CreateVariable("Command.Zero", CmdZero); + scriptServer->CreateVariable("Command.Left", CmdLeft); + scriptServer->CreateVariable("Command.Right", CmdRight); + + scriptServer->CreateVariable("Command.PlayerSelectMode", CmdPlayerSelectMode); + scriptServer->CreateVariable("Command.SelectNextAgent", CmdSelectNextAgent); + scriptServer->CreateVariable("Command.ResetSelection", CmdResetSelection); + scriptServer->CreateVariable("Command.KillSelection", CmdKillSelection); + scriptServer->CreateVariable("Command.ReposSelection", CmdReposSelection); + mMonitorClient = shared_dynamic_cast<NetClient> (GetCore()->Get("/sys/server/simulation/SparkMonitorClient")); @@ -107,143 +125,213 @@ void SoccerInput::ProcessInput(const Input& input) { - // get list of registered SoccerMonitor objects - TLeafList soccerMonitorList; - mMonitorClient->ListChildrenSupportingClass<SoccerMonitor>(soccerMonitorList); - - if (soccerMonitorList.empty()) - { - GetLog()->Error() - << "ERROR: (SoccerInput) Unable to get SoccerMonitor\n"; - return; - } - - boost::shared_ptr<SoccerMonitor> soccerMonitor = - shared_static_cast<SoccerMonitor>(soccerMonitorList.front()); - switch (input.mId) { default: return; - case CmdKickOff: + case CmdPlayerSelectMode: if (input.GetKeyPress()) - { - SendCommand("(kickOff Left)"); - } + { + mCmdMode = CmdModePlayerSelect; + } break; - case CmdKickOffRight: + + case CmdSelectNextAgent: if (input.GetKeyPress()) { - SendCommand("(kickOff Right)"); + SendCommand("(select)"); } break; - - case CmdMoveAgent: + + case CmdResetSelection: if (input.GetKeyPress()) { - //SendCommand("(agent (team Left)(unum 1)(pos -2.0 1.0 3.5))"); + SendCommand("(select (unum -1))"); } break; - case CmdDropBall: + + case CmdKillSelection: if (input.GetKeyPress()) { - SendCommand("(dropBall)"); + SendCommand("(kill)"); } break; - case CmdShootBall: + + case CmdReposSelection: if (input.GetKeyPress()) { - //SendCommand("(ball (vel -4.0 0.0 2.0))"); + SendCommand("(repos)"); } break; - case CmdMoveBall: + + case CmdKickOff: if (input.GetKeyPress()) { - //SendCommand("(ball (pos -42.0 0.0 0.3))"); + SendCommand("(kickOff Left)"); } break; - case CmdCameraLeftGoal: + case CmdKickOffRight: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(90); - mFPS->SetVAngleDeg(35); + SendCommand("(kickOff Right)"); } break; - case CmdCameraLeftCorner: + + case CmdMoveAgent: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(50); - mFPS->SetVAngleDeg(30); + SendCommand("(agent)"); } break; - case CmdCameraMiddleLeft: + case CmdDropBall: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625)); - mFPS->SetVAngleDeg(40); + SendCommand("(dropBall)"); } break; - case CmdCameraMiddleRight: + case CmdShootBall: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(salt::gRadToDeg(0.625)); - mFPS->SetVAngleDeg(40); + //SendCommand("(ball (vel -4.0 0.0 2.0))"); } break; - case CmdCameraMiddle: + case CmdMoveBall: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y()*1.1, fieldSize.x()*0.6); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(0); - mFPS->SetVAngleDeg(45); + //SendCommand("(ball (pos -42.0 0.0 0.3))"); } break; - case CmdCameraRightCorner: + + case CmdOne: + case CmdTwo: + case CmdThree: + case CmdFour: + case CmdFive: + case CmdSix: + case CmdSeven: + case CmdEight: + case CmdNine: + case CmdZero: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(-50); - mFPS->SetVAngleDeg(30); + if (mCmdMode == CmdModeDefault) + SelectCamera(input.mId - CmdOne); + else + { + ostringstream u_ss; + u_ss << "(select (unum " << (input.mId - CmdOne + 1) << ") "; + if (mCmdMode == CmdModeLeftPlayerSelect) + { + u_ss << "(team Left))"; + SendCommand(u_ss.str()); + mCmdMode = CmdModeDefault; + } + else if (mCmdMode == CmdModeRightPlayerSelect) + { + u_ss << "(team Right))"; + SendCommand(u_ss.str()); + mCmdMode = CmdModeDefault; + } + } } break; - case CmdCameraRightGoal: + case CmdLeft: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(-90); - mFPS->SetVAngleDeg(35); + if (mCmdMode == CmdModeDefault) + SendCommand("(playMode free_kick_left)"); + else if (mCmdMode == CmdModePlayerSelect || mCmdMode == CmdModeRightPlayerSelect) + mCmdMode = CmdModeLeftPlayerSelect; } break; - case CmdFreeKickLeft: + case CmdRight: if (input.GetKeyPress()) { - SendCommand("(playMode free_kick_left)"); + if (mCmdMode == CmdModeDefault) + SendCommand("(playMode free_kick_right)"); + else if (mCmdMode == CmdModePlayerSelect || mCmdMode == CmdModeLeftPlayerSelect) + mCmdMode = CmdModeRightPlayerSelect; } break; - case CmdFreeKickRight: - if (input.GetKeyPress()) - { - SendCommand("(playMode free_kick_right)"); - } - break; }; } + +void SoccerInput::SelectCamera(int idx) +{ + // get list of registered SoccerMonitor objects + TLeafList soccerMonitorList; + mMonitorClient->ListChildrenSupportingClass<SoccerMonitor>(soccerMonitorList); + + if (soccerMonitorList.empty()) + { + GetLog()->Error() + << "ERROR: (SoccerInput) Unable to get SoccerMonitor\n"; + return; + } + + boost::shared_ptr<SoccerMonitor> soccerMonitor = + shared_static_cast<SoccerMonitor>(soccerMonitorList.front()); + + salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); + + switch (idx) + { + case 0: + { + salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(90); + mFPS->SetVAngleDeg(35); + } + break; + case 1: + { + salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(50); + mFPS->SetVAngleDeg(30); + } + break; + case 2: + { + salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625)); + mFPS->SetVAngleDeg(40); + } + break; + case 3: + { + salt::Vector3f pos(0, -fieldSize.y()*1.1, fieldSize.x()*0.6); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(0); + mFPS->SetVAngleDeg(45); + } + break; + case 4: + { + salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(salt::gRadToDeg(0.625)); + mFPS->SetVAngleDeg(40); + } + break; + case 5: + { + salt::Vector3f pos(fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(-50); + mFPS->SetVAngleDeg(30); + } + break; + case 6: + { + salt::Vector3f pos(fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(-90); + mFPS->SetVAngleDeg(35); + } + break; + } +} Modified: trunk/rcssserver3d/plugin/soccermonitor/soccerinput.h =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/soccerinput.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccermonitor/soccerinput.h 2010-06-01 13:04:58 UTC (rev 207) @@ -49,10 +49,37 @@ CmdCameraMiddle = CmdCameraMiddleRight + 1, CmdCameraRightCorner = CmdCameraMiddle + 1, CmdCameraRightGoal = CmdCameraRightCorner + 1, + + CmdOne = CmdCameraRightGoal + 1, + CmdTwo = CmdOne + 1, + CmdThree = CmdTwo + 1, + CmdFour = CmdThree + 1, + CmdFive = CmdFour + 1, + CmdSix = CmdFive + 1, + CmdSeven = CmdSix + 1, + CmdEight = CmdSeven + 1, + CmdNine = CmdEight + 1, + CmdZero = CmdNine + 1, + //JAN - CmdFreeKickLeft = CmdCameraRightGoal + 1, - CmdFreeKickRight = CmdFreeKickLeft + 1 + CmdLeft = CmdZero + 1, + CmdRight = CmdLeft + 1, + + CmdPlayerSelectMode = CmdRight + 1, + CmdSelectNextAgent = CmdPlayerSelectMode + 1, + CmdResetSelection = CmdSelectNextAgent + 1, + CmdKillSelection = CmdResetSelection + 1, + CmdReposSelection = CmdKillSelection + 1 }; + + enum ECmdMode + { + CmdModeDefault = 1, + CmdModePlayerSelect, + CmdModeLeftPlayerSelect, + CmdModeRightPlayerSelect, + CmdModeNone + }; public: SoccerInput(); @@ -71,9 +98,12 @@ /** reset SparkMonitorClient reference */ virtual void OnUnlink(); + ECmdMode GetCmdMode() const { return mCmdMode; } + protected: void SendCommand(const std::string& cmd); + void SelectCamera(int idx); protected: /** cached reference to the monitor client */ boost::shared_ptr<oxygen::NetClient> mMonitorClient; @@ -82,6 +112,8 @@ boost::shared_ptr<oxygen::RigidBody> mCameraBody; boost::shared_ptr<oxygen::FPSController> mFPS; + + ECmdMode mCmdMode; }; DECLARE_CLASS(SoccerInput); Modified: trunk/rcssserver3d/plugin/soccermonitor/soccerrender.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/soccerrender.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccermonitor/soccerrender.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -23,6 +23,7 @@ #include <sstream> #include "soccerrender.h" #include "soccermonitor.h" +#include "soccerinput.h" #include <zeitgeist/logserver/logserver.h> #include <kerosin/openglserver/openglserver.h> #include <kerosin/fontserver/fontserver.h> @@ -69,6 +70,13 @@ { GetLog()->Error() << "ERROR: (SoccerRender) Unable to get SoccerMonitor\n"; } + mInput = shared_static_cast<SoccerInput> + (GetCore()->Get("/sys/server/simulation/InputControl/SoccerInput")); + + if (mInput.get() == 0) + { + GetLog()->Error() << "ERROR: (SoccerRender) Unable to get SoccerInput\n"; + } } void SoccerRender::OnUnlink() @@ -90,7 +98,7 @@ return; } - stringstream ss_l, ss_c, ss_r; + stringstream ss_l, ss_c, ss_r, ss_m; ss_c.setf(ios_base::fixed,ios_base::floatfield); ss_c.precision(2); @@ -141,5 +149,8 @@ xPos = int((1024-(mFont->GetStringWidth(ss_c.str().c_str())))/2); mFont->DrawString(xPos, 0, ss_c.str().c_str()); + //ss_m << mInput->GetCmdMode(); + //mFont->DrawString(10, 30, ss_m.str().c_str()); + mFontServer->End(); } Modified: trunk/rcssserver3d/plugin/soccermonitor/soccerrender.h =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/soccerrender.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/plugin/soccermonitor/soccerrender.h 2010-06-01 13:04:58 UTC (rev 207) @@ -32,6 +32,7 @@ } class SoccerMonitor; +class SoccerInput; class SoccerRender : public kerosin::CustomRender { @@ -51,6 +52,7 @@ boost::shared_ptr<SoccerMonitor> mMonitor; boost::shared_ptr<kerosin::FontServer> mFontServer; boost::shared_ptr<kerosin::Font> mFont; + boost::shared_ptr<SoccerInput> mInput; }; DECLARE_CLASS(SoccerRender); Modified: trunk/rcssserver3d/rcssmonitor3d/soccerbindings.rb =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/soccerbindings.rb 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/rcssmonitor3d/soccerbindings.rb 2010-06-01 13:04:58 UTC (rev 207) @@ -28,16 +28,33 @@ inputServer.bindCommand('j', Command.KickOffRight); inputServer.bindCommand('b', Command.DropBall); inputServer.bindCommand('m', Command.MoveAgent); - inputServer.bindCommand('n', Command.ShootBall); - inputServer.bindCommand('x', Command.MoveBall); - inputServer.bindCommand('1', Command.CameraLeftGoal); - inputServer.bindCommand('2', Command.CameraLeftCorner); - inputServer.bindCommand('3', Command.CameraMiddleLeft); - inputServer.bindCommand('4', Command.CameraMiddle); - inputServer.bindCommand('5', Command.CameraMiddleRight); - inputServer.bindCommand('6', Command.CameraRightCorner); - inputServer.bindCommand('7', Command.CameraRightGoal); - inputServer.bindCommand('l', Command.FreeKickLeft); - inputServer.bindCommand('r', Command.FreeKickRight); + #inputServer.bindCommand('n', Command.ShootBall); + #inputServer.bindCommand('x', Command.MoveBall); + + #inputServer.bindCommand('1', Command.CameraLeftGoal); + #inputServer.bindCommand('2', Command.CameraLeftCorner); + #inputServer.bindCommand('3', Command.CameraMiddleLeft); + #inputServer.bindCommand('4', Command.CameraMiddle); + #inputServer.bindCommand('5', Command.CameraMiddleRight); + #inputServer.bindCommand('6', Command.CameraRightCorner); + #inputServer.bindCommand('7', Command.CameraRightGoal); + inputServer.bindCommand('1', Command.One); + inputServer.bindCommand('2', Command.Two); + inputServer.bindCommand('3', Command.Three); + inputServer.bindCommand('4', Command.Four); + inputServer.bindCommand('5', Command.Five); + inputServer.bindCommand('6', Command.Six); + inputServer.bindCommand('7', Command.Seven); + inputServer.bindCommand('8', Command.Eight); + inputServer.bindCommand('9', Command.Nine); + inputServer.bindCommand('0', Command.Zero); + + inputServer.bindCommand('l', Command.Left); + inputServer.bindCommand('r', Command.Right); + inputServer.bindCommand('lctrl s', Command.PlayerSelectMode); + inputServer.bindCommand('n', Command.SelectNextAgent); + inputServer.bindCommand('e', Command.ResetSelection); + inputServer.bindCommand('x', Command.KillSelection); + inputServer.bindCommand('p', Command.ReposSelection); end end Modified: trunk/rcssserver3d/rcssmonitor3d/soccersim-monitor.rb =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/soccersim-monitor.rb 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/rcssserver3d/rcssmonitor3d/soccersim-monitor.rb 2010-06-01 13:04:58 UTC (rev 207) @@ -13,10 +13,6 @@ # state sparkRegisterCustomMonitor 'SoccerMonitor' -# register the soccer render plugin to draw the game state on the -# screen -sparkRegisterCustomRender 'SoccerRender' - if ($logPlayerMode == true) # register the soccer input logplayer plugin for playback # specific keys @@ -29,3 +25,7 @@ # bind keys to soccer commands run "soccerbindings.rb" +# register the soccer render plugin to draw the game state on the +# screen +sparkRegisterCustomRender 'SoccerRender' + Modified: trunk/spark/data/scripts/materials.rb =================================================================== --- trunk/spark/data/scripts/materials.rb 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/data/scripts/materials.rb 2010-06-01 13:04:58 UTC (rev 207) @@ -14,6 +14,7 @@ material = sparkCreate('kerosin/MaterialSolid', $serverPath+'material/matRed'); material.setDiffuse(1.0,0.0,0.0,1.0) +material.setAmbient(1.0,0.0,0.0,1.0) material = sparkCreate('kerosin/MaterialSolid', $serverPath+'material/matRedGlow'); material.setDiffuse(1.0,0.0,0.0,1.0) @@ -33,6 +34,12 @@ material.setDiffuse(0.1,0.6,0.1,1.0) material.setAmbient(0.1,0.3,0.1,1.0) +# selection marker +material = sparkCreate('kerosin/MaterialSolid', $serverPath+'material/matSelect'); +material.setDiffuse(1.0,0.0,0.0,0.5) +material.setAmbient(1.0,0.0,0.0,0.5) +material.setSpecular(1.0,0.2,0.2,0.5); + # shades of grey material = sparkCreate('kerosin/MaterialSolid', $serverPath+'material/matWhite'); material.setDiffuse(1.0,1.0,1.0,1.0) Modified: trunk/spark/lib/kerosin/inputserver/input.h =================================================================== --- trunk/spark/lib/kerosin/inputserver/input.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/inputserver/input.h 2010-06-01 13:04:58 UTC (rev 207) @@ -101,6 +101,7 @@ float f; } mData; + unsigned int mModState; public: // numbers Modified: trunk/spark/lib/kerosin/inputserver/inputcontrol.cpp =================================================================== --- trunk/spark/lib/kerosin/inputserver/inputcontrol.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/inputserver/inputcontrol.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -217,10 +217,10 @@ ListChildrenSupportingClass<InputItem>(items); for ( - TLeafList::iterator iter = items.begin(); - iter != items.end(); - ++iter - ) + TLeafList::iterator iter = items.begin(); + iter != items.end(); + ++iter + ) { shared_static_cast<InputItem>(*iter) ->ProcessInput(input); Modified: trunk/spark/lib/kerosin/inputserver/inputserver.cpp =================================================================== --- trunk/spark/lib/kerosin/inputserver/inputserver.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/inputserver/inputserver.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -288,6 +288,7 @@ // return Input::eUser input return true; } + // translate raw input to binding TBindMap::iterator bindListIter = mBindings.find(input.mCode); if (bindListIter == mBindings.end()) @@ -305,11 +306,13 @@ ++bindIter ) { + /* const Bind& bind = (*bindIter); //printf("Looking at: %d %d %d", (*bind).mCode, (*bind).cmd, (*bind).modifier); - if (bind.modifier == mModifierState) + if (bind.modifier == input.mModState) { + */ #if 0 if (input.mType == Input::eButton) { @@ -320,13 +323,13 @@ #else const Bind& bind = (*bindIter); - //printf("Looking at: %d %d %d", (*bind).mCode, (*bind).cmd, (*bind).modifier); if ( - (bind.modifier == 0 && mModifierState == 0) || - (bind.modifier & mModifierState) + (bind.modifier == 0 && input.mModState == 0) || + (bind.modifier & input.mModState) ) #endif { + input.mId = bind.cmd; return true; } @@ -335,7 +338,7 @@ input.mId = bind.cmd; return true; } - } + //} } input.mId = -1; @@ -404,6 +407,7 @@ { current = tokens.front(); tokens.pop_front(); + bind.modifier |= ParseModifier(current); } Modified: trunk/spark/lib/kerosin/renderserver/rendernode.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/renderserver/rendernode.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -24,10 +24,13 @@ #include "rendernode.h" using namespace kerosin; +using namespace std; RenderNode::RenderNode() : BaseNode(), - mTransparent(false) + mTransparent(false), + mVisible(true), + mVisibleToggled(true) { } @@ -37,5 +40,19 @@ void RenderNode::SetTransparent() { - mTransparent = true; + mTransparent = true; } + +void RenderNode::SetVisible(bool visible) +{ + if (!mVisibleToggled && mVisible != visible) + mVisibleToggled = true; + mVisible = visible; +} + +bool RenderNode::VisibleToggled() +{ + bool tmp = mVisibleToggled; + mVisibleToggled = false; + return tmp; +} Modified: trunk/spark/lib/kerosin/renderserver/rendernode.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode.h 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/renderserver/rendernode.h 2010-06-01 13:04:58 UTC (rev 207) @@ -45,8 +45,15 @@ bool IsTransparent() { return mTransparent; } void SetTransparent(); + + void SetVisible(bool visible); + bool IsVisible() const { return mVisible; } + bool VisibleToggled(); + private: bool mTransparent; + bool mVisible; + bool mVisibleToggled; }; DECLARE_ABSTRACTCLASS(RenderNode); Modified: trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/renderserver/rendernode_c.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -29,8 +29,26 @@ return true; } +FUNCTION(RenderNode,setVisible) +{ + int visible; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(), visible)) + ) + { + return false; + } + + + obj->SetVisible(visible); + return true; +} + void CLASS(RenderNode)::DefineClass() { DEFINE_BASECLASS(oxygen/BaseNode); DEFINE_FUNCTION(setTransparent); + DEFINE_FUNCTION(setVisible); } Modified: trunk/spark/lib/kerosin/renderserver/renderserver.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -251,6 +251,10 @@ { boost::shared_ptr<RenderNode> renderNode = shared_dynamic_cast<RenderNode>(node); if (renderNode.get() != 0 && + !renderNode->IsVisible()) + return; + + if (renderNode.get() != 0 && ((pass == 0 && !renderNode->IsTransparent()) || (pass == 1 && renderNode->IsTransparent())) ) { Modified: trunk/spark/lib/kerosin/sceneserver/singlematnode_c.cpp =================================================================== --- trunk/spark/lib/kerosin/sceneserver/singlematnode_c.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/sceneserver/singlematnode_c.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -40,10 +40,28 @@ return obj->SetMaterial(inName); } +FUNCTION(SingleMatNode,setVisible) +{ + int visible; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(), visible)) + ) + { + return false; + } + + + obj->SetVisible(visible); + return true; +} + void CLASS(SingleMatNode)::DefineClass() { DEFINE_BASECLASS(kerosin/StaticMesh); DEFINE_FUNCTION(setMaterial); + DEFINE_FUNCTION(setVisible); } Modified: trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp =================================================================== --- trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/kerosin/sceneserver/staticmesh_c.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -144,15 +144,9 @@ return true; } -FUNCTION(RenderNode,setTransparent) -{ - obj->SetTransparent(); - return true; -} - void CLASS(StaticMesh)::DefineClass() { - DEFINE_BASECLASS(oxygen/BaseNode); + DEFINE_BASECLASS(kerosin/RenderNode); DEFINE_FUNCTION(load); DEFINE_FUNCTION(setScale); DEFINE_FUNCTION(setCastShadows) @@ -160,5 +154,4 @@ DEFINE_FUNCTION(setExternalMeshName) DEFINE_FUNCTION(setExternalMeshScale) DEFINE_FUNCTION(resetMaterials) - DEFINE_FUNCTION(setTransparent); } Modified: trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -237,6 +237,7 @@ mSimTime += mSumDeltaTime; mSumDeltaTime = 0; } + usleep(10000); } void SimulationServer::ControlEvent(EControlEvent event) Modified: trunk/spark/plugin/inputsdl/keyboardsdl.cpp =================================================================== --- trunk/spark/plugin/inputsdl/keyboardsdl.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/plugin/inputsdl/keyboardsdl.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -24,6 +24,7 @@ #include <zeitgeist/logserver/logserver.h> using namespace kerosin; +using namespace std; KeyboardSDL::KeyboardSDL() : InputDeviceSDL() @@ -213,8 +214,7 @@ return 1; } - unsigned int& modState = - mInputSystem->GetInputServer()->GetModifierState(); + unsigned int modState; modState = Input::eNone; @@ -238,6 +238,16 @@ modState |= Input::eRAlt; } + if (event->key.keysym.mod & KMOD_LCTRL) + { + modState |= Input::eLCtrl; + } + + if (event->key.keysym.mod & KMOD_RCTRL) + { + modState |= Input::eRCtrl; + } + if (event->key.keysym.sym == 0) { return 1; @@ -254,6 +264,7 @@ Input input(Input::eButton, sym); input.mData.l = (event->type == SDL_KEYDOWN); + input.mModState = modState; mInputSystem->AddInputInternal(input); return 0; Modified: trunk/spark/plugin/inputsdl/mousesdl.cpp =================================================================== --- trunk/spark/plugin/inputsdl/mousesdl.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/plugin/inputsdl/mousesdl.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -69,6 +69,7 @@ } input.mData.l = (event->type == SDL_MOUSEBUTTONDOWN); + input.mModState = 0; mInputSystem->AddInputInternal(input); return 0; } Modified: trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2010-06-01 11:03:37 UTC (rev 206) +++ trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2010-06-01 13:04:58 UTC (rev 207) @@ -233,11 +233,6 @@ void SparkMonitor::DescribeMesh(stringstream& ss, boost::shared_ptr<StaticMesh> mesh) { - if (! mFullState) - { - return DescribeBaseNode(ss); - } - boost::shared_ptr<SingleMatNode> singleMat = shared_dynamic_cast<SingleMatNode>(mesh); @@ -249,6 +244,15 @@ ss << "(nd StaticMesh"; } + if (mFullState || mesh->VisibleToggled()) + if (mesh->IsVisible()) + ss << " (setVisible 1)"; + else + ss << " (setVisible 0)"; + + if (! mFullState) + return; + if (mesh->IsTransparent()) { ss << " (setTransparent)"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-06-04 21:19:14
|
Revision: 208 http://simspark.svn.sourceforge.net/simspark/?rev=208&view=rev Author: hedayat Date: 2010-06-04 21:19:08 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Preparing for a new release Removing a delay in the simulation loop Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/RELEASE trunk/spark/CMakeLists.txt trunk/spark/ChangeLog trunk/spark/RELEASE trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/rcssserver3d/CMakeLists.txt 2010-06-04 21:19:08 UTC (rev 208) @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(rcssserver3d CXX C) -set(PACKAGE_VERSION "0.6.3") +set(PACKAGE_VERSION "0.6.4") ########## check for headerfiles/libraries ########## include(CheckIncludeFile) Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/rcssserver3d/ChangeLog 2010-06-04 21:19:08 UTC (rev 208) @@ -1,3 +1,9 @@ +2010-06-05 Hedayat Vatankhah <he...@gr...> + + * RELEASE: + * CMakeLists.txt: + - preparing for 0.6.4 release + 2010-05-23 Hedayat Vatankhah <he...@gr...> * rcssserver3d/naosoccersim.rb: Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/rcssserver3d/RELEASE 2010-06-04 21:19:08 UTC (rev 208) @@ -1,33 +1,16 @@ -RELEASE News of rcssserver3d-0.6.3 +RELEASE News of rcssserver3d-0.6.4 -In this release, we are preparing for a simulation with more robots than before. -The current target is to have 6 vs 6 games, so we have made some changes to -make the simulator more suitable for it. The most notable changes made in -rcssserver3d package in this direction are: -1. Disabling the internal monitor by default: starting from this version, the -simulation server (simspark binary, now called rcssserver3d) no longer brings -up a monitor when run. To actually view the simulation, a monitor (e.g. -rcsmonitor3d which is included in this package) should be run separately. This -separation noticeably improves the performance of the server. A new executable -called "rcsoccersim3d" is provided which runs both the simulation server and a -monitor on the local machine. -2. Bigger field: in this version, field dimensions and goal width are 1.5 times -larger than before to provide enough area for 6 vs 6 games. +This release is supposed to be the final version of rcssserver3d for +RoboCup 2010 in Singapore. The release includes a referee patch contributed +by FCPortugal team which enforces some rules to avoid crowding of many players +in a small area and to penalize ill-behaved players. Additionally, this +release comes with some more facilities for a human referee to control the game +and individual players in the field. -* New names: - - rcssserver3d: the old simspark binary has been renamed to rcssserver3d, as - it more clearly shows the functionality of the simulator. A symbolic link - called simspark is provided for compatibility. - - rcsoccersim3d: as stated above, running rcssserver3d (formerly simspark) - no longer starts a monitor to view the simulation, and a monitor should be - run separately. For users' convenience a new executable called rcsoccersim3d - is provided which runs both rcssserver3d and rcssmonitor3 to connect to - the running simulator. - -* Other notable changes: - - Added HMDP effector/perceptor - - Some compilation fixes - - Improved Windows support +* Summary: +- Improved referee to enforce more fair games +- Improved monitor which provides more power to the human referee +- Visual Studio 2010 compilation fixes You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/spark/CMakeLists.txt 2010-06-04 21:19:08 UTC (rev 208) @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(simspark CXX C) -set(PACKAGE_VERSION "0.2") +set(PACKAGE_VERSION "0.2.1") ########## check for headerfiles/libraries ########## include(CheckIncludeFile) @@ -143,13 +143,13 @@ set(SALT_SO_VERSION 0) set(SALT_VERSION ${SALT_SO_VERSION}.3.2) set(ZEITGEIST_SO_VERSION 3) -set(ZEITGEIST_VERSION ${ZEITGEIST_SO_VERSION}.1.0) -set(OXYGEN_SO_VERSION 3) -set(OXYGEN_VERSION ${OXYGEN_SO_VERSION}.3.0) +set(ZEITGEIST_VERSION ${ZEITGEIST_SO_VERSION}.1.1) +set(OXYGEN_SO_VERSION 4) +set(OXYGEN_VERSION ${OXYGEN_SO_VERSION}.0.0) set(KEROSIN_SO_VERSION 1) -set(KEROSIN_VERSION ${KEROSIN_SO_VERSION}.1.0) +set(KEROSIN_VERSION ${KEROSIN_SO_VERSION}.1.1) set(SPARK_SO_VERSION 0) -set(SPARK_VERSION ${SPARK_SO_VERSION}.0.0) +set(SPARK_VERSION ${SPARK_SO_VERSION}.0.1) set(RCSSNET_SO_VERSION 0) set(RCSSNET_VERSION ${RCSSNET_SO_VERSION}.1.0) Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/spark/ChangeLog 2010-06-04 21:19:08 UTC (rev 208) @@ -1,3 +1,15 @@ +2010-06-05 Hedayat Vatankhah <he...@gr...> + + * lib/oxygen/simulationserver/simulationserver.cpp (SimulationServer::Step): + - disabling the usleep call to retain full compatibility with the previous + versions + + * RELEASE: + - release notes for the next version (0.2.1) + + * CMakeLists.txt: + - bumped library versions and package version for the next release + 2010-05-09 Hedayat Vatankhah <he...@gr...> * lib/zeitgeist/scriptserver/scriptserver.cpp (thisCall): Modified: trunk/spark/RELEASE =================================================================== --- trunk/spark/RELEASE 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/spark/RELEASE 2010-06-04 21:19:08 UTC (rev 208) @@ -1,49 +1,16 @@ -RELEASE News of simspark-0.2 +RELEASE News of simspark-0.2.1 In this release you can find some bug and compilation fixes, improved Windows -support and some new features including a new sensor and features to facilitate -agent debugging and development. It also provides a more deterministic behavior -for agents which should make them more reliable. +support and some new features such as the potential of using different +physical simulation engines. * New features: - - An Accelerometer sensor which reports the linear acceleration - - A "Sync Mode" operation is introduced. In this mode, the server will not - advance to the next cycle until all connected agents send a "(syn)" command - to the server. You can use this mode by setting "agentSyncMode" to true in - simspark.rb (or spark.rb) - - Simulator will run in simulation time mode instead of real time - if "useRealTime" variable is set to false in simspark.rb (or spark.rb) + - The core physics system does no longer depend on ODE (Thanks to Andreas). + ODE implementation is now provided as a plugin. -* More deterministic agent-server communication - - Simspark will now collect received commands right before sending - sense data of the last cycle. So, any commands which is sent by agents - after receiving new sense data will be executed in the next cycle, not the - current one. This results in a more deterministic behavior, and agents' - efficiency should not change between remote and local runs considerably. - - An Accelerometer sensor - - Fixed some rendering bugs (agents not visible through goals) - - A "Sync Mode" operation is introduced. In this mode, the server will not - advance to the next cycle untill all connected agents send a "(syn)" command - to the server. You can use this mode by setting "agentSyncMode" to true in - simspark.rb (or spark.rb) - - Simulator will run in simulation time mode instead of real time - if "useRealTime" variable is set to false in simspark.rb (or spark.rb) - - To make changes to most of the resource files (e.g. simspark.rb), you can - create a copy in ~/.simspark directory and make desired changes there. The - directory structure of the original files should be preserved (e.g. - rsg/agent/nao/nao.rgs) - -* More convenience: - - Simspark should always accept connections. No more "Connection refused" - messages and the need to wait for simspark's network port to be freed! - - To make changes to most of the resource files (e.g. simspark.rb), you can - create a copy in ~/.simspark directory and make desired changes there. The - directory structure of the original files should be preserved (e.g. - rsg/agent/nao/nao.rgs) - * Fixes: - - Compilation fixes - - Fixed some rendering bugs (agents not visible through goals) + - Compilation fixes on newer compilers (VS 2010) + - Fixed some bugs on 64 bit systems and in multi-threaded mode You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2010-06-01 13:04:58 UTC (rev 207) +++ trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2010-06-04 21:19:08 UTC (rev 208) @@ -237,7 +237,7 @@ mSimTime += mSumDeltaTime; mSumDeltaTime = 0; } - usleep(10000); +// usleep(10000); } void SimulationServer::ControlEvent(EControlEvent event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-06-05 22:25:01
|
Revision: 209 http://simspark.svn.sourceforge.net/simspark/?rev=209&view=rev Author: hedayat Date: 2010-06-05 22:24:55 +0000 (Sat, 05 Jun 2010) Log Message: ----------- (Hopefully) fixed the race condition when logging is enabled Removed an extra output line Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp trunk/spark/ChangeLog trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp trunk/spark/lib/oxygen/monitorserver/monitorserver.h Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-06-04 21:19:08 UTC (rev 208) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-06-05 22:24:55 UTC (rev 209) @@ -159,8 +159,6 @@ bool TrainerCommandParser::ParsePredicate(const oxygen::Predicate & predicate) { - cerr << "repos 1" << endl; - SoccerBase::GetGameState(*this,mGameState); SoccerBase::GetSoccerRuleAspect(*this,mSoccerRule); Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2010-06-04 21:19:08 UTC (rev 208) +++ trunk/spark/ChangeLog 2010-06-05 22:24:55 UTC (rev 209) @@ -1,3 +1,9 @@ +2010-06-06 Hedayat Vatankhah <he...@gr...> + + * lib/oxygen/monitorserver/monitorserver.h: + * lib/oxygen/monitorserver/monitorserver.cpp (MonitorServer::GetMonitorData): + - more protection against simultaneous access (by monitor(s) and the logger) + 2010-06-05 Hedayat Vatankhah <he...@gr...> * lib/oxygen/simulationserver/simulationserver.cpp (SimulationServer::Step): Modified: trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp =================================================================== --- trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2010-06-04 21:19:08 UTC (rev 208) +++ trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2010-06-05 22:24:55 UTC (rev 209) @@ -170,6 +170,7 @@ } PredicateList pList; + boost::mutex::scoped_lock dataLock(mMonitorMutex); CollectItemPredicates(true,pList); return monitorSystem->GetMonitorHeaderInfo(pList); } @@ -177,7 +178,7 @@ string MonitorServer::GetMonitorData() { int cycle = mSimulationServer->GetCycle(); - boost::mutex::scoped_lock dataLock(mDataMutex); + boost::mutex::scoped_lock dataLock(mMonitorMutex); if ( cycle == mDataCycle ){ return mData; @@ -203,7 +204,7 @@ if (monitorSystem.get() != 0) { + boost::mutex::scoped_lock dataLock(mMonitorMutex); monitorSystem->ParseMonitorMessage(data); } } - Modified: trunk/spark/lib/oxygen/monitorserver/monitorserver.h =================================================================== --- trunk/spark/lib/oxygen/monitorserver/monitorserver.h 2010-06-04 21:19:08 UTC (rev 208) +++ trunk/spark/lib/oxygen/monitorserver/monitorserver.h 2010-06-05 22:24:55 UTC (rev 209) @@ -92,8 +92,8 @@ /** the cycle of cacahed data */ int mDataCycle; - /** a mutex to protect mData and mDataCycle variables */ - boost::mutex mDataMutex; + /** a mutex to protect monitor related internal data */ + boost::mutex mMonitorMutex; }; DECLARE_CLASS(MonitorServer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2010-12-14 17:08:18
|
Revision: 228 http://simspark.svn.sourceforge.net/simspark/?rev=228&view=rev Author: yxu Date: 2010-12-14 17:08:12 +0000 (Tue, 14 Dec 2010) Log Message: ----------- use base64 in image perceptor Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg trunk/spark/plugin/imageperceptor/CMakeLists.txt trunk/spark/plugin/imageperceptor/imageperceptor.cpp trunk/spark/plugin/imageperceptor/imageperceptor.h trunk/spark/spark/spark.rb trunk/spark/utility/libb64/cencode.h trunk/spark/utility/libb64/decode.h trunk/spark/utility/libb64/encode.h Modified: trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2010-12-14 17:08:12 UTC (rev 228) @@ -85,8 +85,6 @@ 0 0 -0.005 1 0 0 $he2_min $he2_max) - - ;(nd Camera) (nd RestrictedVisionPerceptor (setViewCones 120 120) @@ -96,6 +94,18 @@ (setInterval 3) ) + ;; (nd Transform + ;; (setLocalPos 0 $Head_Radius 0) + ;; (setLocalRotation 0 0 0) + ;; (nd ImagePerceptor + ;; (setInterval 3) + ;; (setViewport 0 0 320 240) + ;; (setFOV 58) + ;; (setZNear 0.003) + ;; (setZFar 50) + ;; ) + ;; ) + (nd ObjectState (setID head) ) Modified: trunk/spark/plugin/imageperceptor/CMakeLists.txt =================================================================== --- trunk/spark/plugin/imageperceptor/CMakeLists.txt 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/plugin/imageperceptor/CMakeLists.txt 2010-12-14 17:08:12 UTC (rev 228) @@ -10,7 +10,7 @@ add_library(imageperceptor MODULE ${imageperceptor_LIB_SRCS}) -target_link_libraries(imageperceptor ${spark_libs} ${Boost_LIBRARIES}) +target_link_libraries(imageperceptor ${spark_libs} ${Boost_LIBRARIES} b64) if (NOT APPLE) set_target_properties(imageperceptor PROPERTIES VERSION 0.0.0 SOVERSION 0) Modified: trunk/spark/plugin/imageperceptor/imageperceptor.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.cpp 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/plugin/imageperceptor/imageperceptor.cpp 2010-12-14 17:08:12 UTC (rev 228) @@ -35,6 +35,7 @@ #include "imageperceptor.h" #include <zeitgeist/logserver/logserver.h> +#include <boost/smart_ptr/shared_array.hpp> #define USE_FBO @@ -45,7 +46,8 @@ using namespace salt; using namespace std; -ImagePerceptor::ImagePerceptor() : oxygen::Perceptor() +ImagePerceptor::ImagePerceptor() : oxygen::Perceptor(), + mDataSize(0) { mFramesRendered = 0; } @@ -113,16 +115,19 @@ return false; Predicate &predicate = predList->AddPredicate(); - predicate.name = "Image"; + predicate.name = "IMG"; predicate.parameter.Clear(); - // ParameterList &sizeElement = predicate.parameter.AddList(); - // sizeElement.AddValue(std::string("s")); - // sizeElement.AddValue(mCamera->GetViewportWidth()); - // sizeElement.AddValue(mCamera->GetViewportHeight()); + ParameterList &sizeElement = predicate.parameter.AddList(); + sizeElement.AddValue(std::string("s")); + sizeElement.AddValue(mCamera->GetViewportWidth()); + sizeElement.AddValue(mCamera->GetViewportHeight()); - predicate.parameter.AddValue(mData); - return true; + ParameterList &dataElement = predicate.parameter.AddList(); + dataElement.AddValue(std::string("d")); + string datacode = mB64Encoder.encode(mData.get(), mDataSize); + dataElement.AddValue(datacode); + return true; } bool ImagePerceptor::Render() @@ -173,14 +178,12 @@ #else glReadBuffer(GL_BACK); #endif - int size = 3*w*h; - if ( mData.size() != size ) - mData.resize(size); + glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, - const_cast<char*>(mData.data())); + mData.get()); ++mFramesRendered; #ifdef USE_FBO @@ -196,6 +199,8 @@ { if ( 0!= mCamera ){ mCamera->SetViewport(x,y,w,h); + mDataSize = 3*w*h; + mData = boost::shared_array<char>(new char[mDataSize]); } } Modified: trunk/spark/plugin/imageperceptor/imageperceptor.h =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.h 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/plugin/imageperceptor/imageperceptor.h 2010-12-14 17:08:12 UTC (rev 228) @@ -26,6 +26,8 @@ #include <oxygen/sceneserver/sceneserver.h> #include <kerosin/renderserver/baserenderserver.h> #include <kerosin/openglserver/openglserver.h> +#include <boost/shared_array.hpp> +#include <libb64/encode.h> class ImagePerceptor : public oxygen::Perceptor { @@ -61,11 +63,14 @@ /** total frames rendered */ int mFramesRendered; - std::string mData; + boost::shared_array<char> mData; + unsigned int mDataSize; unsigned int mFBOId; unsigned int mRBOId; unsigned int mDepthBuffer; + + base64::Encoder mB64Encoder; }; DECLARE_CLASS(ImagePerceptor); Modified: trunk/spark/spark/spark.rb =================================================================== --- trunk/spark/spark/spark.rb 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/spark/spark.rb 2010-12-14 17:08:12 UTC (rev 228) @@ -283,7 +283,7 @@ simulationServer = sparkGetSimulationServer() if (simulationServer != nil) - simulationServer.setMultiThreads(true); + simulationServer.setMultiThreads(false); simulationServer.initControlNode('oxygen/AgentControl','AgentControl') # set auto speed adjust mode. @@ -635,3 +635,6 @@ # importBundle "agentsynceffector" + +# +importBundle "imageperceptor" Modified: trunk/spark/utility/libb64/cencode.h =================================================================== --- trunk/spark/utility/libb64/cencode.h 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/utility/libb64/cencode.h 2010-12-14 17:08:12 UTC (rev 228) @@ -8,8 +8,6 @@ #ifndef BASE64_CENCODE_H #define BASE64_CENCODE_H -#define BUFFERSIZE 64 - typedef enum { step_A, step_B, step_C Modified: trunk/spark/utility/libb64/decode.h =================================================================== --- trunk/spark/utility/libb64/decode.h 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/utility/libb64/decode.h 2010-12-14 17:08:12 UTC (rev 228) @@ -59,7 +59,7 @@ codelength = len; } - plainlength = decode(code, codelength, out+totalLen); + plainlength = base64_decode_block(code, codelength, out+totalLen, &_state); code += codelength; len -= codelength; @@ -71,17 +71,18 @@ return totalLen; } + int decode(const char* code_in, const int length_in, char* plaintext_out) + { + base64_init_decodestate(&_state); + return base64_decode_block(code_in, length_in, plaintext_out, &_state); + } + protected: int decode(char value_in) { return base64_decode_value(value_in); } - int decode(const char* code_in, const int length_in, char* plaintext_out) - { - return base64_decode_block(code_in, length_in, plaintext_out, &_state); - } - private: base64_decodestate _state; int _buffersize; Modified: trunk/spark/utility/libb64/encode.h =================================================================== --- trunk/spark/utility/libb64/encode.h 2010-12-14 17:07:37 UTC (rev 227) +++ trunk/spark/utility/libb64/encode.h 2010-12-14 17:08:12 UTC (rev 228) @@ -22,7 +22,7 @@ { public: - Encoder(int buffersize_in = BUFFERSIZE) + Encoder(int buffersize_in = 128) : _buffersize(buffersize_in) { _code = new char[2 * _buffersize]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2010-12-16 11:27:52
|
Revision: 231 http://simspark.svn.sourceforge.net/simspark/?rev=231&view=rev Author: yxu Date: 2010-12-16 11:27:45 +0000 (Thu, 16 Dec 2010) Log Message: ----------- compile by VC10 Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp trunk/spark/lib/oxygen/proxyserver/agentproxy.cpp Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-12-16 11:27:19 UTC (rev 230) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-12-16 11:27:45 UTC (rev 231) @@ -26,7 +26,6 @@ #include <soccerbase/soccerbase.h> #include <salt/gmath.h> #include <list> -#include <X11/X.h> #include <math.h> #include <salt/linesegment2.h> #include <limits> Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-12-16 11:27:19 UTC (rev 230) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-12-16 11:27:45 UTC (rev 231) @@ -508,7 +508,7 @@ int unum; bool specified = true; - shared_ptr<SoccerRuleAspect> soccerRuleAspect; + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; @@ -582,7 +582,7 @@ int unum; bool specified = true; - shared_ptr<SoccerRuleAspect> soccerRuleAspect; + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; @@ -643,7 +643,7 @@ int unum; bool specified = true; - shared_ptr<SoccerRuleAspect> soccerRuleAspect; + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; Modified: trunk/spark/lib/oxygen/proxyserver/agentproxy.cpp =================================================================== --- trunk/spark/lib/oxygen/proxyserver/agentproxy.cpp 2010-12-16 11:27:19 UTC (rev 230) +++ trunk/spark/lib/oxygen/proxyserver/agentproxy.cpp 2010-12-16 11:27:45 UTC (rev 231) @@ -23,7 +23,7 @@ #include <rcssnet/exception.hpp> #include <zeitgeist/logserver/logserver.h> #include <oxygen/simulationserver/netcontrol.h> - +#include <errno.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif @@ -32,7 +32,6 @@ using namespace zeitgeist; using namespace std; using namespace rcss::net; -using boost::shared_ptr; AgentProxy::AgentProxy(int cycleMillisecs) : Node(), mCycleMillisecs(cycleMillisecs), mFinished(false), @@ -69,7 +68,7 @@ mNetMessage = FindChildSupportingClass<NetMessage>(); if (mNetMessage.get() == 0) { - mNetMessage = shared_ptr<NetMessage>(new NetMessage()); + mNetMessage = boost::shared_ptr<NetMessage>(new NetMessage()); } mAgentConnectionThread = boost::thread( @@ -107,7 +106,7 @@ string servermsg, agentmsg; boost::system_time cycleFinishTime = boost::get_system_time() + boost::posix_time::milliseconds(mCycleMillisecs); - shared_ptr<NetBuffer> netbuf(new NetBuffer); + boost::shared_ptr<NetBuffer> netbuf(new NetBuffer); TRawBuffer recvbuf; mNetMessage->PrepareToSend(syncMsg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2010-12-17 00:23:23
|
Revision: 238 http://simspark.svn.sourceforge.net/simspark/?rev=238&view=rev Author: yxu Date: 2010-12-17 00:23:17 +0000 (Fri, 17 Dec 2010) Log Message: ----------- be able to render camera image on and off screen Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg trunk/spark/lib/kerosin/renderserver/baserenderserver.h trunk/spark/lib/kerosin/renderserver/rendercontrol.cpp trunk/spark/lib/kerosin/renderserver/renderserver.cpp trunk/spark/lib/kerosin/renderserver/renderserver.h trunk/spark/plugin/imageperceptor/imageperceptor.cpp trunk/spark/plugin/imageperceptor/imageperceptor.h trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp trunk/spark/plugin/imageperceptor/imagerender.cpp trunk/spark/plugin/imageperceptor/imagerender.h trunk/spark/test/scenetest/main.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2010-12-17 00:23:17 UTC (rev 238) @@ -99,7 +99,8 @@ ;; (setLocalRotation 0 0 0) ;; (nd ImagePerceptor ;; (setInterval 3) - ;; (setViewport 0 0 320 240) + ;; (setOffScreen false) + ;; (setResolution 320 240) ;; (setFOV 58) ;; (setZNear 0.003) ;; (setZFar 50) Modified: trunk/spark/lib/kerosin/renderserver/baserenderserver.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/baserenderserver.h 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/lib/kerosin/renderserver/baserenderserver.h 2010-12-17 00:23:17 UTC (rev 238) @@ -51,7 +51,7 @@ virtual ~BaseRenderServer() {} //! display the current active scene - virtual void Render() = 0; + virtual void Render(bool clean) = 0; //! width of the render target virtual int Width() const { return 0; } Modified: trunk/spark/lib/kerosin/renderserver/rendercontrol.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/rendercontrol.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/lib/kerosin/renderserver/rendercontrol.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -87,7 +87,7 @@ // update the window (pumps event loop, etc..) and render the // current frame mOpenGLServer->Update(); - mRenderServer->Render(); + mRenderServer->Render(true); RenderCustom(); mOpenGLServer->SwapBuffers(); ++mFramesRendered; Modified: trunk/spark/lib/kerosin/renderserver/renderserver.cpp =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/lib/kerosin/renderserver/renderserver.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -56,7 +56,7 @@ } void -RenderServer::Render() +RenderServer::Render(bool clean) { PreparePicking(); @@ -74,21 +74,29 @@ GetLog()->Error() << "(RenderServer) ERROR: found no camera node in the active scene\n"; return; - } + } + // set the view transformation + BindCamera(mCamera); + glClearColor( - mAmbientColor.r(), - mAmbientColor.g(), - mAmbientColor.b(), - mAmbientColor.a() - ); + mAmbientColor.r(), + mAmbientColor.g(), + mAmbientColor.b(), + mAmbientColor.a() + ); - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - glColor3f(1,1,1); + if (clean) + { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + } + else + { + glClear(GL_DEPTH_BUFFER_BIT); + } + glColor3f(1, 1, 1); + - // set the view transformation - BindCamera(mCamera); - // actual rendering // ambient pass Modified: trunk/spark/lib/kerosin/renderserver/renderserver.h =================================================================== --- trunk/spark/lib/kerosin/renderserver/renderserver.h 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/lib/kerosin/renderserver/renderserver.h 2010-12-17 00:23:17 UTC (rev 238) @@ -65,7 +65,7 @@ virtual ~RenderServer() {} //! display the current active scene - virtual void Render(); + virtual void Render(bool clean); //! @return the width of the current view virtual int Width() const; Modified: trunk/spark/plugin/imageperceptor/imageperceptor.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/plugin/imageperceptor/imageperceptor.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -89,9 +89,9 @@ return true; } -void ImagePerceptor::SetViewport(unsigned int x, unsigned int y, unsigned int w, unsigned int h) +void ImagePerceptor::SetResolution(unsigned int w, unsigned int h) { - mCamera->SetViewport(x, y, w, h); + mRender->SetResolution(w,h); } void ImagePerceptor::SetFOV(float fov) @@ -108,3 +108,8 @@ { mCamera->SetZFar(zFar); } + +void ImagePerceptor::SetOffScreen(bool offScreen) +{ + mRender->SetOffScreen(offScreen); +} Modified: trunk/spark/plugin/imageperceptor/imageperceptor.h =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor.h 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/plugin/imageperceptor/imageperceptor.h 2010-12-17 00:23:17 UTC (rev 238) @@ -38,13 +38,15 @@ virtual void OnLink(); - void SetViewport(unsigned int x, unsigned int y, unsigned int w, unsigned int h); + void SetResolution(unsigned int w, unsigned int h); void SetFOV(float fov); void SetZNear(float zNear); void SetZFar(float zFar); + + void SetOffScreen(bool offScreen); private: boost::shared_ptr<oxygen::Camera> mCamera; Modified: trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/plugin/imageperceptor/imageperceptor_c.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -23,22 +23,20 @@ using namespace boost; using namespace oxygen; -FUNCTION(ImagePerceptor, setViewport) +FUNCTION(ImagePerceptor, setResolution) { - unsigned int x,y,w,h; + unsigned int w,h; if ( - (in.GetSize() != 4) || - (! in.GetValue(in[0], x) ) || - (! in.GetValue(in[1], y) ) || - (! in.GetValue(in[2], w) ) || - (! in.GetValue(in[3], h) ) + (in.GetSize() != 2) || + (! in.GetValue(in[0], w) ) || + (! in.GetValue(in[1], h) ) ) { return false; } - obj->SetViewport(x, y, w, h); + obj->SetResolution(w, h); return true; } @@ -90,11 +88,28 @@ return true; } +FUNCTION(ImagePerceptor, setOffScreen) +{ + bool offScreen; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in[0], offScreen) ) + ) + { + return false; + } + + obj->SetOffScreen(offScreen); + return true; +} + void CLASS(ImagePerceptor)::DefineClass() { DEFINE_BASECLASS(oxygen/Perceptor); - DEFINE_FUNCTION(setViewport); + DEFINE_FUNCTION(setResolution); DEFINE_FUNCTION(setFOV); DEFINE_FUNCTION(setZNear); DEFINE_FUNCTION(setZFar); + DEFINE_FUNCTION(setOffScreen); } Modified: trunk/spark/plugin/imageperceptor/imagerender.cpp =================================================================== --- trunk/spark/plugin/imageperceptor/imagerender.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/plugin/imageperceptor/imagerender.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -33,7 +33,6 @@ #include "imagerender.h" #include <zeitgeist/logserver/logserver.h> -#define USE_FBO // using namespace kerosin; using namespace oxygen; @@ -42,8 +41,12 @@ using namespace salt; using namespace std; +unsigned int ImageRender::autoScreenPosX = 0; +unsigned int ImageRender::autoScreenPosY = 0; + ImageRender::ImageRender(): kerosin::CustomRender(), - mDataSize(0), mWidth(0), mHeight(0), mRequested(false) + mDataSize(0), mWidth(0), mHeight(0), mRequested(false),mOffScreen(false), + mScreenPosX(0), mScreenPosY(0) { } @@ -53,7 +56,7 @@ #define REG_GL_EXT_FUN(_ptr, _function) \ static _ptr _function = (_ptr) mOpenGLServer->GetExtension(#_function);\ if ( !_function ){ \ - GetLog()->Error()<<"(Image Perceptor) ERROR: can not get "#_function"\n"; \ + GetLog()->Error()<<"(ImageRender) ERROR: can not get "#_function"\n"; \ } void ImageRender::SetCamera(boost::shared_ptr<oxygen::Camera> camera) @@ -68,7 +71,7 @@ if (mRenderServer.expired()) { GetLog()->Error() - << "(ImagePerceptor) ERROR: RenderServer not found\n"; + << "(ImageRender) ERROR: RenderServer not found\n"; } RegisterCachedPath(mOpenGLServer,"/sys/server/opengl"); @@ -76,7 +79,7 @@ if (mOpenGLServer.expired()) { GetLog()->Error() - << "(ImagePerceptor) ERROR: OpenGLServer not found\n"; + << "(ImageRender) ERROR: OpenGLServer not found\n"; } // create a framebuffer object @@ -98,6 +101,7 @@ void ImageRender::Render() { + mRequested = true; if ( (!mRequested) || (mOpenGLServer.expired()) || (mRenderServer.expired()) @@ -109,19 +113,20 @@ int w = mCamera->GetViewportWidth(); int h = mCamera->GetViewportHeight(); -#ifdef USE_FBO - REG_GL_EXT_FUN( PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT ); - REG_GL_EXT_FUN( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT ); - REG_GL_EXT_FUN( PFNGLRENDERBUFFERSTORAGEEXTPROC, glRenderbufferStorageEXT ); - REG_GL_EXT_FUN( PFNGLBINDRENDERBUFFEREXTPROC, glBindRenderbufferEXT); - REG_GL_EXT_FUN( PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT ); + if (mOffScreen) + { + REG_GL_EXT_FUN(PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT); + REG_GL_EXT_FUN(PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT); + REG_GL_EXT_FUN(PFNGLRENDERBUFFERSTORAGEEXTPROC, glRenderbufferStorageEXT); + REG_GL_EXT_FUN(PFNGLBINDRENDERBUFFEREXTPROC, glBindRenderbufferEXT); + REG_GL_EXT_FUN(PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFBOId); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mRBOId); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, w, h); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - GL_RENDERBUFFER_EXT, mRBOId); + GL_RENDERBUFFER_EXT, mRBOId); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mDepthBuffer); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, w, h); @@ -130,20 +135,22 @@ // check FBO status GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - if(status != GL_FRAMEBUFFER_COMPLETE_EXT){ -// GetLog()->Error()<<"fbo error!\n"; + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) + { + GetLog()->Error() << "(ImageRender) fbo error!\n"; } -#endif + } + // setup the camera boost::shared_ptr<Camera> oldCamera = mRenderServer->GetCamera(); mRenderServer->SetCamera(mCamera); - mRenderServer->Render(); + mRenderServer->Render(false); -#ifdef USE_FBO -#else + if (!mOffScreen) + { glReadBuffer(GL_BACK); -#endif + } int size = w*h*3; if ( size != mDataSize ) @@ -152,7 +159,7 @@ mDataSize = size; } - glReadPixels(0, 0, + glReadPixels(, mScreenPosY, w, h, GL_RGB, GL_UNSIGNED_BYTE, @@ -160,11 +167,35 @@ mWidth = w; mHeight = h; -#ifdef USE_FBO + if (mOffScreen) + { // unbind FBO + REG_GL_EXT_FUN(PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif + } + mRenderServer->SetCamera(oldCamera); mRequested = false; } + +void ImageRender::SetResolution(int w, int h) +{ + if (!mOffScreen) // HACK! + { + // asssert this function is called only once per instance + // auto position on screen (simple) + mScreenPosX = autoScreenPosX; + int screenWidth = mRenderServer->GetCamera()->GetViewportWidth(); + if (mScreenPosX + w > screenWidth) + { + mScreenPosX = 0; + autoScreenPosY += h; + } + autoScreenPosX = mScreenPosX + w; + mScreenPosY = autoScreenPosY; + // + } + + mCamera->SetViewport(mScreenPosX, mScreenPosY, w, h); +} \ No newline at end of file Modified: trunk/spark/plugin/imageperceptor/imagerender.h =================================================================== --- trunk/spark/plugin/imageperceptor/imagerender.h 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/plugin/imageperceptor/imagerender.h 2010-12-17 00:23:17 UTC (rev 238) @@ -53,7 +53,14 @@ void RequestRender() { mRequested = true; } + void SetResolution(int w, int h); + + void SetOffScreen(bool offScreen) { mOffScreen = offScreen; } + + void SetScreenPos(int x, int y) { mScreenPosX = x; mScreenPosY = y; } + private: + boost::shared_ptr<oxygen::Camera> mCamera; /** cached reference to the RenderServer */ @@ -67,10 +74,15 @@ int mWidth; int mHeight; bool mRequested; + bool mOffScreen; + int mScreenPosX, mScreenPosY; unsigned int mFBOId; unsigned int mRBOId; unsigned int mDepthBuffer; + + static unsigned int autoScreenPosX; + static unsigned int autoScreenPosY; }; DECLARE_CLASS(ImageRender); Modified: trunk/spark/test/scenetest/main.cpp =================================================================== --- trunk/spark/test/scenetest/main.cpp 2010-12-17 00:22:35 UTC (rev 237) +++ trunk/spark/test/scenetest/main.cpp 2010-12-17 00:23:17 UTC (rev 238) @@ -163,7 +163,7 @@ shared_static_cast<RenderServer>(gContext->Get("/sys/server/scene")); if (renderServer) { - renderServer->Render(); + renderServer->Render(true); } #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2010-12-17 00:23:43
|
Revision: 239 http://simspark.svn.sourceforge.net/simspark/?rev=239&view=rev Author: yxu Date: 2010-12-17 00:23:36 +0000 (Fri, 17 Dec 2010) Log Message: ----------- ChangeLog Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rsgedit/ChangeLog trunk/spark/ChangeLog Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2010-12-17 00:23:17 UTC (rev 238) +++ trunk/rcssserver3d/ChangeLog 2010-12-17 00:23:36 UTC (rev 239) @@ -1,3 +1,9 @@ +2010-12-14 Yuan Xu <xu...@in...> + * rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp + * rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp + * spark/lib/oxygen/proxyserver/agentproxy.cpp + - compile by VC10 + 2010-09-28 Sander van Dijk <sgv...@gm...> * plugin/soccermonitor/soccerrender.cpp Modified: trunk/rsgedit/ChangeLog =================================================================== --- trunk/rsgedit/ChangeLog 2010-12-17 00:23:17 UTC (rev 238) +++ trunk/rsgedit/ChangeLog 2010-12-17 00:23:36 UTC (rev 239) @@ -1,3 +1,7 @@ +2010-12-14 Yuan Xu <xu...@in...> + * CMakeLists.txt + - use UseWxWidgets.cmake + 2010-02-28 Marian Buchta <mar...@gm...> * cmake/FindBoost.cmake: @@ -51,4 +55,4 @@ * wxutil/CMakeLists.txt: * CMakeLists.txt: - add wxWidgets definitions to toplevel compiler flags and remove from - other files \ No newline at end of file + other files Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2010-12-17 00:23:17 UTC (rev 238) +++ trunk/spark/ChangeLog 2010-12-17 00:23:36 UTC (rev 239) @@ -1,15 +1,32 @@ -2010-12-14 Yuan Xu <xu...@in...> - * rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp - * rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp - * spark/lib/oxygen/proxyserver/agentproxy.cpp - - compile by VC10 +2010-12-15 Yuan Xu <xu...@in...> + * plugin/imageperceptor/CMakeLists.txt + * plugin/imageperceptor/export.cpp + * plugin/imageperceptor/imageperceptor.cpp + * plugin/imageperceptor/imageperceptor.h + * plugin/imageperceptor/imagerender.cpp + * plugin/imageperceptor/imagerender.h + * plugin/imageperceptor/imagerender_c.cpp + - separate the render code + - render the image of camera in RenderControl + + * spark/spark.rb + - multi-threads works! + + * lib/kerosin/renderserver/baserenderserver.h + * lib/kerosin/renderserver/rendercontrol.cpp + * lib/kerosin/renderserver/renderserver.cpp + * lib/kerosin/renderserver/renderserver.h + * plugin/imageperceptor/imageperceptor.cpp + * plugin/imageperceptor/imageperceptor.h + * plugin/imageperceptor/imageperceptor_c.cpp + * plugin/imageperceptor/imagerender.cpp + * plugin/imageperceptor/imagerender.h + * test/scenetest/main.cpp + - be able to render camera image on and off screen - * rsgedit/CMakeLists.txt - - use UseWxWidgets.cmake - 2010-12-14 Yuan Xu <xu...@in...> - * spark/plugin/imageperceptor + * plugin/imageperceptor * spark/spark.rb - use base64 encoding image This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-02-11 22:53:56
|
Revision: 245 http://simspark.svn.sourceforge.net/simspark/?rev=245&view=rev Author: sgvandijk Date: 2011-02-11 22:53:50 +0000 (Fri, 11 Feb 2011) Log Message: ----------- - Use ode-config to find ODE. Helps find locally installed ODE - Use HINTS instead of PATHS for finding simspark, so SPARK_DIR has preference over default paths Modified Paths: -------------- trunk/rcssserver3d/cmake/FindODE.cmake trunk/rcssserver3d/cmake/FindSpark.cmake trunk/spark/cmake/FindODE.cmake Modified: trunk/rcssserver3d/cmake/FindODE.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindODE.cmake 2011-02-10 18:40:37 UTC (rev 244) +++ trunk/rcssserver3d/cmake/FindODE.cmake 2011-02-11 22:53:50 UTC (rev 245) @@ -18,11 +18,21 @@ OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE ODE_CONFIG_RESULT ) + EXECUTE_PROCESS( + COMMAND ${ODE_CONFIG} --prefix + OUTPUT_VARIABLE ODE_CONFIG_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ODE_CONFIG_RESULT + ) ELSE(COMMAND EXECUTE_PROCESS) EXEC_PROGRAM(${ODE_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODE_CONFIG_CFLAGS RETURN_VALUE ODE_CONFIG_RESULT ) + EXEC_PROGRAM(${ODE_CONFIG} ARGS "--prefix" + OUTPUT_VARIABLE ODE_CONFIG_PREFIX + RETURN_VALUE ODE_CONFIG_RESULT + ) ENDIF(COMMAND EXECUTE_PROCESS) # Parse the include flags. @@ -44,22 +54,25 @@ ENDIF(ODE_CONFIG) FIND_PATH(ODE_INCLUDE_DIR ode/ode.h + ${ODE_CONFIG_PREFIX}/include /usr/include /usr/local/include - $ENV{OGRE_HOME}/include # OGRE SDK on WIN32 + $ENV{ODE_HOME}/include $ENV{INCLUDE} C:/library/ode/include "C:/Program Files/ode/include" "C:/Program Files (x86)/ode/include" C:/ode/include + NO_DEFAULT_PATH ) FIND_LIBRARY(ODE_LIBRARY NAMES ode ode_double ode_single PATHS + ${ODE_CONFIG_PREFIX}/lib /usr/lib /usr/lib64 /usr/local/lib - $ENV{OGRE_HOME}/lib # OGRE SDK on WIN32 + $ENV{ODE_HOME}/lib C:/library/ode/lib/ "C:/Program Files/ode/lib/" "C:/Program Files (x86)/ode/lib/" @@ -68,6 +81,7 @@ releaselib ReleaseDoubleDLL ReleaseDoubleLib ReleaseSingleDLL ReleaseSingleLib + NO_DEFAULT_PATH ) IF (WIN32) Modified: trunk/rcssserver3d/cmake/FindSpark.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindSpark.cmake 2011-02-10 18:40:37 UTC (rev 244) +++ trunk/rcssserver3d/cmake/FindSpark.cmake 2011-02-11 22:53:50 UTC (rev 245) @@ -30,12 +30,12 @@ SET(SPARK_DIR $ENV{SPARK_DIR} "C:/Program Files/simspark" "C:/Program Files (x86)/simspark" "C:/library/simspark") FIND_PATH(SPARK_INCLUDE_DIR spark/spark.h - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(SPARK_NAMES spark spark_debug) FIND_LIBRARY(SPARK_LIBRARY NAMES ${SPARK_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) GET_FILENAME_COMPONENT(SPARK_LIB_DIR ${SPARK_LIBRARY} PATH) @@ -60,12 +60,12 @@ ENDIF (SALT_INCLUDE_DIR) FIND_PATH(SALT_INCLUDE_DIR salt/salt.h - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(SALT_NAMES salt salt_debug) FIND_LIBRARY(SALT_LIBRARY NAMES ${SALT_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) # handle the QUIETLY and REQUIRED arguments and set SALT_FOUND to TRUE if @@ -89,12 +89,12 @@ ENDIF (ZEITGEIST_INCLUDE_DIR) FIND_PATH(ZEITGEIST_INCLUDE_DIR zeitgeist/zeitgeist.h - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(ZEITGEIST_NAMES zeitgeist zeitgeist_debug) FIND_LIBRARY(ZEITGEIST_LIBRARY NAMES ${ZEITGEIST_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) # handle the QUIETLY and REQUIRED arguments and set ZEITGEIST_FOUND to TRUE if @@ -118,12 +118,12 @@ ENDIF (OXYGEN_INCLUDE_DIR) FIND_PATH(OXYGEN_INCLUDE_DIR oxygen/oxygen.h - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(OXYGEN_NAMES oxygen oxygen_debug) FIND_LIBRARY(OXYGEN_LIBRARY NAMES ${OXYGEN_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) # handle the QUIETLY and REQUIRED arguments and set OXYGEN_FOUND to TRUE if @@ -147,12 +147,12 @@ ENDIF (KEROSIN_INCLUDE_DIR) FIND_PATH(KEROSIN_INCLUDE_DIR kerosin/kerosin.h - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(KEROSIN_NAMES kerosin kerosin_debug) FIND_LIBRARY(KEROSIN_LIBRARY NAMES ${KEROSIN_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) # handle the QUIETLY and REQUIRED arguments and set KEROSIN_FOUND to TRUE if @@ -176,12 +176,12 @@ ENDIF (RCSSNET3D_INCLUDE_DIR) FIND_PATH(RCSSNET3D_INCLUDE_DIR rcssnet/addr.hpp - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark include/simspark) SET(RCSSNET3D_NAMES rcssnet3D rcssnet3D_debug) FIND_LIBRARY(RCSSNET3D_LIBRARY NAMES ${RCSSNET3D_NAMES} - PATHS ${SPARK_DIR} + HINTS ${SPARK_DIR} PATH_SUFFIXES simspark lib/simspark) # handle the QUIETLY and REQUIRED arguments and set RCSSNET3D_FOUND to TRUE if Modified: trunk/spark/cmake/FindODE.cmake =================================================================== --- trunk/spark/cmake/FindODE.cmake 2011-02-10 18:40:37 UTC (rev 244) +++ trunk/spark/cmake/FindODE.cmake 2011-02-11 22:53:50 UTC (rev 245) @@ -18,11 +18,21 @@ OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE ODE_CONFIG_RESULT ) + EXECUTE_PROCESS( + COMMAND ${ODE_CONFIG} --prefix + OUTPUT_VARIABLE ODE_CONFIG_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ODE_CONFIG_RESULT + ) ELSE(COMMAND EXECUTE_PROCESS) EXEC_PROGRAM(${ODE_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODE_CONFIG_CFLAGS RETURN_VALUE ODE_CONFIG_RESULT ) + EXEC_PROGRAM(${ODE_CONFIG} ARGS "--prefix" + OUTPUT_VARIABLE ODE_CONFIG_PREFIX + RETURN_VALUE ODE_CONFIG_RESULT + ) ENDIF(COMMAND EXECUTE_PROCESS) # Parse the include flags. @@ -44,6 +54,7 @@ ENDIF(ODE_CONFIG) FIND_PATH(ODE_INCLUDE_DIR ode/ode.h + ${ODE_CONFIG_PREFIX}/include /usr/include /usr/local/include $ENV{ODE_HOME}/include @@ -52,10 +63,12 @@ "C:/Program Files/ode/include" "C:/Program Files (x86)/ode/include" C:/ode/include + NO_DEFAULT_PATH ) FIND_LIBRARY(ODE_LIBRARY NAMES ode ode_double ode_single PATHS + ${ODE_CONFIG_PREFIX}/lib /usr/lib /usr/lib64 /usr/local/lib @@ -68,6 +81,7 @@ releaselib ReleaseDoubleDLL ReleaseDoubleLib ReleaseSingleDLL ReleaseSingleLib + NO_DEFAULT_PATH ) IF (WIN32) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-02-18 18:44:21
|
Revision: 246 http://simspark.svn.sourceforge.net/simspark/?rev=246&view=rev Author: sgvandijk Date: 2011-02-18 18:44:14 +0000 (Fri, 18 Feb 2011) Log Message: ----------- - spark.rb possible to be loaded locally - Taken out confusing output, output errors that are warnings with Warning - BaseNode keeps cache of BoseNode children (takes out loads of fynamic casting) - HingePerceptor can report torque - Fix multithreaded mode Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp trunk/spark/lib/oxygen/agentaspect/agentaspect.cpp trunk/spark/lib/oxygen/agentaspect/agentaspect.h trunk/spark/lib/oxygen/gamecontrolserver/gamecontrolserver.cpp trunk/spark/lib/oxygen/geometryserver/geometryserver.cpp trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp trunk/spark/lib/oxygen/physicsserver/hingejoint.cpp trunk/spark/lib/oxygen/physicsserver/hingejoint.h trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h trunk/spark/lib/oxygen/sceneserver/basenode.cpp trunk/spark/lib/oxygen/sceneserver/basenode.h trunk/spark/lib/oxygen/sceneserver/scene.cpp trunk/spark/lib/oxygen/sceneserver/scene.h trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp trunk/spark/plugin/odeimps/odehingejoint.cpp trunk/spark/plugin/odeimps/odehingejoint.h trunk/spark/plugin/sparkagent/hingeperceptor.cpp trunk/spark/plugin/sparkagent/hingeperceptor.h trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp trunk/spark/plugin/sparkmonitor/sparkmonitorclient.cpp trunk/spark/spark/spark.cpp trunk/spark/spark/spark.rb Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -861,4 +861,4 @@ void RestrictedVisionPerceptor::SetSenseLine(bool sense) { mSenseLine = sense; -} \ No newline at end of file +} Modified: trunk/spark/lib/oxygen/agentaspect/agentaspect.cpp =================================================================== --- trunk/spark/lib/oxygen/agentaspect/agentaspect.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/agentaspect/agentaspect.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -21,6 +21,7 @@ */ #include "agentaspect.h" #include <zeitgeist/logserver/logserver.h> +#include <oxygen/sceneserver/scene.h> using namespace boost; using namespace oxygen; @@ -38,11 +39,20 @@ { } +void +AgentAspect::UpdateCacheInternal() +{ + GetLog()->Debug() << "(AgentAspect) Updating cache\n"; + + UpdateEffectorMap(); + + mPerceptors.clear(); + ListChildrenSupportingClass<Perceptor>(mPerceptors,true); +} + bool AgentAspect::RealizeActions(boost::shared_ptr<ActionObject::TList> actions) { - UpdateEffectorMap(); - for ( ActionObject::TList::iterator iter = actions->begin(); iter != actions->end(); @@ -79,15 +89,13 @@ { mPerceptorCycle++; // build list of perceptors, searching recursively - TLeafList perceptors; - ListChildrenSupportingClass<Perceptor>(perceptors,true); boost::shared_ptr<PredicateList> predList(new PredicateList()); // query the perceptors for new data for ( - TLeafList::iterator iter = perceptors.begin(); - iter != perceptors.end(); + TLeafList::iterator iter = mPerceptors.begin(); + iter != mPerceptors.end(); ++iter ) { @@ -167,6 +175,7 @@ } return added; + } bool AgentAspect::IsSynced() const Modified: trunk/spark/lib/oxygen/agentaspect/agentaspect.h =================================================================== --- trunk/spark/lib/oxygen/agentaspect/agentaspect.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/agentaspect/agentaspect.h 2011-02-18 18:44:14 UTC (rev 246) @@ -65,6 +65,8 @@ /** looks up the effector corresponding to a predicate */ virtual boost::shared_ptr<Effector> GetEffector(const std::string predicate) const; + void UpdateCacheInternal(); + //! @return the unique ID for the agent aspect inline int ID() const { return mID; } @@ -83,6 +85,9 @@ private: int mID; + /** cache of the agent's effectors */ + TLeafList mPerceptors; + /** indicates how many times the QueryPerceptors be called */ unsigned int mPerceptorCycle; Modified: trunk/spark/lib/oxygen/gamecontrolserver/gamecontrolserver.cpp =================================================================== --- trunk/spark/lib/oxygen/gamecontrolserver/gamecontrolserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/gamecontrolserver/gamecontrolserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -155,12 +155,20 @@ aspect->SetName(name.str()); scene->AddChildReference(aspect); + mAgentMap[id] = aspect; + bool ok = aspect->Init(mCreateEffector,id); + if (ok) + { + aspect->UpdateCache(); + scene->UpdateCache(false); + } + // mark the scene as modified scene->SetModified(true); - return aspect->Init(mCreateEffector,id); + return ok; } bool GameControlServer::AgentDisappear(int id) @@ -178,13 +186,12 @@ // remove the AgentAspect from the Scene and our map. The // AgentAspect does all the necessary cleanup boost::shared_ptr<Scene> scene = GetActiveScene(); + if (scene.get() != 0) { (*iter).second->UnlinkChildren(); (*iter).second->Unlink(); - // mark the scene as modified - scene->SetModified(true); } else { GetLog()->Error() @@ -194,6 +201,9 @@ mAgentMap.erase(id); + // mark the scene as modified + scene->SetModified(true); + GetLog()->Debug() << "(GameControlServer) An agent disconnected (id: " << id << ")\n"; @@ -257,9 +267,7 @@ // construct an ActionList using the registered effectors boost::shared_ptr<ActionObject::TList> actionList(new ActionObject::TList()); - // update the map of effectors below the agentaspect boost::shared_ptr<AgentAspect> aspect = (*iter).second; - aspect->UpdateEffectorMap(); for ( Modified: trunk/spark/lib/oxygen/geometryserver/geometryserver.cpp =================================================================== --- trunk/spark/lib/oxygen/geometryserver/geometryserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/geometryserver/geometryserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -63,7 +63,7 @@ importer->SetName(importerName); AddChildReference(importer); - GetLog()->Normal() + GetLog()->Debug() << "(GeometryServer) MeshImporter '" << importerName << "' registered\n"; return true; @@ -139,7 +139,7 @@ mesh->SetName(name); } - GetLog()->Normal() << "(GeometryServer) imported mesh '" << meshName + GetLog()->Debug() << "(GeometryServer) imported mesh '" << meshName << " with '" << importer->GetName() << "'\n"; if (mesh.get() == 0 || mesh->GetVertexCount() == 0) @@ -183,14 +183,14 @@ } mMeshMap[name] = mesh; - GetLog()->Normal() << "(GeometryServer) mesh " << name << " registered\n"; + GetLog()->Debug() << "(GeometryServer) mesh " << name << " registered\n"; TLeafList exporters; ListChildrenSupportingClass<MeshExporter>(exporters); for (TLeafList::const_iterator bi = exporters.begin(); bi != exporters.end(); ++bi) { - GetLog()->Normal() << "(GeometryServer) additionally registered mesh " + GetLog()->Debug() << "(GeometryServer) additionally registered mesh " << name << " via MeshExporter '" << (*bi)->GetName() << "'\n"; boost::shared_ptr<MeshExporter> mb = shared_static_cast<MeshExporter>(*bi); mb->RegisterMesh(mesh); @@ -213,7 +213,7 @@ exporter->SetName(name); AddChildReference(exporter); - GetLog()->Normal() << "(GeometryServer) MeshExporter '" << name << "' registered\n"; + GetLog()->Debug() << "(GeometryServer) MeshExporter '" << name << "' registered\n"; return true; } Modified: trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp =================================================================== --- trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -44,8 +44,8 @@ if (mSimulationServer.expired()) { - GetLog()->Error() - << "(MonitorServer) ERROR: SimulationServer not found.\n"; + GetLog()->Warning() + << "(MonitorServer) WARNING: SimulationServer not found.\n"; } } Modified: trunk/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/hingejoint.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/physicsserver/hingejoint.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -134,6 +134,11 @@ return mHingeJointImp->GetAngleRate(mJointID); } +float HingeJoint::GetTorque() const +{ + return mHingeJointImp->GetTorque(mJointID); +} + void HingeJoint::SetParameter(int parameter, float value){ mJointImp->SetParameter(parameter, value, mJointID); } Modified: trunk/spark/lib/oxygen/physicsserver/hingejoint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/hingejoint.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/physicsserver/hingejoint.h 2011-02-18 18:44:14 UTC (rev 246) @@ -69,6 +69,9 @@ /** returns the time derivate of the hinge angle */ float GetAngleRate() const; + /** returns the torque on the joint */ + float GetTorque() const; + /** Sets a parameter value of this joint*/ void SetParameter(int parameter, float value); Modified: trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h 2011-02-18 18:44:14 UTC (rev 246) @@ -67,6 +67,9 @@ /** returns the time derivate of the hinge angle */ virtual float GetAngleRate(long jointID) const = 0; + + /** returns the torque on the joint */ + virtual float GetTorque(long jointID) const = 0; }; } //namespace oxygen Modified: trunk/spark/lib/oxygen/sceneserver/basenode.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -84,12 +84,30 @@ { } +Leaf::TLeafList BaseNode::GetBaseNodeChildren() +{ + return mBaseNodeChildren; +} + +void BaseNode::UpdateCache(bool recursive) +{ + UpdateBaseNodeChildren(); + UpdateCacheInternal(); + + if (recursive) + { + // perform update on hierarchy + for (TLeafList::iterator i = mBaseNodeChildren.begin(); i!= mBaseNodeChildren.end(); ++i) + { + shared_static_cast<BaseNode>(*i)->UpdateCache(); + } + } +} + void BaseNode::PrePhysicsUpdate(float deltaTime) { // perform update on hierarchy - TLeafList baseNodes; - ListChildrenSupportingClass<BaseNode>(baseNodes); - for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) + for (TLeafList::iterator i = mBaseNodeChildren.begin(); i!= mBaseNodeChildren.end(); ++i) { shared_static_cast<BaseNode>(*i)->PrePhysicsUpdate(deltaTime); } @@ -104,9 +122,7 @@ void BaseNode::PostPhysicsUpdate() { // perform update on hierarchy - TLeafList baseNodes; - ListChildrenSupportingClass<BaseNode>(baseNodes); - for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) + for (TLeafList::iterator i = mBaseNodeChildren.begin(); i!= mBaseNodeChildren.end(); ++i) { shared_static_cast<BaseNode>(*i)->PostPhysicsUpdate(); } @@ -128,9 +144,7 @@ mWorldBoundingBox.TransformBy(worldTransform); // perform update on hierarchy - TLeafList baseNodes; - ListChildrenSupportingClass<BaseNode>(baseNodes); - for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) + for (TLeafList::iterator i = mBaseNodeChildren.begin(); i!= mBaseNodeChildren.end(); ++i) { boost::shared_ptr<BaseNode> node = shared_static_cast<BaseNode>(*i); node->UpdateHierarchy(); @@ -178,6 +192,12 @@ { } +void BaseNode::UpdateBaseNodeChildren() +{ + mBaseNodeChildren.clear(); + ListChildrenSupportingClass<BaseNode>(mBaseNodeChildren); +} + const salt::AABB3& BaseNode::GetWorldBoundingBox() const { return mWorldBoundingBox; Modified: trunk/spark/lib/oxygen/sceneserver/basenode.h =================================================================== --- trunk/spark/lib/oxygen/sceneserver/basenode.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/sceneserver/basenode.h 2011-02-18 18:44:14 UTC (rev 246) @@ -83,8 +83,14 @@ /** returns the world bounding box of this node */ const salt::AABB3& GetWorldBoundingBox() const; + /** get the cached BaseNode children of this node */ + TLeafList GetBaseNodeChildren(); + // scene graph update passes + /** updates internal cache */ + virtual void UpdateCache(bool recursive = true); + /** updates internal state before physics calculation */ void PrePhysicsUpdate(float deltaTime); @@ -123,6 +129,9 @@ etc..) */ virtual void UpdateHierarchyInternal(); + virtual void UpdateCacheInternal() {} + + void UpdateBaseNodeChildren(); // // Members // @@ -138,6 +147,8 @@ /** world bounding box */ salt::AABB3 mWorldBoundingBox; + + TLeafList mBaseNodeChildren; }; DECLARE_CLASS(BaseNode); Modified: trunk/spark/lib/oxygen/sceneserver/scene.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/scene.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/sceneserver/scene.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -34,6 +34,16 @@ { } +void Scene::UpdateCacheInternal() +{ + mLastCacheUpdate = mModifiedNum; +} + +int Scene::GetLastCacheUpdate() +{ + return mLastCacheUpdate; +} + const salt::Matrix& Scene::GetWorldTransform() const { return mIdentityMatrix; @@ -58,4 +68,3 @@ { return mModifiedNum; } - Modified: trunk/spark/lib/oxygen/sceneserver/scene.h =================================================================== --- trunk/spark/lib/oxygen/sceneserver/scene.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/sceneserver/scene.h 2011-02-18 18:44:14 UTC (rev 246) @@ -69,12 +69,19 @@ /** return how many times the scene was modified */ int GetModifiedNum(); + /** return he modification count at the last update */ + int GetLastCacheUpdate(); protected: + void UpdateCacheInternal(); + /** true, if the scene is modified */ bool mModified; /** how many times the scene was modified */ int mModifiedNum; + + /** the modification count at the last update */ + int mLastCacheUpdate; }; DECLARE_CLASS(Scene); Modified: trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -41,7 +41,7 @@ int SceneServer::mTransformMark = 0; SceneServer::SceneServer() : Node() -{ +{ } SceneServer::~SceneServer() @@ -95,6 +95,9 @@ } mPhysicsServer->UpdateCache(mActiveScene.get()); + + if (mActiveScene->GetLastCacheUpdate() != mActiveScene->GetModifiedNum()) + mActiveScene->UpdateCache(); } void SceneServer::OnUnlink() @@ -181,6 +184,7 @@ } UpdateCache(); + ++mTransformMark; mActiveScene->PrePhysicsUpdate(deltaTime); @@ -257,7 +261,7 @@ if (importer->ImportScene(file,root,parameter)) { - GetLog()->Normal() + GetLog()->Debug() << "(SceneServer) imported scene file '" << file << " with '" << importer->GetName() @@ -378,7 +382,7 @@ importer->SetName(importerName); AddChildReference(importer); - GetLog()->Normal() + GetLog()->Debug() << "(SceneServer) SceneImporter '" << importerName << "' registered\n"; return true; Modified: trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -62,6 +62,7 @@ } string header = mMonitorServer->GetMonitorHeaderInfo(); + mNetMessage->PrepareToSend(header); SendClientMessage(client->addr,header); @@ -90,10 +91,19 @@ string info; boost::shared_ptr<Scene> scene = GetActiveScene(); if (scene.get() != 0 - && scene->GetModifiedNum() > mFullStateLogged ) + && scene->GetModifiedNum() > mFullStateLogged) { - mFullStateLogged = scene->GetModifiedNum(); - info = mMonitorServer->GetMonitorHeaderInfo(); + if (scene->GetLastCacheUpdate() == scene->GetModifiedNum()) + { + mFullStateLogged = scene->GetModifiedNum(); + info = mMonitorServer->GetMonitorHeaderInfo(); + } + else + { + GetLog()->Debug() + << "(MonitorControl) Scene is modified, but hasn't updated cache yet. Doing nothing.\n"; + return; + } } else { Modified: trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -427,10 +427,12 @@ while (!mExitThreads) { ++mCycle; + mThreadBarrier->wait(); if (mExit) mExitThreads = true; // Wait for SimControlNodes' acts at the begining of a cycle + mThreadBarrier->wait(); finalDelta = initDelta = mSumDeltaTime; @@ -480,6 +482,7 @@ while (!mExitThreads) { mThreadBarrier->wait(); + newCycle = false; if ( controlNode->GetTime() - mSimTime <= 0.005f ) { @@ -489,14 +492,9 @@ controlNode->ActAgent(); controlNode->SetSimTime(mSimTime); } + mThreadBarrier->wait(); - if (isInputControl) - { - while (int(mSumDeltaTime*100) < int(mSimStep*100)) - controlNode->StartCycle(); // advance the time - } - // wait for physics update mThreadBarrier->wait(); if (!isRenderControl && newCycle) Modified: trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp =================================================================== --- trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -258,7 +258,7 @@ void ScriptServer::UpdateCachedAllNodes() { - GetLog()->Normal() << "(ScriptServer) updating cached script variables\n"; + GetLog()->Debug() << "(ScriptServer) updating cached script variables\n"; GetCore()->GetRoot()->UpdateCached(); } @@ -480,7 +480,7 @@ { // run the init script in the sourceDir string sourcePath = sourceDir + salt::RFile::Sep() + name; - GetLog()->Normal() << "(ScriptServer) Running " << sourcePath << "... " << endl; + GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... " << endl; boost::shared_ptr<salt::StdFile> file(new(salt::StdFile)); if (! file->Open(sourcePath.c_str())) @@ -493,7 +493,7 @@ return eError; } else { - GetLog()->Normal() << "(ScriptServer) Script ended OK " << sourcePath << endl; + GetLog()->Debug() << "(ScriptServer) Script ended OK " << sourcePath << endl; } // copy it to the destDir @@ -504,7 +504,7 @@ string destPath = destDir + salt::RFile::Sep() + name; - GetLog()->Normal() << "Copying " << sourcePath + GetLog()->Debug() << "Copying " << sourcePath << " to " << destPath << endl; stringstream s; @@ -579,7 +579,7 @@ return false; } - GetLog()->Normal() << "(ScriptServer) Created Directory '" + GetLog()->Debug() << "(ScriptServer) Created Directory '" << dotDir << "'\n"; return true; @@ -589,6 +589,9 @@ ScriptServer::RunInitScript(const string &fileName, const string &relPath, EInitScriptType type) { + GetLog()->Debug() << "(ScriptServer) Attempting to run init script '" + << fileName << "'\n"; + string dotDir; bool validDotDir = (type == IS_USERLOCAL) && @@ -607,56 +610,52 @@ if (validDotDir) { + // Trying dot-dir in home directory result = RunInitScriptInternal(dotDir, fileName, false); - } + if (result == eOK) + { + GetLog()->Debug() << "(ScriptServer) : Ran init script '" + << dotDir << salt::RFile::Sep() << fileName << "'\n"; + return true; + } + else if (result == eError) + { + GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" + << dotDir << salt::RFile::Sep() << fileName << "'\n"; + return false; + } - if (result == eOK) - { - GetLog()->Debug() << "(ScriptServer) : Ran init script '" - << dotDir << salt::RFile::Sep() << fileName << "'\n"; - return true; - } - - if (result == eNotFound) - { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" - << dotDir << salt::RFile::Sep() << fileName << "'\n"; + << dotDir << salt::RFile::Sep() << fileName << "'\n"; } - else if (result == eError) - { - GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" - << dotDir << salt::RFile::Sep() << fileName << "'\n"; - return false; - } - // + + // Trying package data directory result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); - if (result == eOK) { GetLog()->Debug() << "(ScriptServer) : Ran init script '" << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; return true; } - - if (result == eNotFound) - { - GetLog()->Debug() << "(ScriptServer) : Did not find init script '" - << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; - } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; + return false; } + GetLog()->Debug() << "(ScriptServer) : Did not find init script '" + << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; + // Trying relative path to cwd result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); - if (result == eNotFound) + if (result == eOK) { - GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" - << fileName << "'\n"; + GetLog()->Debug() << "(ScriptServer) : Ran init script '" + << mRelPathPrefix+relPath << salt::RFile::Sep() << fileName << "'\n"; + return true; } else if (result == eError) { @@ -664,5 +663,7 @@ << mRelPathPrefix+relPath << salt::RFile::Sep() << fileName << "'\n"; } + GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" + << fileName << "'\n"; return (result == eOK); } Modified: trunk/spark/plugin/odeimps/odehingejoint.cpp =================================================================== --- trunk/spark/plugin/odeimps/odehingejoint.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/odeimps/odehingejoint.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -32,6 +32,7 @@ { dWorldID ODEWorld = (dWorldID) worldID; dJointID ODEJoint = dJointCreateHinge(ODEWorld, 0); + dJointSetFeedback( ODEJoint, &mFeedback ); return (long) ODEJoint; } @@ -86,3 +87,10 @@ dJointID ODEJoint = (dJointID) jointID; return gRadToDeg(dJointGetHingeAngleRate(ODEJoint)); } + +float HingeJointImp::GetTorque(long jointID) const +{ + dJointID ODEJoint = (dJointID) jointID; + dJointFeedback* fb = dJointGetFeedback(ODEJoint); + return dLENGTH(fb->t1) + dLENGTH(fb->t2); +} Modified: trunk/spark/plugin/odeimps/odehingejoint.h =================================================================== --- trunk/spark/plugin/odeimps/odehingejoint.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/odeimps/odehingejoint.h 2011-02-18 18:44:14 UTC (rev 246) @@ -38,6 +38,10 @@ salt::Vector3f GetAxis(long jointID); float GetAngle(long jointID) const; float GetAngleRate(long jointID) const; + float GetTorque(long jointID) const; +private: + dJointFeedback mFeedback; + }; DECLARE_CLASS(HingeJointImp); Modified: trunk/spark/plugin/sparkagent/hingeperceptor.cpp =================================================================== --- trunk/spark/plugin/sparkagent/hingeperceptor.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/sparkagent/hingeperceptor.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -48,6 +48,13 @@ axisElement.AddValue(mJoint->GetAngleRate()); } +void HingePerceptor::InsertAxisTorque(Predicate& predicate) +{ + ParameterList& axisElement = predicate.parameter.AddList(); + axisElement.AddValue(string("tq")); + axisElement.AddValue(mJoint->GetTorque()); +} + bool HingePerceptor::Percept(boost::shared_ptr<oxygen::PredicateList> predList) { if (mJoint.get() == 0) @@ -65,6 +72,7 @@ InsertAxisAngle(predicate); //InsertAxisRate(predicate); - + //InsertAxisTorque(predicate); + return true; } Modified: trunk/spark/plugin/sparkagent/hingeperceptor.h =================================================================== --- trunk/spark/plugin/sparkagent/hingeperceptor.h 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/sparkagent/hingeperceptor.h 2011-02-18 18:44:14 UTC (rev 246) @@ -35,6 +35,7 @@ protected: void InsertAxisAngle(oxygen::Predicate& predicate); void InsertAxisRate(oxygen::Predicate& predicate); + void InsertAxisTorque(oxygen::Predicate& predicate); }; DECLARE_CLASS(HingePerceptor); Modified: trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -415,17 +415,13 @@ { bool closeParen = DescribeNode(ss, node); - for (TLeafList::iterator i = node->begin(); i!= node->end(); ++i) + TLeafList baseNodes = node->GetBaseNodeChildren(); + for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) { boost::shared_ptr<BaseNode> baseNode = shared_dynamic_cast<BaseNode>(*i); - if (baseNode.get() == 0) - { - continue; - } - DescribeScene(ss,baseNode); } - + if (closeParen) { ss << ")"; Modified: trunk/spark/plugin/sparkmonitor/sparkmonitorclient.cpp =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitorclient.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/plugin/sparkmonitor/sparkmonitorclient.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -191,7 +191,8 @@ } mActiveScene = mSceneServer->GetActiveScene(); - + mActiveScene->UpdateCache(); + if (mActiveScene.get() == 0) { return; @@ -233,6 +234,8 @@ mSceneImporter->ParseScene(string(pcont->lastPos), mManagedScene, boost::shared_ptr<ParameterList>()); + + mActiveScene->SetModified(true); destroy_sexp(sexp_custom); destroy_continuation(pcont); Modified: trunk/spark/spark/spark.cpp =================================================================== --- trunk/spark/spark/spark.cpp 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/spark/spark.cpp 2011-02-18 18:44:14 UTC (rev 246) @@ -109,7 +109,7 @@ ( "spark.rb", "lib/spark", - ScriptServer::IS_COMMON + ScriptServer::IS_USERLOCAL ); UpdateCached(); Modified: trunk/spark/spark/spark.rb =================================================================== --- trunk/spark/spark/spark.rb 2011-02-11 22:53:50 UTC (rev 245) +++ trunk/spark/spark/spark.rb 2011-02-18 18:44:14 UTC (rev 246) @@ -188,8 +188,6 @@ end def sparkSetupMonitor - print "(spark.rb) sparkSetupMonitor\n" - # add the agent control node simulationServer = sparkGetSimulationServer() if (simulationServer != nil) @@ -205,7 +203,8 @@ else if ($monitorType == 'tcp') monitorClient.setClientTypeTCP() else - print "(spark.rb) unknown monitor socket type " + print "(spark.rb) sparkSetupMonitor\n" + print "(spark.rb) ERROR: unknown monitor socket type " print $monitorType print "\n" end @@ -218,7 +217,7 @@ end def sparkSetupMonitorLogPlayer - print "(spark.rb) sparkSetupMonitorLogPlayer\n" + #print "(spark.rb) sparkSetupMonitorLogPlayer\n" simulationServer = sparkGetSimulationServer() if (simulationServer != nil) @@ -241,7 +240,7 @@ # simulation specific monitor processing # def sparkRegisterCustomMonitor(className) - print "(spark.rb) sparkRegisterCustomMonitor " + className + "\n" + #print "(spark.rb) sparkRegisterCustomMonitor " + className + "\n" sparkGetSimulationServer() sparkCreate(className, $serverPath+'simulation/SparkMonitorClient/'+className) end @@ -251,7 +250,7 @@ # application specific render logic # def sparkRegisterCustomRender(className) - print "(spark.rb) sparkRegisterCustomRender " + className + "\n" + #print "(spark.rb) sparkRegisterCustomRender " + className + "\n" sparkGetSimulationServer() sparkCreate(className, $serverPath+'simulation/RenderControl/'+className) end @@ -261,7 +260,7 @@ # application specific input processing # def sparkRegisterCustomInput(className) - print "(spark.rb) sparkRegisterCustomInput " + className + "\n" + #print "(spark.rb) sparkRegisterCustomInput " + className + "\n" sparkGetSimulationServer() sparkCreate(className, $serverPath+'simulation/InputControl/'+className) end @@ -271,13 +270,12 @@ # commands received from a monitor client # def sparkRegisterMonitorCmdParser(className) - print "(spark.rb) sparkRegisterMonitorCmdParser " + className + "\n" + #print "(spark.rb) sparkRegisterMonitorCmdParser " + className + "\n" sparkGetMonitorServer() sparkCreate(className, $serverPath+'monitor/SparkMonitor/'+className) end def sparkSetupServer - print "(spark.rb) sparkSetupServer\n" # add the agent control node simulationServer = sparkGetSimulationServer() @@ -306,7 +304,8 @@ else if ($agentType == 'tcp') agentControl.setServerTypeTCP() else - print "(spark.rb) unknown agent socket type " + print "(spark.rb) sparkSetupServer\n" + print "(spark.rb) ERROR: unknown agent socket type " print $agentType print "\n" end @@ -321,7 +320,8 @@ else if ($serverType == 'tcp') monitorControl.setServerTypeTCP() else - print "(spark.rb) unknown monitor socket type " + print "(spark.rb) sparkSetupServer\n" + print "(spark.rb) ERROR: unknown monitor socket type " print $serverType print "\n" end @@ -416,7 +416,7 @@ end def sparkSetupTrain() - print "(spark.rb) sparkSetupTrain\n" + #print "(spark.rb) sparkSetupTrain\n" # # register train control node to the simulation server @@ -504,7 +504,7 @@ # deregisters all output stream def sparkResetLogging() - print "(spark.rb) sparkResetLogging removing all log targets\n"; + #print "(spark.rb) sparkResetLogging removing all log targets\n"; logServer = get($serverPath+'log') if (logServer != nil) @@ -513,11 +513,21 @@ end +# logs all normal output to cout +def sparkLogNormalToCout() + sparkEnableLog(':cout', 'eNormal') +end + # logs all error output to cerr def sparkLogErrorToCerr() sparkEnableLog(':cerr', 'eError') end +# logs all warning output to cerr +def sparkLogWarningToCerr() + sparkEnableLog(':cerr', 'eWarning') +end + # logs all debug output to cerr def sparkLogDebugToCerr() sparkEnableLog(':cerr', 'eDebug') @@ -552,12 +562,12 @@ # setup spark # -print "(spark.rb) setup\n" +#print "(spark.rb) setup\n" #import the implementations of the desired physics engine #currently supported: odeimps (uses Open Dynamics Engine) importBundle 'odeimps' -print "(spark.rb) using ODE, to change the physics engine go to line 559 in spark.rb\n" +#print "(spark.rb) using ODE, to change the physics engine go to line 559 in spark.rb\n" # # set up logging This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-02-26 00:09:59
|
Revision: 247 http://simspark.svn.sourceforge.net/simspark/?rev=247&view=rev Author: sgvandijk Date: 2011-02-26 00:09:51 +0000 (Sat, 26 Feb 2011) Log Message: ----------- - Use ode-config --libs flags Modified Paths: -------------- trunk/rcssserver3d/cmake/FindODE.cmake trunk/spark/cmake/FindODE.cmake Modified: trunk/rcssserver3d/cmake/FindODE.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindODE.cmake 2011-02-18 18:44:14 UTC (rev 246) +++ trunk/rcssserver3d/cmake/FindODE.cmake 2011-02-26 00:09:51 UTC (rev 247) @@ -24,6 +24,12 @@ OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE ODE_CONFIG_RESULT ) + EXECUTE_PROCESS( + COMMAND ${ODE_CONFIG} --libs + OUTPUT_VARIABLE ODE_CONFIG_LIBS + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ODE_CONFIG_RESULT + ) ELSE(COMMAND EXECUTE_PROCESS) EXEC_PROGRAM(${ODE_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODE_CONFIG_CFLAGS @@ -33,6 +39,10 @@ OUTPUT_VARIABLE ODE_CONFIG_PREFIX RETURN_VALUE ODE_CONFIG_RESULT ) + EXEC_PROGRAM(${ODE_CONFIG} ARGS "--libs" + OUTPUT_VARIABLE ODE_CONFIG_LIBS + RETURN_VALUE ODE_CONFIG_RESULT + ) ENDIF(COMMAND EXECUTE_PROCESS) # Parse the include flags. @@ -48,9 +58,12 @@ SET(ODE_EXTRA_CFLAGS ${ODE_EXTRA_CFLAGS} "${flag}") ENDIF("${flag}" MATCHES "^-D") ENDFOREACH(flag) + + SET(ODE_EXTRA_LDFLAGS ${ODE_CONFIG_LIBS}) ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") MESSAGE("Error running ${ODE_CONFIG}: [${ODE_CONFIG_RESULT}]") ENDIF("${ODE_CONFIG_RESULT}" MATCHES "^0$") + ENDIF(ODE_CONFIG) FIND_PATH(ODE_INCLUDE_DIR ode/ode.h @@ -99,6 +112,13 @@ SET(ODE_CFLAGS CACHE STRING "Additional ODE flags") ENDIF (ODE_EXTRA_CFLAGS) + IF (ODE_EXTRA_LDFLAGS) + SET(ODE_LDFLAGS ${ODE_EXTRA_LDFLAGS} CACHE STRING "Additional ODE linker flags") + MESSAGE(STATUS "Found additional linker flags for ODE: ${ODE_LDFLAGS}") + ELSE (ODE_EXTRA_LDFLAGS) + SET(ODE_CFLAGS CACHE STRING "Additional ODE linker flags") + ENDIF (ODE_EXTRA_LDFLAGS) + IF(ODE_INCLUDE_DIR) MESSAGE(STATUS "Found ODE include dir: ${ODE_INCLUDE_DIR}") ELSE(ODE_INCLUDE_DIR) Modified: trunk/spark/cmake/FindODE.cmake =================================================================== --- trunk/spark/cmake/FindODE.cmake 2011-02-18 18:44:14 UTC (rev 246) +++ trunk/spark/cmake/FindODE.cmake 2011-02-26 00:09:51 UTC (rev 247) @@ -24,6 +24,12 @@ OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE ODE_CONFIG_RESULT ) + EXECUTE_PROCESS( + COMMAND ${ODE_CONFIG} --libs + OUTPUT_VARIABLE ODE_CONFIG_LIBS + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ODE_CONFIG_RESULT + ) ELSE(COMMAND EXECUTE_PROCESS) EXEC_PROGRAM(${ODE_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODE_CONFIG_CFLAGS @@ -33,6 +39,10 @@ OUTPUT_VARIABLE ODE_CONFIG_PREFIX RETURN_VALUE ODE_CONFIG_RESULT ) + EXEC_PROGRAM(${ODE_CONFIG} ARGS "--libs" + OUTPUT_VARIABLE ODE_CONFIG_LIBS + RETURN_VALUE ODE_CONFIG_RESULT + ) ENDIF(COMMAND EXECUTE_PROCESS) # Parse the include flags. @@ -48,9 +58,12 @@ SET(ODE_EXTRA_CFLAGS ${ODE_EXTRA_CFLAGS} "${flag}") ENDIF("${flag}" MATCHES "^-D") ENDFOREACH(flag) + + SET(ODE_EXTRA_LDFLAGS ${ODE_CONFIG_LIBS}) ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") MESSAGE("Error running ${ODE_CONFIG}: [${ODE_CONFIG_RESULT}]") ENDIF("${ODE_CONFIG_RESULT}" MATCHES "^0$") + ENDIF(ODE_CONFIG) FIND_PATH(ODE_INCLUDE_DIR ode/ode.h @@ -99,6 +112,13 @@ SET(ODE_CFLAGS CACHE STRING "Additional ODE flags") ENDIF (ODE_EXTRA_CFLAGS) + IF (ODE_EXTRA_LDFLAGS) + SET(ODE_LDFLAGS ${ODE_EXTRA_LDFLAGS} CACHE STRING "Additional ODE linker flags") + MESSAGE(STATUS "Found additional linker flags for ODE: ${ODE_LDFLAGS}") + ELSE (ODE_EXTRA_LDFLAGS) + SET(ODE_CFLAGS CACHE STRING "Additional ODE linker flags") + ENDIF (ODE_EXTRA_LDFLAGS) + IF(ODE_INCLUDE_DIR) MESSAGE(STATUS "Found ODE include dir: ${ODE_INCLUDE_DIR}") ELSE(ODE_INCLUDE_DIR) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-04-27 19:37:13
|
Revision: 274 http://simspark.svn.sourceforge.net/simspark/?rev=274&view=rev Author: hedayat Date: 2011-04-27 19:37:07 +0000 (Wed, 27 Apr 2011) Log Message: ----------- Try to find ODE library suggested by ode-config script first. Modified Paths: -------------- trunk/rcssserver3d/cmake/FindODE.cmake trunk/spark/cmake/FindODE.cmake Modified: trunk/rcssserver3d/cmake/FindODE.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindODE.cmake 2011-04-27 07:51:06 UTC (rev 273) +++ trunk/rcssserver3d/cmake/FindODE.cmake 2011-04-27 19:37:07 UTC (rev 274) @@ -60,7 +60,20 @@ ENDFOREACH(flag) SET(ODE_EXTRA_LDFLAGS ${ODE_CONFIG_LIBS}) - ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") + + # Convert the linker flags to a CMake list. + STRING(REGEX REPLACE " +" ";" + ODE_CONFIG_LIBS "${ODE_CONFIG_LIBS}") + + # Look for -l options. + FOREACH(flag ${ODE_CONFIG_LIBS}) + IF("${flag}" MATCHES "^-l.*ode.*") + STRING(REGEX REPLACE "^-l" "" + ODE_LIB_NAME "${flag}") + ENDIF("${flag}" MATCHES "^-l.*ode.*") + ENDFOREACH(flag) + + ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") MESSAGE("Error running ${ODE_CONFIG}: [${ODE_CONFIG_RESULT}]") ENDIF("${ODE_CONFIG_RESULT}" MATCHES "^0$") @@ -79,7 +92,7 @@ NO_DEFAULT_PATH ) FIND_LIBRARY(ODE_LIBRARY - NAMES ode ode_double ode_single + NAMES ${ODE_LIB_NAME} ode ode_double ode_single PATHS ${ODE_CONFIG_PREFIX}/lib /usr/lib Modified: trunk/spark/cmake/FindODE.cmake =================================================================== --- trunk/spark/cmake/FindODE.cmake 2011-04-27 07:51:06 UTC (rev 273) +++ trunk/spark/cmake/FindODE.cmake 2011-04-27 19:37:07 UTC (rev 274) @@ -60,7 +60,20 @@ ENDFOREACH(flag) SET(ODE_EXTRA_LDFLAGS ${ODE_CONFIG_LIBS}) - ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") + + # Convert the linker flags to a CMake list. + STRING(REGEX REPLACE " +" ";" + ODE_CONFIG_LIBS "${ODE_CONFIG_LIBS}") + + # Look for -l options. + FOREACH(flag ${ODE_CONFIG_LIBS}) + IF("${flag}" MATCHES "^-l.*ode.*") + STRING(REGEX REPLACE "^-l" "" + ODE_LIB_NAME "${flag}") + ENDIF("${flag}" MATCHES "^-l.*ode.*") + ENDFOREACH(flag) + + ELSE("${ODE_CONFIG_RESULT}" MATCHES "^0$") MESSAGE("Error running ${ODE_CONFIG}: [${ODE_CONFIG_RESULT}]") ENDIF("${ODE_CONFIG_RESULT}" MATCHES "^0$") @@ -79,7 +92,7 @@ NO_DEFAULT_PATH ) FIND_LIBRARY(ODE_LIBRARY - NAMES ode ode_double ode_single + NAMES ${ODE_LIB_NAME} ode ode_double ode_single PATHS ${ODE_CONFIG_PREFIX}/lib /usr/lib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-04-30 21:27:52
|
Revision: 279 http://simspark.svn.sourceforge.net/simspark/?rev=279&view=rev Author: hedayat Date: 2011-04-30 21:27:46 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Removed additional .cmake files (FindFreetype and FindZLIB) Added AdditionalSearchPaths.cmake to add search paths so that CMake's own FindMODULE's work with our setup Some cleanup Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/windows/install_extra.nsi trunk/spark/CMakeLists.txt trunk/spark/ChangeLog Added Paths: ----------- trunk/rcssserver3d/cmake/AdditionalSearchPaths.cmake trunk/spark/cmake/AdditionalSearchPaths.cmake Removed Paths: ------------- trunk/rcssserver3d/cmake/FindFreetype.cmake trunk/spark/cmake/FindFreetype.cmake trunk/spark/cmake/FindZLIB.cmake Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/rcssserver3d/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) @@ -10,7 +10,6 @@ check_include_file("arpa/inet.h" HAVE_ARPA_INET_H) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) -set(ENV{SDLDIR} $ENV{SDLDIR} C:/library/SDL/ "C:/Program Files/SDL/" "C:/Program Files (x86)/SDL/" C:/SDL/) if (WIN32) set(Boost_USE_STATIC_LIBS ON) @@ -18,6 +17,8 @@ set(Boost_USE_STATIC_RUNTIME OFF) endif (WIN32) +include(AdditionalSearchPaths) + find_package(Spark REQUIRED) find_package(Freetype REQUIRED) find_package(Boost REQUIRED) Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/rcssserver3d/ChangeLog 2011-04-30 21:27:46 UTC (rev 279) @@ -1,3 +1,16 @@ +2011-05-01 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - include AdditionalSearchPaths.cmake + + * cmake/AdditionalSearchPaths.cmake: + - sets up additional search paths under Windows to find dependencies in + common directories and the ones documented on the wiki + + * cmake/FindFreetype.cmake: + - removed; and additional search paths have been added to + AdditionalSearchPaths.cmake file + 2011-04-29 Hedayat Vatankhah <hed...@gm...> * CMakeLists.txt: Added: trunk/rcssserver3d/cmake/AdditionalSearchPaths.cmake =================================================================== --- trunk/rcssserver3d/cmake/AdditionalSearchPaths.cmake (rev 0) +++ trunk/rcssserver3d/cmake/AdditionalSearchPaths.cmake 2011-04-30 21:27:46 UTC (rev 279) @@ -0,0 +1,29 @@ +if (WIN32) + set(ENV{SDLDIR} $ENV{SDLDIR} C:/library/SDL/ + "C:/Program Files/SDL/" + "C:/Program Files (x86)/SDL/" + C:/SDL/ + ) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} + C:/Library/ + C:/Library/ruby/bin + ) + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} + C:/Library/include + C:/Library/boost + C:/library/devil/include + "C:/Program Files/GnuWin32/include" + "C:/Program Files (x86)/GnuWin32/include" + C:/library/GnuWin32/include + C:/GnuWin32/include + ) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} + C:/Library/lib + C:/Library/boost + C:/library/devil + "C:/Program Files/GnuWin32" + "C:/Program Files (x86)/GnuWin32" + C:/library/GnuWin32/ + C:/GnuWin32/ + ) +endif (WIN32) Deleted: trunk/rcssserver3d/cmake/FindFreetype.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindFreetype.cmake 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/rcssserver3d/cmake/FindFreetype.cmake 2011-04-30 21:27:46 UTC (rev 279) @@ -1,94 +0,0 @@ -# - Locate FreeType library -# This module defines -# FREETYPE_LIBRARIES, the library to link against -# FREETYPE_FOUND, if false, do not try to link to FREETYPE -# FREETYPE_INCLUDE_DIRS, where to find headers. -# This is the concatenation of the paths: -# FREETYPE_INCLUDE_DIR_ft2build -# FREETYPE_INCLUDE_DIR_freetype2 -# -# $FREETYPE_DIR is an environment variable that would -# correspond to the ./configure --prefix=$FREETYPE_DIR -# used in building FREETYPE. - -# Created by Eric Wing. -# Modifications by Alexander Neundorf. -# This file has been renamed to "FindFreetype.cmake" instead of the correct -# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex. - -# Ugh, FreeType seems to use some #include trickery which -# makes this harder than it should be. It looks like they -# put ft2build.h in a common/easier-to-find location which -# then contains a #include to a more specific header in a -# more specific location (#include <freetype/config/ftheader.h>). -# Then from there, they need to set a bunch of #define's -# so you can do something like: -# #include FT_FREETYPE_H -# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES() -# wants explicit full paths and this trickery doesn't work too well. -# I'm going to attempt to cut out the middleman and hope -# everything still works. -FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h - HINTS - $ENV{FREETYPE_DIR} - PATH_SUFFIXES include - PATHS - /usr/local/X11R6/include - /usr/local/X11/include - /usr/X11/include - /sw/include - /opt/local/include - /usr/freeware/include - C:/library/GnuWin32/include - "C:/Program Files/GnuWin32/include" - "C:/Program Files (x86)/GnuWin32/include" - C:/GnuWin32/include -) - -FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h - HINTS - $ENV{FREETYPE_DIR}/include/freetype2 - PATHS - /usr/local/X11R6/include - /usr/local/X11/include - /usr/X11/include - /sw/include - /opt/local/include - /usr/freeware/include - C:/library/GnuWin32/include/freetype2 - "C:/Program Files/GnuWin32/include/freetype2" - "C:/Program Files (x86)/GnuWin32/include/freetype2" - C:/GnuWin32/include/freetype2 - PATH_SUFFIXES freetype2 -) - -FIND_LIBRARY(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 - HINTS - $ENV{FREETYPE_DIR} - PATH_SUFFIXES lib64 lib - PATHS - /usr/local/X11R6 - /usr/local/X11 - /usr/X11 - /sw - /usr/freeware - C:/library/GnuWin32/lib - "C:/Program Files/GnuWin32/lib" - "C:/Program Files (x86)/GnuWin32/lib" - C:/GnuWin32/lib -) - -# set the user variables -IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) - SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") -ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) -SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") - -# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) - - -MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) \ No newline at end of file Modified: trunk/rcssserver3d/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) @@ -36,4 +36,4 @@ ${CMAKE_CURRENT_BINARY_DIR}/simspark DESTINATION ${BINDIR} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE) -endif (NOT WIN32) \ No newline at end of file +endif (NOT WIN32) Modified: trunk/rcssserver3d/windows/install_extra.nsi =================================================================== --- trunk/rcssserver3d/windows/install_extra.nsi 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/rcssserver3d/windows/install_extra.nsi 2011-04-30 21:27:46 UTC (rev 279) @@ -8,6 +8,7 @@ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSMonitor3D.lnk" "$INSTDIR\bin\rcssmonitor3d.cmd" ${endif} + WriteRegExpandStr HKLM 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' 'RCSSSERVER3D_DIR' '$INSTDIR' ClearErrors FileOpen $0 $INSTDIR\bin\rcssserver3d.cmd w Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/spark/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) @@ -36,7 +36,6 @@ endif (NOT USE_COREFOUNDATION STREQUAL "OFF") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) -set(ENV{SDLDIR} $ENV{SDLDIR} C:/library/SDL/ "C:/Program Files/SDL/" "C:/Program Files (x86)/SDL/" C:/SDL/) if (WIN32) set(Boost_USE_STATIC_LIBS ON) @@ -44,6 +43,8 @@ set(Boost_USE_STATIC_RUNTIME OFF) endif (WIN32) +include(AdditionalSearchPaths) + find_package(Ruby REQUIRED) find_package(Freetype REQUIRED) find_package(DevIL REQUIRED) Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/spark/ChangeLog 2011-04-30 21:27:46 UTC (rev 279) @@ -1,3 +1,17 @@ +2011-05-01 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - include AdditionalSearchPaths.cmake + + * cmake/AdditionalSearchPaths.cmake: + - sets up additional search paths under Windows to find dependencies in + common directories and the ones documented on the wiki + + * cmake/FindZLIB.cmake: + * cmake/FindFreetype.cmake: + - removed; and additional search paths have been added to + AdditionalSearchPaths.cmake file + 2011-04-29 Hedayat Vatankhah <hed...@gm...> * lib/zeitgeist/scriptserver/gcvalue.cpp: Added: trunk/spark/cmake/AdditionalSearchPaths.cmake =================================================================== --- trunk/spark/cmake/AdditionalSearchPaths.cmake (rev 0) +++ trunk/spark/cmake/AdditionalSearchPaths.cmake 2011-04-30 21:27:46 UTC (rev 279) @@ -0,0 +1,35 @@ +if (WIN32) + set(ENV{SDLDIR} $ENV{SDLDIR} C:/library/SDL/ + "C:/Program Files/SDL/" + "C:/Program Files (x86)/SDL/" + C:/SDL/ + ) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} + C:/Library/ + C:/Library/ruby/bin + ) + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} + C:/Library/include + C:/Library/boost + C:/library/devil/include + "C:/Program Files/GnuWin32/include" + "C:/Program Files (x86)/GnuWin32/include" + C:/library/GnuWin32/include + C:/GnuWin32/include + C:/library/zlib123/include + "C:/Program Files/zlib123/include" + "C:/Program Files (x86)/zlib123/include" + ) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} + C:/Library/lib + C:/Library/boost + C:/library/devil + "C:/Program Files/GnuWin32" + "C:/Program Files (x86)/GnuWin32" + C:/library/GnuWin32/ + C:/GnuWin32/ + C:/library/zlib123/ + "C:/Program Files/zlib123/" + "C:/Program Files (x86)/zlib123/" + ) +endif (WIN32) Deleted: trunk/spark/cmake/FindFreetype.cmake =================================================================== --- trunk/spark/cmake/FindFreetype.cmake 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/spark/cmake/FindFreetype.cmake 2011-04-30 21:27:46 UTC (rev 279) @@ -1,94 +0,0 @@ -# - Locate FreeType library -# This module defines -# FREETYPE_LIBRARIES, the library to link against -# FREETYPE_FOUND, if false, do not try to link to FREETYPE -# FREETYPE_INCLUDE_DIRS, where to find headers. -# This is the concatenation of the paths: -# FREETYPE_INCLUDE_DIR_ft2build -# FREETYPE_INCLUDE_DIR_freetype2 -# -# $FREETYPE_DIR is an environment variable that would -# correspond to the ./configure --prefix=$FREETYPE_DIR -# used in building FREETYPE. - -# Created by Eric Wing. -# Modifications by Alexander Neundorf. -# This file has been renamed to "FindFreetype.cmake" instead of the correct -# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex. - -# Ugh, FreeType seems to use some #include trickery which -# makes this harder than it should be. It looks like they -# put ft2build.h in a common/easier-to-find location which -# then contains a #include to a more specific header in a -# more specific location (#include <freetype/config/ftheader.h>). -# Then from there, they need to set a bunch of #define's -# so you can do something like: -# #include FT_FREETYPE_H -# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES() -# wants explicit full paths and this trickery doesn't work too well. -# I'm going to attempt to cut out the middleman and hope -# everything still works. -FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h - HINTS - $ENV{FREETYPE_DIR} - PATH_SUFFIXES include - PATHS - /usr/local/X11R6/include - /usr/local/X11/include - /usr/X11/include - /sw/include - /opt/local/include - /usr/freeware/include - C:/library/GnuWin32/include - "C:/Program Files/GnuWin32/include" - "C:/Program Files (x86)/GnuWin32/include" - C:/GnuWin32/include -) - -FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h - HINTS - $ENV{FREETYPE_DIR}/include/freetype2 - PATHS - /usr/local/X11R6/include - /usr/local/X11/include - /usr/X11/include - /sw/include - /opt/local/include - /usr/freeware/include - C:/library/GnuWin32/include/freetype2 - "C:/Program Files/GnuWin32/include/freetype2" - "C:/Program Files (x86)/GnuWin32/include/freetype2" - C:/GnuWin32/include/freetype2 - PATH_SUFFIXES freetype2 -) - -FIND_LIBRARY(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 - HINTS - $ENV{FREETYPE_DIR} - PATH_SUFFIXES lib64 lib - PATHS - /usr/local/X11R6 - /usr/local/X11 - /usr/X11 - /sw - /usr/freeware - C:/library/GnuWin32/lib - "C:/Program Files/GnuWin32/lib" - "C:/Program Files (x86)/GnuWin32/lib" - C:/GnuWin32/lib -) - -# set the user variables -IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) - SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") -ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) -SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") - -# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) - - -MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) \ No newline at end of file Deleted: trunk/spark/cmake/FindZLIB.cmake =================================================================== --- trunk/spark/cmake/FindZLIB.cmake 2011-04-29 18:46:08 UTC (rev 278) +++ trunk/spark/cmake/FindZLIB.cmake 2011-04-30 21:27:46 UTC (rev 279) @@ -1,44 +0,0 @@ -# - Find zlib -# Find the native ZLIB includes and library -# -# ZLIB_INCLUDE_DIR - where to find zlib.h, etc. -# ZLIB_LIBRARIES - List of libraries when using zlib. -# ZLIB_FOUND - True if zlib found. - - -IF (ZLIB_INCLUDE_DIR) - # Already in cache, be silent - SET(ZLIB_FIND_QUIETLY TRUE) -ENDIF (ZLIB_INCLUDE_DIR) - -FIND_PATH(ZLIB_INCLUDE_DIR zlib.h - $ENV{ZLIB_DIR} - C:/library/ - C:/ - "C:/Program Files/" - "C:/Program Files (x86)/" - PATH_SUFFIXES zlib123 -) - -SET(ZLIB_NAMES z zlib zdll zlib1) -FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} - $ENV{ZLIB_DIR} - C:/library/zlib123/ - C:/zlib123/ - "C:/Program Files/zlib123/" - "C:/Program Files (x86)/zlib123/" - PATH_SUFFIXES projects/visualc6/Win32_DLL_Release -) - -# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR) - -IF(ZLIB_FOUND) - SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} ) -ELSE(ZLIB_FOUND) - SET( ZLIB_LIBRARIES ) -ENDIF(ZLIB_FOUND) - -MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-05-01 03:05:06
|
Revision: 280 http://simspark.svn.sourceforge.net/simspark/?rev=280&view=rev Author: hedayat Date: 2011-05-01 03:05:00 +0000 (Sun, 01 May 2011) Log Message: ----------- MinGW32 Compilation Fixes: simspark and rcssserver3d can now be built under Linux using mingw32 compiler :) Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/cmake/FindODE.cmake trunk/rcssserver3d/rcssagent3d/CMakeLists.txt trunk/spark/CMakeLists.txt trunk/spark/ChangeLog trunk/spark/cmake/FindODE.cmake trunk/spark/lib/kerosin/openglserver/openglserver.cpp trunk/spark/lib/salt/gmath.h trunk/spark/lib/salt/sharedlibrary.cpp trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp trunk/spark/utility/rcssnet/addr.cpp trunk/spark/utility/rcssnet/handler.hpp trunk/spark/utility/rcssnet/socket.cpp trunk/spark/utility/rcssnet/socket.hpp trunk/spark/utility/rcssnet/tcpsocket.cpp trunk/spark/utility/rcssnet/udpsocket.cpp Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/rcssserver3d/CMakeLists.txt 2011-05-01 03:05:00 UTC (rev 280) @@ -15,6 +15,11 @@ set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) + + # this must be added by cmake itself, but it is not + if ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -shared") + endif ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") endif (WIN32) include(AdditionalSearchPaths) Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/rcssserver3d/ChangeLog 2011-05-01 03:05:00 UTC (rev 280) @@ -1,7 +1,14 @@ 2011-05-01 Hedayat Vatankhah <hed...@gm...> + * cmake/FindODE.cmake: + - don't overwrite config options obtained from ode-config if available + + * rcssagent3d/CMakeLists.txt: + - use lowercase ws2_32 to be compatible with mingw32 + * CMakeLists.txt: - include AdditionalSearchPaths.cmake + - added -shared flag for mingw when linking modules * cmake/AdditionalSearchPaths.cmake: - sets up additional search paths under Windows to find dependencies in Modified: trunk/rcssserver3d/cmake/FindODE.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindODE.cmake 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/rcssserver3d/cmake/FindODE.cmake 2011-05-01 03:05:00 UTC (rev 280) @@ -110,13 +110,13 @@ NO_DEFAULT_PATH ) - IF (WIN32) + IF (WIN32 AND NOT ODE_CONFIG) IF("${ODE_LIBRARY}" MATCHES ".*double.*") SET(ODE_EXTRA_CFLAGS "-DdDOUBLE") ELSE("${ODE_LIBRARY}" MATCHES ".*double.*") SET(ODE_EXTRA_CFLAGS "-DdSINGLE") ENDIF("${ODE_LIBRARY}" MATCHES ".*double.*") - ENDIF (WIN32) + ENDIF (WIN32 AND NOT ODE_CONFIG) IF (ODE_EXTRA_CFLAGS) SET(ODE_CFLAGS ${ODE_EXTRA_CFLAGS} CACHE STRING "Additional ODE flags") Modified: trunk/rcssserver3d/rcssagent3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/rcssagent3d/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/rcssserver3d/rcssagent3d/CMakeLists.txt 2011-05-01 03:05:00 UTC (rev 280) @@ -16,7 +16,7 @@ add_executable(rcssagent3d ${rcssagent3d_SRCS}) if (WIN32) - set(NET_LIBS WS2_32.lib) + set(NET_LIBS ws2_32.lib) endif (WIN32) target_link_libraries(rcssagent3d ${SPARK_LIBRARIES} ${SALT_LIBRARIES} Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/CMakeLists.txt 2011-05-01 03:05:00 UTC (rev 280) @@ -9,7 +9,7 @@ check_include_file("resolv.h" HAVE_RESOLV_H) check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) check_include_file("netinet/in.h" HAVE_NETINET_IN_H) -check_include_file("Winsock2.h" HAVE_WINSOCK2_H) +check_include_file("winsock2.h" HAVE_WINSOCK2_H) check_include_file("arpa/nameser.h" HAVE_ARPA_NAMESER_H) check_include_file("arpa/inet.h" HAVE_ARPA_INET_H) check_include_file("string.h" HAVE_STRING_H) @@ -41,6 +41,11 @@ set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) + + # this must be added by cmake itself, but it is not + if ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -shared") + endif ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") endif (WIN32) include(AdditionalSearchPaths) @@ -93,7 +98,7 @@ endif (NOT FUNC_HSTRERROR_EXISTS) if (WIN32) - set(NET_LIBS ${NET_LIBS} WS2_32.lib) + set(NET_LIBS ${NET_LIBS} ws2_32.lib) endif (WIN32) ########## add extra flags ########## @@ -213,7 +218,7 @@ install(PROGRAMS ${DevIL_DLL} DESTINATION ${THLIBDIR}) endif (EXISTS ${DevIL_DLL}) - string(REGEX REPLACE "(.*)/ruby.exe" "\\1/" RUBY_BINDIR "${RUBY_EXECUTABLE}") + string(REGEX REPLACE "(.*)/ruby(.exe)?" "\\1/" RUBY_BINDIR "${RUBY_EXECUTABLE}") install(DIRECTORY "${RUBY_BINDIR}" DESTINATION ${THLIBDIR} FILES_MATCHING PATTERN "*.dll") Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/ChangeLog 2011-05-01 03:05:00 UTC (rev 280) @@ -1,7 +1,27 @@ 2011-05-01 Hedayat Vatankhah <hed...@gm...> + * cmake/FindODE.cmake: + - don't overwrite ode-config settings under windows platform (if available) + + * lib/kerosin/openglserver/openglserver.cpp (OpenGLServer::GetExtension): + * lib/salt/gmath.h: + * lib/salt/sharedlibrary.cpp: + * lib/zeitgeist/scriptserver/scriptserver.cpp: + - compilation fix under mingw32 + + * utility/rcssnet/socket.hpp: + * utility/rcssnet/tcpsocket.cpp: + * utility/rcssnet/udpsocket.cpp: + * utility/rcssnet/socket.cpp: + * utility/rcssnet/handler.hpp: + * utility/rcssnet/addr.cpp: + - convert Winsock2.h to lowercase + * CMakeLists.txt: - include AdditionalSearchPaths.cmake + - use lower case name for Windows winsock header and library (for use with + mingw32 under Linux) + - added a missing flag for linking modules with mingw32 * cmake/AdditionalSearchPaths.cmake: - sets up additional search paths under Windows to find dependencies in Modified: trunk/spark/cmake/FindODE.cmake =================================================================== --- trunk/spark/cmake/FindODE.cmake 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/cmake/FindODE.cmake 2011-05-01 03:05:00 UTC (rev 280) @@ -110,13 +110,13 @@ NO_DEFAULT_PATH ) - IF (WIN32) + IF (WIN32 AND NOT ODE_CONFIG) IF("${ODE_LIBRARY}" MATCHES ".*double.*") SET(ODE_EXTRA_CFLAGS "-DdDOUBLE") ELSE("${ODE_LIBRARY}" MATCHES ".*double.*") SET(ODE_EXTRA_CFLAGS "-DdSINGLE") ENDIF("${ODE_LIBRARY}" MATCHES ".*double.*") - ENDIF (WIN32) + ENDIF (WIN32 AND NOT ODE_CONFIG) IF (ODE_EXTRA_CFLAGS) SET(ODE_CFLAGS ${ODE_EXTRA_CFLAGS} CACHE STRING "Additional ODE flags") Modified: trunk/spark/lib/kerosin/openglserver/openglserver.cpp =================================================================== --- trunk/spark/lib/kerosin/openglserver/openglserver.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/lib/kerosin/openglserver/openglserver.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -183,7 +183,7 @@ void* OpenGLServer::GetExtension(const char* name) { #ifdef WIN32 - return wglGetProcAddress(name); + return reinterpret_cast<void*>(wglGetProcAddress(name)); #elif defined(__APPLE__) return NSGLGetProcAddress(name); #else Modified: trunk/spark/lib/salt/gmath.h =================================================================== --- trunk/spark/lib/salt/gmath.h 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/lib/salt/gmath.h 2011-05-01 03:05:00 UTC (rev 280) @@ -221,7 +221,7 @@ template <class TYPE> f_inline bool gIsFinite(TYPE f) { -#ifdef WIN32 +#ifdef _MSC_VER // isfinite is part of C99 but not available in Visual C++ assert(std::numeric_limits<TYPE>::has_infinity); return (std::numeric_limits<double>::infinity() != f); @@ -232,7 +232,7 @@ f_inline int gRound(float f) { -#ifdef WIN32 +#ifdef _MSC_VER // Uses the FloatToInt functionality int a; int *int_pointer = &a; Modified: trunk/spark/lib/salt/sharedlibrary.cpp =================================================================== --- trunk/spark/lib/salt/sharedlibrary.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/lib/salt/sharedlibrary.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -52,7 +52,7 @@ { if (mLibHandle) { - return ::GetProcAddress((HMODULE)mLibHandle, procName.c_str()); + return reinterpret_cast<void*>(::GetProcAddress((HMODULE)mLibHandle, procName.c_str())); } return NULL; } Modified: trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp =================================================================== --- trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -23,13 +23,15 @@ #include <boost/scoped_array.hpp> #include <sstream> #include <salt/fileclasses.h> -#include "rubywrapper.h" -#include "scriptserver.h" +#include <zeitgeist/core.h> #include <zeitgeist/corecontext.h> -#include <zeitgeist/core.h> #include <zeitgeist/logserver/logserver.h> #include <zeitgeist/fileserver/fileserver.h> #include <sys/stat.h> +// rubywrapper.h should be before scriptserver.h (gcvalue.h). also, they were +// moved down to prevent a compilation error with mingw32 +#include "rubywrapper.h" +#include "scriptserver.h" #ifdef HAVE_CONFIG_H #include <sparkconfig.h> Modified: trunk/spark/utility/rcssnet/addr.cpp =================================================================== --- trunk/spark/utility/rcssnet/addr.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/addr.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -41,7 +41,7 @@ #endif #ifdef HAVE_WINSOCK2_H -#include "Winsock2.h" +#include "winsock2.h" #endif #include "handler.hpp" Modified: trunk/spark/utility/rcssnet/handler.hpp =================================================================== --- trunk/spark/utility/rcssnet/handler.hpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/handler.hpp 2011-05-01 03:05:00 UTC (rev 280) @@ -22,7 +22,7 @@ #define RCSS_NET_HANDLER_HPP #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(CYGWIN) -#include "Winsock2.h" +#include "winsock2.h" #endif #include "rcssnet3D_defines.h" Modified: trunk/spark/utility/rcssnet/socket.cpp =================================================================== --- trunk/spark/utility/rcssnet/socket.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/socket.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -47,7 +47,7 @@ #endif #ifdef HAVE_WINSOCK2_H -#include "Winsock2.h" +#include "winsock2.h" #endif #include "handler.hpp" Modified: trunk/spark/utility/rcssnet/socket.hpp =================================================================== --- trunk/spark/utility/rcssnet/socket.hpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/socket.hpp 2011-05-01 03:05:00 UTC (rev 280) @@ -31,7 +31,7 @@ #include "addr.hpp" #ifdef HAVE_WINSOCK2_H -#include "Winsock2.h" +#include "winsock2.h" #endif namespace rcss Modified: trunk/spark/utility/rcssnet/tcpsocket.cpp =================================================================== --- trunk/spark/utility/rcssnet/tcpsocket.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/tcpsocket.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -34,7 +34,7 @@ #endif #ifdef HAVE_WINSOCK2_H -#include "Winsock2.h" +#include "winsock2.h" #endif #include <iostream> Modified: trunk/spark/utility/rcssnet/udpsocket.cpp =================================================================== --- trunk/spark/utility/rcssnet/udpsocket.cpp 2011-04-30 21:27:46 UTC (rev 279) +++ trunk/spark/utility/rcssnet/udpsocket.cpp 2011-05-01 03:05:00 UTC (rev 280) @@ -34,7 +34,7 @@ #endif #ifdef HAVE_WINSOCK2_H -#include "Winsock2.h" +#include "winsock2.h" #endif #include <iostream> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-05-01 11:27:33
|
Revision: 281 http://simspark.svn.sourceforge.net/simspark/?rev=281&view=rev Author: hedayat Date: 2011-05-01 11:27:27 +0000 (Sun, 01 May 2011) Log Message: ----------- - A few more fixes for Windows installation - add double quotes for cp/copy command Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/windows/install_extra.nsi trunk/rcssserver3d/windows/uninstall_extra.nsi trunk/spark/ChangeLog trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-05-01 03:05:00 UTC (rev 280) +++ trunk/rcssserver3d/ChangeLog 2011-05-01 11:27:27 UTC (rev 281) @@ -1,5 +1,10 @@ 2011-05-01 Hedayat Vatankhah <hed...@gm...> + * windows/uninstall_extra.nsi: + * windows/install_extra.nsi: + - install an rcsoccersim3d script under Windows + - fixed path commands to not include = sign + * cmake/FindODE.cmake: - don't overwrite config options obtained from ode-config if available Modified: trunk/rcssserver3d/windows/install_extra.nsi =================================================================== --- trunk/rcssserver3d/windows/install_extra.nsi 2011-05-01 03:05:00 UTC (rev 280) +++ trunk/rcssserver3d/windows/install_extra.nsi 2011-05-01 11:27:27 UTC (rev 281) @@ -6,25 +6,32 @@ ${if} $MyTemp != ">" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSServer3D.lnk" "$INSTDIR\bin\rcssserver3d.cmd" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSMonitor3D.lnk" "$INSTDIR\bin\rcssmonitor3d.cmd" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSoccerSim3D.lnk" "$INSTDIR\bin\rcsoccersim3d.cmd" ${endif} WriteRegExpandStr HKLM 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' 'RCSSSERVER3D_DIR' '$INSTDIR' ClearErrors FileOpen $0 $INSTDIR\bin\rcssserver3d.cmd w -FileWrite $0 'PATH=%PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' +FileWrite $0 'PATH %PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' FileWrite $0 'cd "%RCSSSERVER3D_DIR%\bin\"$\n' -FileWrite $0 'rcssserver3d.exe %1 %2 %3 %4' +FileWrite $0 'rcssserver3d.exe %1 %2 %3 %4$\n' FileClose $0 ClearErrors FileOpen $0 $INSTDIR\bin\rcssmonitor3d.cmd w -FileWrite $0 'PATH=%PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' +FileWrite $0 'PATH %PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' FileWrite $0 'cd "%RCSSSERVER3D_DIR%\bin\"$\n' -FileWrite $0 'rcssmonitor3d.exe %1 %2 %3 %4' +FileWrite $0 'rcssmonitor3d.exe %1 %2 %3 %4$\n' FileClose $0 ClearErrors FileOpen $0 $INSTDIR\bin\rcssagent3d.cmd w -FileWrite $0 'PATH=%PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' +FileWrite $0 'PATH %PATH%;%SPARK_DIR%\lib\simspark;%SPARK_DIR%\lib\thirdparty;%RCSSSERVER3D_DIR%\lib\rcssserver3d$\n' FileWrite $0 'cd "%RCSSSERVER3D_DIR%\bin\"$\n' -FileWrite $0 'rcssagent3d.exe %1 %2 %3 %4' +FileWrite $0 'rcssagent3d.exe %1 %2 %3 %4$\n' FileClose $0 +ClearErrors +FileOpen $0 $INSTDIR\bin\rcsoccersim3d.cmd w +FileWrite $0 'start cmd /c "%RCSSSERVER3D_DIR%\bin\rcssserver3d.cmd"$\n' +FileWrite $0 'start /b /wait cmd /c "%RCSSSERVER3D_DIR%\bin\rcssmonitor3d.cmd"$\n' +FileClose $0 + Modified: trunk/rcssserver3d/windows/uninstall_extra.nsi =================================================================== --- trunk/rcssserver3d/windows/uninstall_extra.nsi 2011-05-01 03:05:00 UTC (rev 280) +++ trunk/rcssserver3d/windows/uninstall_extra.nsi 2011-05-01 11:27:27 UTC (rev 281) @@ -1,6 +1,7 @@ Delete '$INSTDIR\bin\rcssserver3d.cmd' Delete '$INSTDIR\bin\rcssmonitor3d.cmd' Delete '$INSTDIR\bin\rcssagent3d.cmd' +Delete '$INSTDIR\bin\rcsoccersim3d.cmd' DeleteRegValue HKLM 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' 'RCSSSERVER3D_DIR' Var /GLOBAL STARTMENU_DIR_FORLINKS @@ -8,3 +9,5 @@ Delete "$SMPROGRAMS\$STARTMENU_DIR_FORLINKS\RCSSServer3D.lnk" Delete "$SMPROGRAMS\$STARTMENU_DIR_FORLINKS\RCSSMonitor3D.lnk" +Delete "$SMPROGRAMS\$STARTMENU_DIR_FORLINKS\RCSoccerSim3D.lnk" + Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2011-05-01 03:05:00 UTC (rev 280) +++ trunk/spark/ChangeLog 2011-05-01 11:27:27 UTC (rev 281) @@ -8,6 +8,8 @@ * lib/salt/sharedlibrary.cpp: * lib/zeitgeist/scriptserver/scriptserver.cpp: - compilation fix under mingw32 + (ScriptServer::RunInitScriptInternal): + - enclose source and dest paths for copy command in double quotes * utility/rcssnet/socket.hpp: * utility/rcssnet/tcpsocket.cpp: Modified: trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp =================================================================== --- trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-05-01 03:05:00 UTC (rev 280) +++ trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2011-05-01 11:27:27 UTC (rev 281) @@ -511,9 +511,9 @@ stringstream s; #ifdef WIN32 - s << "copy " << sourcePath << " " << destPath; + s << "copy \"" << sourcePath << "\" \"" << destPath << '"'; #else - s << "cp " << sourcePath << " " << destPath; + s << "cp \"" << sourcePath << "\" \"" << destPath << '"'; #endif system(s.str().c_str()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-05-01 22:12:05
|
Revision: 282 http://simspark.svn.sourceforge.net/simspark/?rev=282&view=rev Author: hedayat Date: 2011-05-01 22:11:58 +0000 (Sun, 01 May 2011) Log Message: ----------- More fine tuning of the mingw32 installer Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/spark/CMakeLists.txt trunk/spark/ChangeLog trunk/spark/plugin/collisionperceptor/CMakeLists.txt trunk/spark/plugin/odeimps/CMakeLists.txt Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/rcssserver3d/CMakeLists.txt 2011-05-01 22:11:58 UTC (rev 282) @@ -117,6 +117,7 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}) +set(CPACK_STRIP_FILES TRUE) set(CPACK_PACKAGE_VENDOR "RoboCup Soccer Server 3D Maintenance Group") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RoboCup Soccer Simulation Server 3D") Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/rcssserver3d/ChangeLog 2011-05-01 22:11:58 UTC (rev 282) @@ -1,3 +1,8 @@ +2011-05-02 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - strip files when creating a binary package + 2011-05-01 Hedayat Vatankhah <hed...@gm...> * windows/uninstall_extra.nsi: Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/spark/CMakeLists.txt 2011-05-01 22:11:58 UTC (rev 282) @@ -43,9 +43,9 @@ set(Boost_USE_STATIC_RUNTIME OFF) # this must be added by cmake itself, but it is not - if ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") + if (${CMAKE_CXX_COMPILER} MATCHES "mingw") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -shared") - endif ("${CMAKE_CXX_COMPILER}" MATCHES "mingw") + endif (${CMAKE_CXX_COMPILER} MATCHES "mingw") endif (WIN32) include(AdditionalSearchPaths) @@ -203,32 +203,59 @@ ${INCLUDEDIR}/${CMAKE_PROJECT_NAME}) if (WIN32) # try to find and install third-party .dlls to lib/thirdparty directory - set(THLIBDIR ${LIBDIR}/thirdparty) + set(THLIBDIR ${LIBDIR}/thirdparty) - string(REGEX REPLACE "(.*)\\.lib" "\\1.dll" ODEDLL "${ODE_LIBRARY}") - if (EXISTS ${ODEDLL}) - install(PROGRAMS ${ODEDLL} DESTINATION ${THLIBDIR}) - endif (EXISTS ${ODEDLL}) + # MinGW dll installation on a single root system + if (${CMAKE_CXX_COMPILER} MATCHES "mingw") + set(MINGW_BIN_DIR "${Boost_LIBRARY_DIRS}/../bin/") + install(DIRECTORY ${MINGW_BIN_DIR} DESTINATION ${THLIBDIR} + FILES_MATCHING + PATTERN "libstdc++*.dll" + PATTERN "libgcc_s_sjlj*.dll" + PATTERN "libode*.dll" + PATTERN "tbb*.dll" + PATTERN "*boost*regex*mt*.dll" + PATTERN "*boost*date_time*mt*.dll" + PATTERN "*boost*thread*mt*.dll" + PATTERN "libIL*.dll" + PATTERN "libjpeg*.dll" + PATTERN "libpng*.dll" + PATTERN "*freetype*.dll" + PATTERN "*SDL*.dll") + endif (${CMAKE_CXX_COMPILER} MATCHES "mingw") + + string(REGEX REPLACE "(.*)\\.lib" "\\1.dll" ODEDLL "${ODE_LIBRARY}") + if (EXISTS ${ODEDLL} AND ${ODEDLL} MATCHES ".dll$") + install(PROGRAMS ${ODEDLL} DESTINATION ${THLIBDIR}) + endif (EXISTS ${ODEDLL} AND ${ODEDLL} MATCHES ".dll$") + + install(DIRECTORY "${Boost_LIBRARY_DIRS}/" DESTINATION ${THLIBDIR} + FILES_MATCHING PATTERN "*boost*regex*mt*.dll" + PATTERN "*boost*date_time*mt*.dll" + PATTERN "*boost*thread*mt*.dll") + + string(REGEX REPLACE "(.*)\\.lib" "\\1.dll" DevIL_DLL "${IL_LIBRARIES}") + if (EXISTS ${DevIL_DLL} AND ${DevIL_DLL} MATCHES ".dll$") + install(PROGRAMS ${DevIL_DLL} DESTINATION ${THLIBDIR}) + endif (EXISTS ${DevIL_DLL} AND ${DevIL_DLL} MATCHES ".dll$") + + string(REGEX REPLACE "(.*)/ruby(.exe)?" "\\1/" RUBY_BINDIR "${RUBY_EXECUTABLE}") + install(DIRECTORY "${RUBY_BINDIR}" + DESTINATION ${THLIBDIR} FILES_MATCHING PATTERN "*.dll") + + install(DIRECTORY "${FREETYPE_INCLUDE_DIR_ft2build}/../bin/" + DESTINATION ${THLIBDIR} FILES_MATCHING + PATTERN "*freetype*.dll" PATTERN "*zlib*.dll") - install(DIRECTORY "${Boost_LIBRARY_DIRS}/" DESTINATION ${THLIBDIR} - FILES_MATCHING PATTERN "*.dll") + set(SDL_DLL "${SDL_INCLUDE_DIR}/../lib/sdl.dll") + if (EXISTS ${SDL_DLL}) + install(PROGRAMS ${SDL_DLL} DESTINATION ${THLIBDIR}) + endif (EXISTS ${SDL_DLL}) - string(REGEX REPLACE "(.*)\\.lib" "\\1.dll" DevIL_DLL "${IL_LIBRARIES}") - if (EXISTS ${DevIL_DLL}) - install(PROGRAMS ${DevIL_DLL} DESTINATION ${THLIBDIR}) - endif (EXISTS ${DevIL_DLL}) - - string(REGEX REPLACE "(.*)/ruby(.exe)?" "\\1/" RUBY_BINDIR "${RUBY_EXECUTABLE}") - install(DIRECTORY "${RUBY_BINDIR}" - DESTINATION ${THLIBDIR} FILES_MATCHING PATTERN "*.dll") - - install(DIRECTORY "${FREETYPE_INCLUDE_DIR_ft2build}/../bin/" - DESTINATION ${THLIBDIR} FILES_MATCHING PATTERN "*.dll") - - set(SDL_DLL "${SDL_INCLUDE_DIR}/../lib/sdl.dll") - if (EXISTS ${SDL_DLL}) - install(PROGRAMS ${SDL_DLL} DESTINATION ${THLIBDIR}) - endif (EXISTS ${SDL_DLL}) + if (CMAKE_STRIP) + set(STRIP_FILES_GLOB "'\${CMAKE_INSTALL_PREFIX}/${THLIBDIR}/'*.dll") + install(CODE "EXECUTE_PROCESS(COMMAND sh -c \"${CMAKE_STRIP} ${STRIP_FILES_GLOB}\")") + endif (CMAKE_STRIP) endif (WIN32) ########### uninstall support ############ @@ -248,7 +275,8 @@ set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION}) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}) - + +set(CPACK_STRIP_FILES TRUE) set(CPACK_PACKAGE_VENDOR "RoboCup Soccer Server 3D Maintenance Group") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A generic physical simulation system") Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/spark/ChangeLog 2011-05-01 22:11:58 UTC (rev 282) @@ -1,3 +1,13 @@ +2011-05-02 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - strip files when creating binary packages + - installer enhancements for mingw32 based setup + + * plugin/odeimps/CMakeLists.txt: + * plugin/collisionperceptor/CMakeLists.txt: + - added complete ode dependencies + 2011-05-01 Hedayat Vatankhah <hed...@gm...> * cmake/FindODE.cmake: Modified: trunk/spark/plugin/collisionperceptor/CMakeLists.txt =================================================================== --- trunk/spark/plugin/collisionperceptor/CMakeLists.txt 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/spark/plugin/collisionperceptor/CMakeLists.txt 2011-05-01 22:11:58 UTC (rev 282) @@ -22,7 +22,7 @@ add_library(collisionperceptor MODULE ${collisionperceptor_LIB_SRCS}) -target_link_libraries(collisionperceptor ${ODE_LIBRARY} ${spark_libs}) +target_link_libraries(collisionperceptor ${ODE_LIBRARY} ${ODE_LDFLAGS} ${spark_libs}) if (NOT APPLE) set_target_properties(collisionperceptor PROPERTIES VERSION 0.0.0 SOVERSION 0) Modified: trunk/spark/plugin/odeimps/CMakeLists.txt =================================================================== --- trunk/spark/plugin/odeimps/CMakeLists.txt 2011-05-01 11:27:27 UTC (rev 281) +++ trunk/spark/plugin/odeimps/CMakeLists.txt 2011-05-01 22:11:58 UTC (rev 282) @@ -106,7 +106,7 @@ add_library(odeimps MODULE ${odeimps_LIB_SRCS}) -target_link_libraries(odeimps ${ODE_LIBRARY} ${spark_libs}) +target_link_libraries(odeimps ${ODE_LIBRARY} ${ODE_LDFLAGS} ${spark_libs}) if (NOT APPLE) set_target_properties(odeimps PROPERTIES VERSION 0.0.0 SOVERSION 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-06-23 18:00:56
|
Revision: 285 http://simspark.svn.sourceforge.net/simspark/?rev=285&view=rev Author: sgvandijk Date: 2011-06-23 18:00:49 +0000 (Thu, 23 Jun 2011) Log Message: ----------- - Can requast full monitor frame from MonitorControl - Trainer command to request full monitor frame - Start of RCS3DMonitor (to be able to add RCS3D specific data to monitor data) - Option in vision perceptor to request ball ground truth Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg trunk/rcssserver3d/plugin/soccer/CMakeLists.txt trunk/rcssserver3d/plugin/soccer/export.cpp trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h trunk/rcssserver3d/rcssmonitor3d/main.cpp trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp trunk/spark/lib/oxygen/simulationserver/monitorcontrol.h Added Paths: ----------- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor_c.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2011-06-23 18:00:49 UTC (rev 285) @@ -89,6 +89,7 @@ (nd RestrictedVisionPerceptor (setViewCones 120 120) (setSenseMyPos false) + (setSenseBallPos false) (setStaticSenseAxis false) (addNoise true) (setInterval 3) Modified: trunk/rcssserver3d/plugin/soccer/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-06-23 18:00:49 UTC (rev 285) @@ -47,6 +47,7 @@ hmdp_effector/naospecific.h line/line.h agentcollisionhandler/agentcollisionhandler.h + rcs3dmonitor/rcs3dmonitor.h ) set(soccer_LIB_SRCS @@ -123,6 +124,8 @@ line/line_c.cpp agentcollisionhandler/agentcollisionhandler.cpp agentcollisionhandler/agentcollisionhandler_c.cpp + rcs3dmonitor/rcs3dmonitor.cpp + rcs3dmonitor/rcs3dmonitor_c.cpp ) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} Modified: trunk/rcssserver3d/plugin/soccer/export.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/export.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/export.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -55,6 +55,7 @@ #include "hmdp_effector/hmdpperceptor.h" #include "line/line.h" #include "agentcollisionhandler/agentcollisionhandler.h" +#include "rcs3dmonitor/rcs3dmonitor.h" ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(SoccerControlAspect); @@ -92,5 +93,6 @@ ZEITGEIST_EXPORT(HMDPEffector); ZEITGEIST_EXPORT(Line); ZEITGEIST_EXPORT(AgentCollisionHandler); + ZEITGEIST_EXPORT(RCS3DMonitor); ZEITGEIST_EXPORT_END() Added: trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -0,0 +1,459 @@ +/* -*- 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: RCS3DMonitor.cpp 246 2011-02-18 18:44:14Z sgvandijk $ + + 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 "rcs3dmonitor.h" +#include <zeitgeist/logserver/logserver.h> +#include <kerosin/sceneserver/singlematnode.h> +#include <kerosin/materialserver/material.h> +#include <oxygen/monitorserver/monitorcmdparser.h> +#include <oxygen/sceneserver/sceneserver.h> +#include <sstream> + +using namespace kerosin; +using namespace oxygen; +using namespace zeitgeist; +using namespace boost; +using namespace salt; +using namespace std; + +RCS3DMonitor::RCS3DMonitor() : oxygen::MonitorSystem() +{ + mFullState = true; +} + +RCS3DMonitor::~RCS3DMonitor() +{ +} + +void RCS3DMonitor::ClearNodeCache() +{ + mNodeCache.clear(); +} + +void RCS3DMonitor::UpdateCached() +{ + MonitorSystem::UpdateCached(); + ClearNodeCache(); +} + +void RCS3DMonitor::OnLink() +{ + // setup SceneServer reference + mSceneServer = shared_dynamic_cast<SceneServer> + (GetCore()->Get("/sys/server/scene")); + + if (mSceneServer.get() == 0) + { + GetLog()->Error() + << "(RCS3DMonitor) ERROR: SceneServer not found\n"; + } +} + +void RCS3DMonitor::OnUnlink() +{ + mSceneServer.reset(); + mActiveScene.reset(); + ClearNodeCache(); +} + +void RCS3DMonitor::ParseMonitorMessage(const std::string& data) +{ + // pass the received string on to all installed CommandParsers + TLeafList items; + ListChildrenSupportingClass<MonitorCmdParser>(items); + + for ( + TLeafList::iterator iter = items.begin(); + iter != items.end(); + ++iter + ) + { + shared_static_cast<MonitorCmdParser>(*iter) + ->ParseMonitorMessage(data); + } +} + +string RCS3DMonitor::GetMonitorInfo(const PredicateList& pList) +{ + stringstream ss; + mFullState = false; + DescribeCustomPredicates(ss,pList); + DescribeActiveScene(ss); + + return ss.str(); +} + +string RCS3DMonitor::GetMonitorHeaderInfo(const PredicateList& pList) +{ + stringstream ss; + mFullState = true; + ClearNodeCache(); + DescribeCustomPredicates(ss,pList); + DescribeActiveScene(ss); + + return ss.str(); +} + +void RCS3DMonitor::DescribeCustomPredicates(stringstream& ss,const PredicateList& pList) +{ + ss << "("; + + for ( + PredicateList::TList::const_iterator iter = pList.begin(); + iter != pList.end(); + ++iter + ) + { + const Predicate& pred = (*iter); + + ss << "("; + ss << pred.name; + + const ParameterList& paramList = pred.parameter; + ParameterList::TVector::const_iterator pIter = paramList.begin(); + + std::string param; + while ( + (pIter != paramList.end()) && + (paramList.AdvanceValue(pIter, param)) + ) + { + ss << " "; + ss << param; + } + + ss << ")"; + } + + ss << ")"; +} + +void RCS3DMonitor::DescribeBall(stringstream& ss, NodeCache& entry, boost::shared_ptr<Ball> ball) +{ + if (mFullState) + { + ss << "(nd Ball"; + } else + { + ss << "(nd"; + } + + DescribeTransform(ss, entry, boost::shared_static_cast<Transform>(ball), false); +} + +void RCS3DMonitor::DescribeBaseNode(stringstream& ss) +{ + if (mFullState) + { + ss << "(nd BN"; + } else + { + ss << "(nd"; + } +} + +void RCS3DMonitor::DescribeLight(stringstream& ss, boost::shared_ptr<Light> light) +{ + if (! mFullState) + { + return DescribeBaseNode(ss); + } + + ss << "(nd Light "; + + const RGBA& diff = light->GetDiffuse(); + ss << "(setDiffuse " << diff.r() << " " << diff.g() << " " + << diff.b() << " " << diff.a() << ") "; + + const RGBA& amb = light->GetAmbient(); + ss << "(setAmbient " << amb.r() << " " << amb.g() << " " + << amb.b() << " " << amb.a() << ") "; + + const RGBA& spec = light->GetSpecular(); + ss << "(setSpecular " << spec.r() << " " << spec.g() << " " + << spec.b() << " " << spec.a() << ")"; +} + +void RCS3DMonitor::DescribeTransform(stringstream& ss, NodeCache& entry, boost::shared_ptr<Transform> transform, bool prefix) +{ + if (prefix) + if (mFullState) + { + ss << "(nd TRF"; + } else + { + ss << "(nd"; + } + + // include transform data only for fullstate or a modified + // transform node + const float precision = 0.005f; + const Matrix& mat = transform->GetLocalTransform(); + + bool update = false; + + if (mFullState) + { + update = true; + } else + { + const salt::Matrix& old = entry.transform; + + for (int i=0;i<16;++i) + { + const float d = fabs(old.m[i] - mat.m[i]); + + if (d > precision) + { + update = true; + break; + } + } + } + + if (update) + { + ss << " (SLT"; + + for (int i=0;i<16;++i) + { + ss << " " << mat.m[i]; + } + + ss << ")"; + + // update cache + entry.transform = mat; + } +} + +void RCS3DMonitor::DescribeMesh(stringstream& ss, boost::shared_ptr<StaticMesh> mesh) +{ + boost::shared_ptr<SingleMatNode> singleMat = + shared_dynamic_cast<SingleMatNode>(mesh); + + if (singleMat.get() != 0) + { + ss << "(nd SMN"; + } else + { + ss << "(nd StaticMesh"; + } + + if (mFullState || mesh->VisibleToggled()) + if (mesh->IsVisible()) + ss << " (setVisible 1)"; + else + ss << " (setVisible 0)"; + + if (! mFullState) + return; + + if (mesh->IsTransparent()) + { + ss << " (setTransparent)"; + } + + ss << " (load " << mesh->GetMeshName(); + + const ParameterList& params = mesh->GetMeshParameter(); + for ( + ParameterList::TVector::const_iterator iter = params.begin(); + iter != params.end(); + ++iter + ) + { + string str; + params.GetValue(iter,str); + ss << " " << str; + } + + ss << ")"; + + const Vector3f& scale = mesh->GetScale(); + + ss << " (sSc " + << scale[0] << " " + << scale[1] << " " + << scale[2] << ")"; + + if (singleMat.get() != 0) + { + boost::shared_ptr<Material> mat = singleMat->GetMaterial(); + if (mat.get() != 0) + { + ss << " (sMat " << mat->GetName() << ")"; + } + } + else{ + std::vector<std::string> mats = mesh->GetMaterialNames(); + if ( !mats.empty() ){ + ss<<"(resetMaterials"; + for(std::vector<std::string>::const_iterator iter = mats.begin(); + mats.end() != iter; ++iter){ + ss<<' '<<*iter; + } + ss<<')'; + } + } +} + +RCS3DMonitor::NodeCache* RCS3DMonitor::LookupNode(boost::shared_ptr<BaseNode> node) +{ + if (node.get() == 0) + { + assert(false); + return 0; + } + + // Check whether we already have this node in cache + TNodeCacheMap::iterator iter = mNodeCache.find(node); + if (iter != mNodeCache.end()) + { + return &((*iter).second); + } + + // Ball + boost::shared_ptr<Ball> ball + = shared_dynamic_cast<Ball>(node); + if (ball.get() != 0) + { + mNodeCache[node] + = NodeCache(NT_BALL, ball->GetLocalTransform()); + + return &(mNodeCache[node]); + } + + // Transform + boost::shared_ptr<Transform> transform + = shared_dynamic_cast<Transform>(node); + if (transform.get() != 0) + { + mNodeCache[node] + = NodeCache(NT_TRANSFORM, transform->GetLocalTransform()); + + return &(mNodeCache[node]); + } + + boost::shared_ptr<StaticMesh> mesh + = shared_dynamic_cast<StaticMesh>(node); + if (mesh.get() != 0) + { + mNodeCache[node] = NodeCache(NT_STATICMESH); + return &(mNodeCache[node]); + } + + boost::shared_ptr<Light> light + = shared_dynamic_cast<Light>(node); + if (light.get() != 0) + { + mNodeCache[node] = NodeCache(NT_LIGHT); + return &(mNodeCache[node]); + } + + // treat every other node type as a BaseNode + mNodeCache[node] = NodeCache(NT_BASE); + + return &(mNodeCache[node]); +} + +bool RCS3DMonitor::DescribeNode(stringstream& ss, boost::shared_ptr<BaseNode> node) +{ + NodeCache* entry = LookupNode(node); + if (entry == 0) + { + // skip node + assert(false); + return false; + } + + switch (entry->type) + { + default: + assert(false); + // fall through + + case NT_BASE: + // skip node + return false; + + case NT_BALL: + DescribeBall + (ss, (*entry), shared_static_cast<Ball>(node)); + + case NT_TRANSFORM: + DescribeTransform + (ss, (*entry), shared_static_cast<Transform>(node)); + return true; + + case NT_STATICMESH: + DescribeMesh + (ss, shared_static_cast<StaticMesh>(node)); + return true; + + case NT_LIGHT: + DescribeLight + (ss, shared_static_cast<Light>(node)); + return true; + } +} + +void RCS3DMonitor::DescribeActiveScene(stringstream& ss) +{ + if (mSceneServer.get() == 0) + { + return; + } + + mActiveScene = mSceneServer->GetActiveScene(); + + if (mActiveScene.get() != 0) + { + if (mFullState) + { + ss << "(RSG 0 1)"; + } else + { + ss << "(RDS 0 1)"; + } + + ss << "("; + DescribeScene(ss,mActiveScene); + ss << ")"; + } +} + +void RCS3DMonitor::DescribeScene(stringstream& ss, boost::shared_ptr<BaseNode> node) +{ + bool closeParen = DescribeNode(ss, node); + + TLeafList baseNodes = node->GetBaseNodeChildren(); + for (TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) + { + boost::shared_ptr<BaseNode> baseNode = shared_dynamic_cast<BaseNode>(*i); + DescribeScene(ss,baseNode); + } + + if (closeParen) + { + ss << ")"; + } +} Added: trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h (rev 0) +++ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h 2011-06-23 18:00:49 UTC (rev 285) @@ -0,0 +1,150 @@ +/* -*- 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: sparkmonitor.h 3 2008-11-21 02:38:08Z hedayat $ + + 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 RCS3DMONITOR_H__ +#define RCS3DMONITOR_H__ + +#include <oxygen/monitorserver/monitorsystem.h> +#include <oxygen/sceneserver/sceneserver.h> +#include <oxygen/sceneserver/scene.h> +#include <oxygen/sceneserver/transform.h> +#include <kerosin/sceneserver/staticmesh.h> +#include <kerosin/sceneserver/light.h> +#include <oxygen/physicsserver/body.h> +#include "../ball/ball.h" + +class RCS3DMonitor : public oxygen::MonitorSystem +{ +public: + enum ENodeType + { + NT_BASE = 0, + NT_TRANSFORM, + NT_STATICMESH, + NT_LIGHT, + NT_BALL + }; + + struct NodeCache + { + public: + ENodeType type; + + /** the last local transform matrix sent to the client */ + salt::Matrix transform; + + public: + NodeCache(ENodeType nt = NT_BASE) + : type(nt) + { + } + + NodeCache(ENodeType nt, const salt::Matrix& t) + : type(nt), transform(t) + { + } + }; + + typedef std::map<boost::shared_ptr<oxygen::BaseNode>, NodeCache> TNodeCacheMap; + +public: + RCS3DMonitor(); + virtual ~RCS3DMonitor(); + + /** If a monitor sends information to the world model, this + * function is called to process it. + * @param data data sent from monitor to monitorsystem via SPADES. + */ + void ParseMonitorMessage(const std::string& data); + + /** This function will be called periodically to get information + * about the current state of the world. + * \param items holds a list of additional name value pairs. These + * predicates are collected from MonitorItem objects registered to + * the MonitorServer. The monitor should transfer them to the + * client if possible. + */ + virtual std::string GetMonitorInfo(const oxygen::PredicateList& pList); + + /** This function is called once for every MonitorSystem each time + * a new client connects. It should return any header/setup + * information that is needed. + * \param items holds a list of additional name value + * pairs. These predicates are collected from MonitorItem objects + * registered to the MonitorServer. The monitor should transfer + * them to the client if possible. + */ + virtual std::string GetMonitorHeaderInfo(const oxygen::PredicateList& pList); + + /** update variables from a script */ + virtual void UpdateCached(); + +protected: + virtual void OnLink(); + virtual void OnUnlink(); + + void ClearNodeCache(); + + /** This function looks the cached node entry in the node + cache. The entry is added to the cache if it does not exist + */ + NodeCache* LookupNode(boost::shared_ptr<oxygen::BaseNode> node); + + void DescribeCustomPredicates(std::stringstream& ss,const oxygen::PredicateList& pList); + void DescribeActiveScene(std::stringstream& ss); + void DescribeScene(std::stringstream& ss, + boost::shared_ptr<oxygen::BaseNode> node); + + /** This function writes the s-expression for the given node to + the given strinstream, omitting the closing parentheses. It + returns false if the node is skipped and no description is + created. Skipped nodes are invisible scene graph nodes. + */ + bool DescribeNode(std::stringstream& ss, + boost::shared_ptr<oxygen::BaseNode> node); + void DescribeBaseNode(std::stringstream& ss); + void DescribeBall(std::stringstream& ss, NodeCache& entry, + boost::shared_ptr<Ball> ball); + void DescribeTransform(std::stringstream& ss, NodeCache& entry, + boost::shared_ptr<oxygen::Transform> transform, bool prefix = true); + void DescribeMesh(std::stringstream& ss, + boost::shared_ptr<kerosin::StaticMesh> mesh); + void DescribeLight(std::stringstream& ss, + boost::shared_ptr<kerosin::Light> light); + +protected: + /** cached reference to the SceneServer */ + boost::shared_ptr<oxygen::SceneServer> mSceneServer; + + /** cached reference to the current active scene */ + boost::shared_ptr<oxygen::Scene> mActiveScene; + + /** true, if the full state is generated */ + bool mFullState; + + /** cached node type and state */ + TNodeCacheMap mNodeCache; +}; + +DECLARE_CLASS(RCS3DMonitor); + +#endif // RCS3DMONITOR_H__ + Added: trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor_c.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor_c.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor_c.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -0,0 +1,29 @@ +/* -*- 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: sparkmonitor_c.cpp 3 2008-11-21 02:38:08Z hedayat $ + + 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 "rcs3dmonitor.h" + +void +CLASS(RCS3DMonitor)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseParser); +} + Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -38,6 +38,7 @@ RestrictedVisionPerceptor::RestrictedVisionPerceptor() : Perceptor(), mSenseMyPos(false), + mSenseBallPos(false), mAddNoise(true), mStaticSenseAxis(true), mSenseLine(false) @@ -460,6 +461,21 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseBallPos) + { + TTeamIndex ti = mAgentState->GetTeamIndex(); + boost::shared_ptr<Ball> ball; + SoccerBase::GetBall(*this, ball); + Vector3f sensedBallPos = SoccerBase::FlipView(ball->GetWorldTransform().Pos(), ti); + + ParameterList& element = predicate.parameter.AddList(); + element.AddValue(std::string("ballpos")); + element.AddValue(sensedBallPos[0]); + element.AddValue(sensedBallPos[1]); + element.AddValue(sensedBallPos[2]); + + } + if (mSenseLine) { SenseLine(predicate); @@ -562,6 +578,21 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseBallPos) + { + TTeamIndex ti = mAgentState->GetTeamIndex(); + boost::shared_ptr<Ball> ball; + SoccerBase::GetBall(*this, ball); + Vector3f sensedBallPos = SoccerBase::FlipView(ball->GetWorldTransform().Pos(), ti); + + ParameterList& element = predicate.parameter.AddList(); + element.AddValue(std::string("ballpos")); + element.AddValue(sensedBallPos[0]); + element.AddValue(sensedBallPos[1]); + element.AddValue(sensedBallPos[2]); + + } + if (mSenseLine) { SenseLine(predicate); @@ -633,6 +664,12 @@ mSenseMyPos = sense; } +void +RestrictedVisionPerceptor::SetSenseBallPos(bool sense) +{ + mSenseBallPos = sense; +} + bool RestrictedVisionPerceptor::CheckVisuable(RestrictedVisionPerceptor::ObjectData& od) const { // theta is the angle in horizontal plane, with fwAngle as 0 degree Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2011-06-23 18:00:49 UTC (rev 285) @@ -30,6 +30,7 @@ #include <oxygen/agentaspect/agentaspect.h> #include <agentstate/agentstate.h> #include "../line/line.h" +#include "../ball/ball.h" class RestrictedVisionPerceptor : public oxygen::Perceptor { @@ -104,6 +105,9 @@ //! Turn sensing of agent position on/off void SetSenseMyPos(bool sense); + //! Turn sensing of agent position on/off + void SetSenseBallPos(bool sense); + // turn sensing of lines on/off void SetSenseLine(bool sense); @@ -207,6 +211,9 @@ //! true, if the absolute position of the agent is sensed. bool mSenseMyPos; + + //! true, if the absolute position of the ball is sensed. + bool mSenseBallPos; //! sigma for random measurement error (distance) float mSigmaDist; Modified: trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -80,6 +80,22 @@ return true; } +FUNCTION(RestrictedVisionPerceptor,setSenseBallPos) +{ + bool inSenseBallPos; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inSenseBallPos)) + ) + { + return false; + } + + obj->SetSenseBallPos(inSenseBallPos); + return true; +} + FUNCTION(RestrictedVisionPerceptor,setStaticSenseAxis) { bool inStaticAxis; @@ -172,6 +188,7 @@ DEFINE_FUNCTION(setNoiseParams); DEFINE_FUNCTION(addNoise); DEFINE_FUNCTION(setSenseMyPos); + DEFINE_FUNCTION(setSenseBallPos); DEFINE_FUNCTION(setStaticSenseAxis); DEFINE_FUNCTION(setViewCones); DEFINE_FUNCTION(setPanRange); Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -51,6 +51,8 @@ mCommandMap["kill"] = CT_KILL; mCommandMap["repos"] = CT_REPOS; mCommandMap["killsim"] = CT_KILLSIM; + mCommandMap["reqfullstate"] = CT_REQFULLSTATE; + // setup team index map // Originally team sides were "L","R" and "N" // But this seems to be unused @@ -128,7 +130,13 @@ GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get SimulationServer\n"; } - + mMonitorControl = shared_dynamic_cast<MonitorControl> + (mSimServer->GetControlNode("MonitorControl")); + + if (mMonitorControl.get() == 0) + { + GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get MonitorControl\n"; + } } void TrainerCommandParser::OnUnlink() @@ -224,6 +232,10 @@ case CT_KILLSIM: ParseKillSimCommand(predicate); break; + case CT_REQFULLSTATE: + mMonitorControl->RequestFullState(); + break; + default: return false; } Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.h 2011-06-23 18:00:49 UTC (rev 285) @@ -33,6 +33,7 @@ #include <soccertypes.h> #include <soccerruleaspect/soccerruleaspect.h> #include <oxygen/simulationserver/simulationserver.h> +#include <oxygen/simulationserver/monitorcontrol.h> namespace oxygen { @@ -54,7 +55,8 @@ CT_SELECT, CT_KILL, CT_REPOS, - CT_KILLSIM + CT_KILLSIM, + CT_REQFULLSTATE }; typedef std::map<std::string, ECommandType> TCommandMap; @@ -148,6 +150,8 @@ boost::shared_ptr<oxygen::GameControlServer> mGameControl; //! cached reference to the simulation server boost::shared_ptr<oxygen::SimulationServer> mSimServer; + //! cahced reference to the monitor control node + boost::shared_ptr<oxygen::MonitorControl> mMonitorControl; bool mGetAck; std::string mAckString; Modified: trunk/rcssserver3d/rcssmonitor3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/main.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/rcssserver3d/rcssmonitor3d/main.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -121,6 +121,17 @@ GetScriptServer()->Eval(serverIPStr); } } + else if (strcmp(argv[i], "--server-port") == 0) + { + i++; + if (i < argc) + GetScriptServer()->Eval(string("$monitorPort = ") + argv[i]); + else + { + PrintHelp(); + return false; + } + } } return true; Modified: trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/spark/lib/oxygen/simulationserver/monitorcontrol.cpp 2011-06-23 18:00:49 UTC (rev 285) @@ -158,3 +158,8 @@ } } } + +void MonitorControl::RequestFullState() +{ + mFullStateLogged--; +} Modified: trunk/spark/lib/oxygen/simulationserver/monitorcontrol.h =================================================================== --- trunk/spark/lib/oxygen/simulationserver/monitorcontrol.h 2011-06-06 10:23:16 UTC (rev 284) +++ trunk/spark/lib/oxygen/simulationserver/monitorcontrol.h 2011-06-23 18:00:49 UTC (rev 285) @@ -54,6 +54,9 @@ /** sets the monitor update interval in cycles */ void SetMonitorInterval(int i); + /** Request that next update gives the full state */ + void RequestFullState(); + protected: virtual void OnLink(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yx...@us...> - 2012-02-24 13:24:58
|
Revision: 294 http://simspark.svn.sourceforge.net/simspark/?rev=294&view=rev Author: yxu Date: 2012-02-24 13:24:49 +0000 (Fri, 24 Feb 2012) Log Message: ----------- name conflicts in windows: GetMonitorInfo is a macro in WinUser.h Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.cpp trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.h trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp trunk/spark/lib/oxygen/monitorserver/monitorsystem.h trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp trunk/spark/plugin/sparkmonitor/sparkmonitor.h Modified: trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.cpp 2012-02-24 13:24:49 UTC (rev 294) @@ -91,7 +91,7 @@ } } -string RCS3DMonitor::GetMonitorInfo(const PredicateList& pList) +string RCS3DMonitor::GetMonitorInfomation(const PredicateList& pList) { stringstream ss; mFullState = false; Modified: trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/rcssserver3d/plugin/soccer/rcs3dmonitor/rcs3dmonitor.h 2012-02-24 13:24:49 UTC (rev 294) @@ -82,7 +82,7 @@ * the MonitorServer. The monitor should transfer them to the * client if possible. */ - virtual std::string GetMonitorInfo(const oxygen::PredicateList& pList); + virtual std::string GetMonitorInfomation(const oxygen::PredicateList& pList); /** This function is called once for every MonitorSystem each time * a new client connects. It should return any header/setup Modified: trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.cpp 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.cpp 2012-02-24 13:24:49 UTC (rev 294) @@ -213,7 +213,7 @@ } string -SexpMonitor::GetMonitorInfo(const oxygen::PredicateList& pList) +SexpMonitor::GetMonitorInfomation(const oxygen::PredicateList& pList) { if (mGameState->IsFinished()) { Modified: trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.h 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/rcssserver3d/plugin/soccer/sexpmonitor/sexpmonitor.h 2012-02-24 13:24:49 UTC (rev 294) @@ -52,7 +52,7 @@ * function is called to process it. * @param data data sent from monitor to monitorsystem via SPADES. */ - void ParseMonitorMessage(const std::string& data); + virtual void ParseMonitorMessage(const std::string& data); /** This function will be called periodically to get information * about the current state of the world. @@ -61,7 +61,7 @@ * the MonitorServer. The monitor should transfer them to the * client if possible. */ - virtual std::string GetMonitorInfo(const oxygen::PredicateList& pList); + virtual std::string GetMonitorInfomation(const oxygen::PredicateList& pList); /** This function is called once for every MonitorSystem each time * a new client connects. It should return any header/setup Modified: trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp =================================================================== --- trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/spark/lib/oxygen/monitorserver/monitorserver.cpp 2012-02-24 13:24:49 UTC (rev 294) @@ -193,7 +193,7 @@ PredicateList pList; CollectItemPredicates(false,pList); - mData = monitorSystem->GetMonitorInfo(pList); + mData = monitorSystem->GetMonitorInfomation(pList); mDataCycle = cycle; return mData; } Modified: trunk/spark/lib/oxygen/monitorserver/monitorsystem.h =================================================================== --- trunk/spark/lib/oxygen/monitorserver/monitorsystem.h 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/spark/lib/oxygen/monitorserver/monitorsystem.h 2012-02-24 13:24:49 UTC (rev 294) @@ -60,7 +60,7 @@ * the MonitorServer. The monitor should transfer them to the * client if possible. */ - virtual std::string GetMonitorInfo(const PredicateList& pList) = 0; + virtual std::string GetMonitorInfomation(const PredicateList& pList) = 0; /** If a monitor sends information to the world model, this * function is called to process it. Modified: trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/spark/plugin/sparkmonitor/sparkmonitor.cpp 2012-02-24 13:24:49 UTC (rev 294) @@ -91,7 +91,7 @@ } } -string SparkMonitor::GetMonitorInfo(const PredicateList& pList) +string SparkMonitor::GetMonitorInfomation(const PredicateList& pList) { stringstream ss; mFullState = false; Modified: trunk/spark/plugin/sparkmonitor/sparkmonitor.h =================================================================== --- trunk/spark/plugin/sparkmonitor/sparkmonitor.h 2012-02-16 12:18:29 UTC (rev 293) +++ trunk/spark/plugin/sparkmonitor/sparkmonitor.h 2012-02-24 13:24:49 UTC (rev 294) @@ -80,7 +80,7 @@ * the MonitorServer. The monitor should transfer them to the * client if possible. */ - virtual std::string GetMonitorInfo(const oxygen::PredicateList& pList); + virtual std::string GetMonitorInfomation(const oxygen::PredicateList& pList); /** This function is called once for every MonitorSystem each time * a new client connects. It should return any header/setup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-04-07 07:22:37
|
Revision: 301 http://simspark.svn.sourceforge.net/simspark/?rev=301&view=rev Author: hedayat Date: 2012-04-07 07:22:30 +0000 (Sat, 07 Apr 2012) Log Message: ----------- Add/Enable automatic quit after game over. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h trunk/rcssserver3d/rcssserver3d/naosoccersim.rb trunk/spark/ChangeLog trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/ChangeLog 2012-04-07 07:22:30 UTC (rev 301) @@ -1,3 +1,8 @@ +2012-04-07 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::UpdateGameOver): + - add AutomaticQuit mode to shutdown automatically when the game is over + 2012-02-14 Sander van Dijk <sgv...@gm...> * rcssserver3d/main.cpp (Spark): Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-07 07:22:30 UTC (rev 301) @@ -49,6 +49,7 @@ mAutomaticKickOff(false), mWaitBeforeKickOff(1.0), mSingleHalfTime(false), + mAutomaticQuit(true), mSayMsgSize(20), mAudioCutDist(50.0), mFirstCollidingAgent(true), @@ -1152,7 +1153,7 @@ SoccerRuleAspect::UpdateGameOver() { // wait for 10 seconds to finish - if (mGameState->GetModeTime() < 9) + if (mGameState->GetModeTime() < 9 || !mAutomaticQuit) { return; } @@ -1346,6 +1347,7 @@ SoccerBase::GetSoccerVar(*this,"AutomaticKickOff",mAutomaticKickOff); SoccerBase::GetSoccerVar(*this,"WaitBeforeKickOff",mWaitBeforeKickOff); SoccerBase::GetSoccerVar(*this,"SingleHalfTime",mSingleHalfTime); + SoccerBase::GetSoccerVar(*this,"AutomaticQuit",mAutomaticQuit); SoccerBase::GetSoccerVar(*this,"UseOffside",mUseOffside); float penaltyLength, penaltyWidth; SoccerBase::GetSoccerVar(*this,"PenaltyLength",penaltyLength); Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-07 07:22:30 UTC (rev 301) @@ -296,6 +296,8 @@ float mWaitBeforeKickOff; /** flag if we want to play only one half of the match */ bool mSingleHalfTime; + /** flag if the simulator should quit automatically when the game is over */ + bool mAutomaticQuit; //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) /** max time player may be sitted or laying down before being repositioned */ Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-07 07:22:30 UTC (rev 301) @@ -50,6 +50,7 @@ addSoccerVar('GoalKickDist', 1.0) addSoccerVar('AutomaticKickOff', false) addSoccerVar('WaitBeforeKickOff', 2.0) +addSoccerVar('AutomaticQuit', true) addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable # agent parameters Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/spark/ChangeLog 2012-04-07 07:22:30 UTC (rev 301) @@ -1,3 +1,8 @@ +2012-04-07 Hedayat Vatankhah <hed...@gm...> + + * lib/oxygen/simulationserver/simulationserver.cpp (SimulationServer::Step): + - quit if GameControlServer is finished (e.g. the end of a game) + 2012-02-16 Hedayat Vatankhah <hed...@gm...> * lib/salt/gmath.h: Modified: trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2012-04-07 07:22:30 UTC (rev 301) @@ -265,6 +265,13 @@ mSimTime += mSumDeltaTime; mSumDeltaTime = 0; } + + if (mGameControlServer->IsFinished() && !mExit) + { + GetLog()->Normal() << "(SimulationServer) GameControlServer finished," + " exiting.\n"; + Quit(); + } } void SimulationServer::ControlEvent(EControlEvent event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |