You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus R. <rol...@us...> - 2007-02-25 16:54:27
|
Update of /cvsroot/simspark/simspark/contrib/plugin/soccer/visionperceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3579 Added Files: Tag: WIN32 .cvsignore visionperceptor.cpp visionperceptor.h visionperceptor_c.cpp Log Message: - add visionperceptor --- NEW FILE: visionperceptor.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: visionperceptor.cpp,v 1.1.2.1 2007/02/25 16:54:18 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "visionperceptor.h" #include <zeitgeist/logserver/logserver.h> #include <oxygen/sceneserver/scene.h> #include <oxygen/sceneserver/transform.h> #include <soccer/soccerbase/soccerbase.h> using namespace zeitgeist; using namespace oxygen; using namespace boost; using namespace salt; VisionPerceptor::VisionPerceptor() : Perceptor(), mSenseMyPos(false), mAddNoise(true), mUseRandomNoise(true), mStaticSenseAxis(true) { // set predicate name SetPredicateName("Vision"); // set some default noise values SetNoiseParams(0.0965f, 0.1225f, 0.1480f, 0.005f); } VisionPerceptor::~VisionPerceptor() { mDistRng.reset(); mPhiRng.reset(); mThetaRng.reset(); } void VisionPerceptor::SetNoiseParams(float sigma_dist, float sigma_phi, float sigma_theta, float cal_error_abs) { mSigmaDist = sigma_dist; mSigmaPhi = sigma_phi; mSigmaTheta = sigma_theta; mCalErrorAbs = cal_error_abs; NormalRngPtr rng1(new salt::NormalRNG<>(0.0,sigma_dist)); mDistRng = rng1; NormalRngPtr rng2(new salt::NormalRNG<>(0.0,sigma_phi)); mPhiRng = rng2; NormalRngPtr rng3(new salt::NormalRNG<>(0.0,sigma_theta)); mThetaRng = rng3; salt::UniformRNG<float> rng4(-mCalErrorAbs,mCalErrorAbs); mError = salt::Vector3f(rng4(),rng4(),rng4()); } void VisionPerceptor::OnLink() { SoccerBase::GetTransformParent(*this,mTransformParent); SoccerBase::GetAgentState(*this, mAgentState); SoccerBase::GetActiveScene(*this,mActiveScene); } void VisionPerceptor::OnUnlink() { mDistRng.reset(); mPhiRng.reset(); mThetaRng.reset(); mTransformParent.reset(); mAgentState.reset(); mActiveScene.reset(); } void VisionPerceptor::AddNoise(bool add_noise) { mAddNoise = add_noise; } void VisionPerceptor::UseRandomNoise(bool random_noise) { mUseRandomNoise = random_noise; } void VisionPerceptor::SetStaticSenseAxis(bool static_axis) { mStaticSenseAxis = static_axis; } bool VisionPerceptor::ConstructInternal() { mRay = shared_static_cast<oxygen::RayCollider> (GetCore()->New("oxygen/RayCollider")); if (mRay.get() == 0) { GetLog()->Error() << "Error: (VisionPerceptor) cannot create Raycollider. " << "occlusion check disabled\n"; } return true; } void VisionPerceptor::SetupVisibleObjects(TObjectList& visibleObjects) { TLeafList objectList; mActiveScene->ListChildrenSupportingClass<ObjectState>(objectList, true); salt::Vector3f myPos = mTransformParent->GetWorldTransform().Pos(); for (TLeafList::iterator i = objectList.begin(); i != objectList.end(); ++i) { ObjectData od; od.mObj = shared_static_cast<ObjectState>(*i); if (od.mObj.get() == 0) { GetLog()->Error() << "Error: (VisionPerceptor) skipped: " << (*i)->GetName() << "\n"; continue; // this should never happen } shared_ptr<Transform> j = od.mObj->GetTransformParent(); if (j.get() == 0) { continue; // this should never happen } od.mRelPos = j->GetWorldTransform().Pos() - myPos; od.mDist = od.mRelPos.Length(); visibleObjects.push_back(od); } } void VisionPerceptor::AddSense(oxygen::Predicate& predicate, ObjectData& od) const { ParameterList& element = predicate.parameter.AddList(); element.AddValue(od.mObj->GetPerceptName()); if(od.mObj->GetPerceptName() == "Player") { ParameterList player; player.AddValue(std::string("team")); player.AddValue (std::string (od.mObj->GetPerceptName(ObjectState::PT_Player) ) ); element.AddValue(player); } if (!od.mObj->GetID().empty()) { ParameterList id; id.AddValue(std::string("id")); id.AddValue(od.mObj->GetID()); element.AddValue(id); } ParameterList& position = element.AddList(); position.AddValue(std::string("pol")); position.AddValue(od.mDist); position.AddValue(od.mTheta); position.AddValue(od.mPhi); } void VisionPerceptor::ApplyNoise(ObjectData& od) const { if (mAddNoise) { if (mUseRandomNoise) { od.mDist += (*(mDistRng.get()))() * od.mDist / 100.0f; od.mTheta += (*(mThetaRng.get()))(); od.mPhi += (*(mPhiRng.get()))(); } else { /* This gives a constant random error throughout the whole * match. This behavior was not intended and is a bug and * not an intended feature. * It was kept in the simulator because I discovered this * bug only shortly before the competition. *sigh* oliver */ od.mDist += salt::NormalRNG<>(0.0,mSigmaDist)(); od.mTheta += salt::NormalRNG<>(0.0,mSigmaTheta)(); od.mPhi += salt::NormalRNG<>(0.0,mSigmaPhi)(); } } } bool VisionPerceptor::StaticAxisPercept(boost::shared_ptr<PredicateList> predList) { Predicate& predicate = predList->AddPredicate(); predicate.name = mPredicateName; predicate.parameter.Clear(); TTeamIndex ti = mAgentState->GetTeamIndex(); salt::Vector3f myPos = mTransformParent->GetWorldTransform().Pos(); TObjectList visibleObjects; SetupVisibleObjects(visibleObjects); for (std::list<ObjectData>::iterator i = visibleObjects.begin(); i != visibleObjects.end(); ++i) { ObjectData& od = (*i); od.mRelPos = SoccerBase::FlipView(od.mRelPos, ti); if (mAddNoise) { od.mRelPos += mError; } if ( (od.mRelPos.Length() <= 0.1) || (CheckOcclusion(myPos,od)) ) { // object is occluded or too close continue; } // theta is the angle in the X-Y (horizontal) plane od.mTheta = salt::gRadToDeg(salt::gArcTan2(od.mRelPos[1], od.mRelPos[0])); // latitude od.mPhi = 90.0 - salt::gRadToDeg(salt::gArcCos(od.mRelPos[2]/od.mDist)); // make some noise ApplyNoise(od); // generate a sense entry AddSense(predicate,od); } if (mSenseMyPos) { Vector3f sensedMyPos = SoccerBase::FlipView(myPos, ti); ParameterList& element = predicate.parameter.AddList(); element.AddValue(std::string("mypos")); element.AddValue(sensedMyPos[0]); element.AddValue(sensedMyPos[1]); element.AddValue(sensedMyPos[2]); } return true; } bool VisionPerceptor::DynamicAxisPercept(boost::shared_ptr<PredicateList> predList) { Predicate& predicate = predList->AddPredicate(); predicate.name = mPredicateName; predicate.parameter.Clear(); TTeamIndex ti = mAgentState->GetTeamIndex(); const Vector3f& up = mTransformParent->GetWorldTransform().Up(); // calc the percptors angle in the horizontal plane double fwTheta = gNormalizeRad(Vector2f(up[0],up[1]).GetAngleRad()); // calc the perceptors angle in the vertical plane double fwPhi = gNormalizeRad(Vector2f(up[0],up[2]).GetAngleRad()); TObjectList visibleObjects; SetupVisibleObjects(visibleObjects); for (std::list<ObjectData>::iterator i = visibleObjects.begin(); i != visibleObjects.end(); ++i) { ObjectData& od = (*i); od.mRelPos = SoccerBase::FlipView(od.mRelPos, ti); if (mAddNoise) { od.mRelPos += mError; } if (od.mRelPos.Length() <= 0.1) { // object is too close continue; } // theta is the angle in horizontal plane, with fwAngle as 0 degree od.mTheta = gRadToDeg(gNormalizeRad( Vector2f(od.mRelPos[0],od.mRelPos[1]).GetAngleRad() - fwTheta )); // latitude with fwPhi as 0 degreee od.mPhi = gRadToDeg(gNormalizeRad( Vector2f(od.mRelPos[0],od.mRelPos[2]).GetAngleRad() - fwPhi )); // make some noise ApplyNoise(od); // generate a sense entry AddSense(predicate,od); } return true; } bool VisionPerceptor::Percept(boost::shared_ptr<PredicateList> predList) { if ( (mTransformParent.get() == 0) || (mActiveScene.get() == 0) || (mAgentState.get() == 0) ) { return false; } return mStaticSenseAxis ? StaticAxisPercept(predList) : DynamicAxisPercept(predList); } bool VisionPerceptor::CheckOcclusion(const Vector3f& my_pos, const ObjectData& od) const { // (occlusion test disabled for now, every object is visible) return false; } void VisionPerceptor::SetSenseMyPos(bool sense) { mSenseMyPos = sense; } --- NEW FILE: visionperceptor.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: visionperceptor.h,v 1.1.2.1 2007/02/25 16:54:18 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef VISIONPERCEPTOR_H #define VISIONPERCEPTOR_H #include <salt/random.h> #include <oxygen/agentaspect/perceptor.h> #include <oxygen/physicsserver/raycollider.h> #include <oxygen/sceneserver/sceneserver.h> #include <oxygen/sceneserver/transform.h> #include <soccer/agentstate/agentstate.h> class VisionPerceptor : public oxygen::Perceptor { protected: typedef boost::shared_ptr<salt::NormalRNG<> > NormalRngPtr; struct ObjectData { boost::shared_ptr<ObjectState> mObj; float mTheta; // angle in the X-Y (horizontal) plane float mPhi; // latitude angle float mDist; // distance between perceptor and object salt::Vector3f mRelPos; ObjectData& operator=(const ObjectData& rhs) { mObj = rhs.mObj; mRelPos = rhs.mRelPos; mTheta = rhs.mTheta; mPhi = rhs.mPhi; mDist = rhs.mDist; } int operator==(const ObjectData& rhs) const { return mDist == rhs.mDist; } int operator<(const ObjectData& rhs) const { return mDist < rhs.mDist; } }; typedef std::list<ObjectData> TObjectList; public: VisionPerceptor(); virtual ~VisionPerceptor(); //! \return true, if valid data is available and false otherwise. bool Percept(boost::shared_ptr<oxygen::PredicateList> predList); /** Set the noise parameters of the vision perceptor. * * This will always create new calibration error values. * The random noise added each step is normally distributed around 0.0. * The (fixed) calibration error is calculated once for each axis. It * is uniformly distributed between -cal_error_abs and cal_error_abs and * added to the "camera" coordinates. * * \param sigma_dist the sigma for the distance error distribution * \param sigma_phi the sigma for the horizontal angle error distribution * \param sigma_theta the sigma for the latitudal angle error distribution * \param cal_error_abs absolute value of the maximum calibration error * along each axis. */ void SetNoiseParams(float sigma_dist, float sigma_phi, float sigma_theta, float cal_error_abs); //! Turn sensing of agent position on/off void SetSenseMyPos(bool sense); /** Turn noise off/on. \param add_noise flag if noise should be used at all. */ void AddNoise(bool add_noise); /** Turn randomization off/on. \param random_noise flag if the measurement noise is randomized each step. */ void UseRandomNoise(bool random_noise); //! Turn senses relative to the X-axis of the team off/on void SetStaticSenseAxis(bool static_axis); protected: /** constructs the internal ray collider */ virtual bool ConstructInternal(); /** prepares a list of visible objects */ void SetupVisibleObjects(TObjectList& visibleObjects); /** Percept implementation for a static relative axis */ bool StaticAxisPercept(boost::shared_ptr<oxygen::PredicateList> predList); /** Percept implementation relative to the current orientation of the VisionPerceptor node */ bool DynamicAxisPercept(boost::shared_ptr<oxygen::PredicateList> predList); /** Checks if the given object is occluded, seen from from my_pos */ bool CheckOcclusion(const salt::Vector3f& my_pos, const ObjectData& od) const; /** constructs a sense entry for the given object in the given predicate*/ void AddSense(oxygen::Predicate& predicate, ObjectData& od) const; /** applies noise to the setup ObjectData */ void ApplyNoise(ObjectData& od) const; virtual void OnLink(); virtual void OnUnlink(); protected: //! vision calibration error salt::Vector3f mError; //! true, if the absolute position of the agent is sensed. bool mSenseMyPos; //! sigma for random measurement error (distance) float mSigmaDist; //! sigma for random measurement error (horizontal angle) float mSigmaTheta; //! sigma for random measurement error (latitudal angle) float mSigmaPhi; //! absolute maximum value of the calibration error float mCalErrorAbs; //! flag if we should noisify the data bool mAddNoise; //! flag if the error should be randomized each step bool mUseRandomNoise; /** flag if the senses are always relative to the X-axis of the team, default true */ bool mStaticSenseAxis; //! ray collider to check occlusion boost::shared_ptr<oxygen::RayCollider> mRay; //! random number generator for distance errors NormalRngPtr mDistRng; //! random number generator for angle errors NormalRngPtr mThetaRng; //! random number generator for angle errors NormalRngPtr mPhiRng; boost::shared_ptr<oxygen::Scene> mActiveScene; //! a reference to the next transorm parent boost::shared_ptr<oxygen::Transform> mTransformParent; //! a reference to the scene server boost::shared_ptr<oxygen::SceneServer> mSceneServer; //! a reference to the agent state boost::shared_ptr<AgentState> mAgentState; }; DECLARE_CLASS(VisionPerceptor); #endif //VISIONPERCEPTOR_H --- NEW FILE: visionperceptor_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: visionperceptor_c.cpp,v 1.1.2.1 2007/02/25 16:54:18 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "visionperceptor.h" using namespace boost; using namespace oxygen; using namespace std; FUNCTION(VisionPerceptor,setNoiseParams) { float inDist; float inPhi; float inTheta; float inErrorAbs; if ( (in.GetSize() != 4) || (! in.GetValue(in[0],inDist)) || (! in.GetValue(in[1],inPhi)) || (! in.GetValue(in[2],inTheta)) || (! in.GetValue(in[3],inErrorAbs)) ) { return false; } obj->SetNoiseParams(inDist,inPhi,inTheta,inErrorAbs); return true; } FUNCTION(VisionPerceptor,addNoise) { bool inAddNoise; if ( (in.GetSize() != 1) || (! in.GetValue(in.begin(),inAddNoise)) ) { return false; } obj->AddNoise(inAddNoise); return true; } FUNCTION(VisionPerceptor,useRandomNoise) { bool inRandomNoise; if ( (in.GetSize() != 1) || (! in.GetValue(in.begin(),inRandomNoise)) ) { return false; } obj->UseRandomNoise(inRandomNoise); return true; } FUNCTION(VisionPerceptor,setSenseMyPos) { bool inSenseMyPos; if ( (in.GetSize() != 1) || (! in.GetValue(in.begin(),inSenseMyPos)) ) { return false; } obj->SetSenseMyPos(inSenseMyPos); return true; } FUNCTION(VisionPerceptor,setStaticSenseAxis) { bool inStaticAxis; if ( (in.GetSize() != 1) || (! in.GetValue(in.begin(),inStaticAxis)) ) { return false; } obj->SetStaticSenseAxis(inStaticAxis); return true; } void CLASS(VisionPerceptor)::DefineClass() { DEFINE_BASECLASS(oxygen/Perceptor); DEFINE_FUNCTION(setNoiseParams); DEFINE_FUNCTION(addNoise); DEFINE_FUNCTION(useRandomNoise); DEFINE_FUNCTION(setSenseMyPos); DEFINE_FUNCTION(setStaticSenseAxis); } --- NEW FILE: .cvsignore --- *.lo .deps .dirstamp .libs Makefile Makefile.in |
From: Markus R. <rol...@us...> - 2007-02-25 16:53:43
|
Update of /cvsroot/simspark/simspark/contrib/plugin/soccer In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3192 Modified Files: Tag: WIN32 export.cpp soccer.vcproj Log Message: - add strippped down soccerbase class Index: soccer.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/soccer/Attic/soccer.vcproj,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** soccer.vcproj 18 Feb 2007 13:08:19 -0000 1.1.2.2 --- soccer.vcproj 25 Feb 2007 16:53:38 -0000 1.1.2.3 *************** *** 226,233 **** --- 226,257 ---- > <File + RelativePath=".\soccerbase\soccerbase.cpp" + > + </File> + <File + RelativePath=".\soccerbase\soccerbase.h" + > + </File> + <File RelativePath=".\soccerbase\soccertypes.h" > </File> </Filter> + <Filter + Name="visionperceptor" + > + <File + RelativePath=".\visionperceptor\visionperceptor.cpp" + > + </File> + <File + RelativePath=".\visionperceptor\visionperceptor.h" + > + </File> + <File + RelativePath=".\visionperceptor\visionperceptor_c.cpp" + > + </File> + </Filter> <File RelativePath=".\export.cpp" Index: export.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/plugin/soccer/Attic/export.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** export.cpp 18 Feb 2007 12:54:55 -0000 1.1.2.1 --- export.cpp 25 Feb 2007 16:53:38 -0000 1.1.2.2 *************** *** 25,28 **** --- 25,29 ---- #include <soccer/objectstate/objectstate.h> #include <soccer/agentstate/agentstate.h> + #include <soccer/visionperceptor/visionperceptor.h> ZEITGEIST_EXPORT_BEGIN() *************** *** 30,33 **** --- 31,35 ---- ZEITGEIST_EXPORT(ObjectState); ZEITGEIST_EXPORT(AgentState); + ZEITGEIST_EXPORT(VisionPerceptor); ZEITGEIST_EXPORT_END() |
From: Markus R. <rol...@us...> - 2007-02-25 16:53:43
|
Update of /cvsroot/simspark/simspark/contrib/plugin/soccer/soccerbase In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3192/soccerbase Added Files: Tag: WIN32 soccerbase.cpp soccerbase.h Log Message: - add strippped down soccerbase class --- NEW FILE: soccerbase.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: soccerbase.h,v 1.1.2.1 2007/02/25 16:53:38 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef SOCCERBASE_H #define SOCCERBASE_H #include <soccer/soccerbase/soccertypes.h> #include <zeitgeist/scriptserver/scriptserver.h> #include <zeitgeist/leaf.h> #include <zeitgeist/logserver/logserver.h> #include <boost/shared_ptr.hpp> //namespace zeitgeist //{ // class Leaf; //} namespace oxygen { class SceneServer; class Scene; class Transform; class Perceptor; class Body; class SphereCollider; class ControlAspect; } namespace salt { class Vector3f; } class AgentState; class SoccerRuleAspect; class SoccerBase { public: typedef std::list<boost::shared_ptr<AgentState> > TAgentStateList; public: SoccerBase() {} virtual ~SoccerBase() {} /** returns a reference to the SceneServer */ static bool GetSceneServer(const zeitgeist::Leaf& base, boost::shared_ptr<oxygen::SceneServer>& scene_server); /** returns a reference to the closest parent supporting Transform */ static bool GetTransformParent(const zeitgeist::Leaf& base, boost::shared_ptr<oxygen::Transform>& transform_parent); /** returns a reference to the Body node below the closest transform parent */ static bool GetBody(const zeitgeist::Leaf& base, boost::shared_ptr<oxygen::Body>& body); /** returns a reference to the Body node below the given Transform node */ static bool GetAgentBody(const boost::shared_ptr<oxygen::Transform> transform, boost::shared_ptr<oxygen::Body>& agent_body); /** returns a reference to the Body node below the given Transform node based on parameters team index and uniform number */ static bool GetAgentBody(const zeitgeist::Leaf& base, TTeamIndex idx, int unum, boost::shared_ptr<oxygen::Body>& agent_body); /** returns a reference to the AgentState node below the closest Transform parent */ static bool GetAgentState(const zeitgeist::Leaf& base, boost::shared_ptr<AgentState>& agent_state); /** returns a reference to the AgentState node below the given transform node */ static bool GetAgentState(const boost::shared_ptr<oxygen::Transform> transform, boost::shared_ptr<AgentState>& agentState); /** returns a reference to the AgentState node below the given Transform node based on parameters team index and uniform number */ static bool GetAgentState(const zeitgeist::Leaf& base, TTeamIndex idx, int unum, boost::shared_ptr<AgentState>& agent_state); static bool GetAgentStates(const zeitgeist::Leaf& base, TAgentStateList& agentStates, TTeamIndex idx = TI_NONE); /** returns a reference to the active scene from the SceneServer */ static bool GetActiveScene(const zeitgeist::Leaf& base, boost::shared_ptr<oxygen::Scene>& active_scene); /** flips horizontal coordinates according to the side of the agent */ static salt::Vector3f FlipView(const salt::Vector3f& pos, TTeamIndex ti); /** Get the team index of the opponent team */ static TTeamIndex OpponentTeam(TTeamIndex ti); /** returns a reference to a ControlAspect registered to the GameControlServer */ static boost::shared_ptr<oxygen::ControlAspect> GetControlAspect(const zeitgeist::Leaf& base, const std::string& name); /** looks up a ruby variable in the Soccer namespace */ template<typename TYPE> static bool GetSoccerVar(const zeitgeist::Leaf& base, const std::string& name, TYPE& value) { static const std::string nSpace = "Soccer."; bool ok = base.GetCore()->GetScriptServer()->GetVariable (std::string(nSpace + name),value); if (! ok) { base.GetLog()->Error() << "ERROR: (SoccerBase: " << base.GetName() << ") soccer variable '" << name << "' not found\n"; return false; } return ok; } /** returns a string representing a play mode */ static std::string PlayMode2Str(const TPlayMode mode); }; #endif --- NEW FILE: soccerbase.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: soccerbase.cpp,v 1.1.2.1 2007/02/25 16:53:38 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "soccerbase.h" #include <oxygen/physicsserver/body.h> #include <oxygen/physicsserver/spherecollider.h> #include <oxygen/agentaspect/perceptor.h> #include <oxygen/sceneserver/sceneserver.h> #include <oxygen/sceneserver/scene.h> #include <oxygen/sceneserver/transform.h> #include <oxygen/controlaspect/controlaspect.h> #include <soccer/agentstate/agentstate.h> using namespace boost; using namespace zeitgeist; using namespace oxygen; using namespace std; bool SoccerBase::GetSceneServer(const Leaf& base, shared_ptr<SceneServer>& scene_server) { scene_server = shared_static_cast<SceneServer> (base.GetCore()->Get("/sys/server/scene")); if (scene_server.get() == 0) { base.GetLog()->Error() << "Error: (SoccerBase: " << base.GetName() << ") scene server not found.\n"; return false; } return true; } bool SoccerBase::GetTransformParent(const Leaf& base, shared_ptr<Transform>& transform_parent) { transform_parent = shared_dynamic_cast<Transform> (make_shared(base.GetParentSupportingClass("Transform"))); if (transform_parent.get() == 0) { base.GetLog()->Error() << "Error: (SoccerBase: " << base.GetName() << ") parent node is not derived from TransformNode\n"; return false; } return true; } bool SoccerBase::GetAgentState(const shared_ptr<Transform> transform, shared_ptr<AgentState>& agent_state) { agent_state = shared_dynamic_cast<AgentState>(transform->GetChild("AgentState")); if (agent_state.get() == 0) { return false; } return true; } bool SoccerBase::GetAgentBody(const shared_ptr<Transform> transform, shared_ptr<Body>& agent_body) { agent_body = shared_dynamic_cast<Body> (transform->GetChildSupportingClass("Body", true)); if (agent_body.get() == 0) { transform->GetLog()->Error() << "(SoccerBase) ERROR: " << transform->GetName() << ") node has no Body child\n"; return false; } return true; } bool SoccerBase::GetAgentBody(const Leaf& base, TTeamIndex idx, int unum, shared_ptr<Body>& agent_body) { shared_ptr<AgentState> agentState; shared_ptr<Transform> parent; // get matching AgentState if (!GetAgentState(base, idx, unum, agentState)) return false; // get AgentAspect if (!GetTransformParent(*agentState, parent)) return false; // call GetAgentBody with matching AgentAspect return GetAgentBody(parent, agent_body); } bool SoccerBase::GetAgentState(const Leaf& base, shared_ptr<AgentState>& agent_state) { shared_ptr<Transform> parent; if (! GetTransformParent(base,parent)) { return false; } return GetAgentState(parent,agent_state); } bool SoccerBase::GetAgentState(const Leaf& base, TTeamIndex idx, int unum, shared_ptr<AgentState>& agentState) { // get the active scene shared_ptr<Scene> activeScene; if (GetActiveScene(base, activeScene)) { Leaf::TLeafList leafList; // get a list of all the agent aspects activeScene->GetChildrenOfClass("AgentAspect", leafList); if (leafList.size() == 0) { base.GetLog()->Error() << "ERROR: (SoccerBase) active scene doesn't have " << "children of type AgentAspect\n"; return false; } Leaf::TLeafList::iterator iter = leafList.begin(); // search through the list to find an agent state // with matching team index and unum for ( iter; iter != leafList.end(); ++iter ) { shared_ptr<Transform> agentAspect = shared_dynamic_cast<Transform>(*iter); if (GetAgentState(agentAspect, agentState) && (agentState->GetTeamIndex() == idx) && (agentState->GetUniformNumber() == unum)) { return true; } } } return false; } bool SoccerBase::GetAgentStates(const zeitgeist::Leaf& base, TAgentStateList& agentStates, TTeamIndex idx) { // get the active scene shared_ptr<Scene> activeScene; if (GetActiveScene(base, activeScene)) { Leaf::TLeafList leafList; // get a list of all the agent aspects activeScene->GetChildrenOfClass("AgentAspect", leafList); if (leafList.size() == 0) { base.GetLog()->Error() << "ERROR: (SoccerBase) active scene doesn't have " << "children of type AgentAspect\n"; return false; } shared_ptr<AgentState> agentState; Leaf::TLeafList::iterator iter = leafList.begin(); // search through the list to find an agent state // with matching team index for (iter; iter != leafList.end(); ++iter ) { shared_ptr<Transform> agentAspect = shared_dynamic_cast<Transform>(*iter); if (agentAspect.get() == 0) continue; if (GetAgentState(agentAspect, agentState) && ((agentState->GetTeamIndex() == idx) || (idx == TI_NONE))) { agentStates.push_back(agentState); } } return true; } return false; } bool SoccerBase::GetActiveScene(const Leaf& base, shared_ptr<Scene>& active_scene) { shared_ptr<SceneServer> sceneServer; if (! GetSceneServer(base,sceneServer)) { return false; } active_scene = sceneServer->GetActiveScene(); if (active_scene.get() == 0) { base.GetLog()->Error() << "ERROR: (SoccerBase: " << base.GetName() << ") SceneServer reports no active scene\n"; return false; } return true; } bool SoccerBase::GetBody(const Leaf& base, shared_ptr<Body>& body) { shared_ptr<Transform> parent; if (! GetTransformParent(base,parent)) { return false; } body = shared_dynamic_cast<Body>(parent->GetChildOfClass("Body")); if (body.get() == 0) { base.GetLog()->Error() << "ERROR: (SoccerBase: " << base.GetName() << ") parent node has no Body child."; return false; } return true; } salt::Vector3f SoccerBase::FlipView(const salt::Vector3f& pos, TTeamIndex ti) { salt::Vector3f newPos; switch (ti) { case TI_RIGHT: newPos[0] = -pos[0]; newPos[1] = -pos[1]; newPos[2] = pos[2]; break; case TI_NONE: case TI_LEFT: newPos = pos; break; } return newPos; } TTeamIndex SoccerBase::OpponentTeam(TTeamIndex ti) { switch (ti) { case TI_RIGHT: return TI_LEFT; case TI_LEFT: return TI_RIGHT; default: return TI_NONE; } } string SoccerBase::PlayMode2Str(const TPlayMode mode) { switch (mode) { case PM_BeforeKickOff: return STR_PM_BeforeKickOff; case PM_KickOff_Left: return STR_PM_KickOff_Left; case PM_KickOff_Right: return STR_PM_KickOff_Right; case PM_PlayOn: return STR_PM_PlayOn; case PM_KickIn_Left: return STR_PM_KickIn_Left; case PM_KickIn_Right: return STR_PM_KickIn_Right; case PM_CORNER_KICK_LEFT: return STR_PM_CORNER_KICK_LEFT; case PM_CORNER_KICK_RIGHT: return STR_PM_CORNER_KICK_RIGHT; case PM_GOAL_KICK_LEFT: return STR_PM_GOAL_KICK_LEFT; case PM_GOAL_KICK_RIGHT: return STR_PM_GOAL_KICK_RIGHT; case PM_OFFSIDE_LEFT: return STR_PM_OFFSIDE_LEFT; case PM_OFFSIDE_RIGHT: return STR_PM_OFFSIDE_RIGHT; case PM_GameOver: return STR_PM_GameOver; case PM_Goal_Left: return STR_PM_Goal_Left; case PM_Goal_Right: return STR_PM_Goal_Right; case PM_FREE_KICK_LEFT: return STR_PM_FREE_KICK_LEFT; case PM_FREE_KICK_RIGHT: return STR_PM_FREE_KICK_RIGHT; default: return STR_PM_Unknown; }; } shared_ptr<ControlAspect> SoccerBase::GetControlAspect(const zeitgeist::Leaf& base,const string& name) { static const string gcsPath = "/sys/server/gamecontrol/"; shared_ptr<ControlAspect> aspect = shared_dynamic_cast<ControlAspect> (base.GetCore()->Get(gcsPath + name)); if (aspect.get() == 0) { base.GetLog()->Error() << "ERROR: (SoccerBase: " << base.GetName() << ") found no ControlAspect " << name << "\n"; } return aspect; } |
From: Markus R. <rol...@us...> - 2007-02-25 16:52:32
|
Update of /cvsroot/simspark/simspark/contrib/plugin/soccer/visionperceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2792/visionperceptor Log Message: Directory /cvsroot/simspark/simspark/contrib/plugin/soccer/visionperceptor added to the repository --> Using per-directory sticky tag `WIN32' |
From: Markus R. <rol...@us...> - 2007-02-25 16:35:05
|
Update of /cvsroot/simspark/simspark/spark/win32 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28099 Modified Files: Tag: WIN32 simspark.iss Log Message: - include agentspark.exe and sceneeffector.dll in setup bundle Index: simspark.iss =================================================================== RCS file: /cvsroot/simspark/simspark/spark/win32/Attic/simspark.iss,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** simspark.iss 18 Feb 2007 13:16:59 -0000 1.1.2.4 --- simspark.iss 25 Feb 2007 16:35:00 -0000 1.1.2.5 *************** *** 44,47 **** --- 44,48 ---- ; applications Source: {#MyVcReleaseDir}\rsgedit.exe; DestDir: {app}; Flags: ignoreversion + Source: {#MyVcReleaseDir}\agentspark.exe; DestDir: {app}; Flags: ignoreversion ; plugins *************** *** 52,55 **** --- 53,57 ---- Source: {#MyVcReleaseDir}\soccer.dll; DestDir: {app}; Flags: ignoreversion Source: {#MyVcReleaseDir}\sparkagent.dll; DestDir: {app}; Flags: ignoreversion + Source: {#MyVcReleaseDir}\sceneeffector.dll; DestDir: {app}; Flags: ignoreversion ; ruby scripts |
From: Markus R. <rol...@us...> - 2007-02-25 16:33:50
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27311 Modified Files: Tag: WIN32 agent.rb Log Message: - don't spawn an agent automatically Index: agent.rb =================================================================== RCS file: /cvsroot/simspark/simspark/simulations/parts/rsg/Attic/agent.rb,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** agent.rb 18 Feb 2007 12:57:38 -0000 1.1.2.1 --- agent.rb 25 Feb 2007 16:33:22 -0000 1.1.2.2 *************** *** 8,10 **** scene = get($scenePath) scene.importScene('rsg/boxspheres/arena.rsg') - scene.importScene('rsg/agent/hoap2.rsg') --- 8,9 ---- |
From: Markus R. <rol...@us...> - 2007-02-25 16:28:42
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25602 Modified Files: Tag: WIN32 spark.rb Log Message: - adjust default camera vertical angle to 30 degrees Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** spark.rb 22 Feb 2007 16:04:39 -0000 1.5.2.2 --- spark.rb 25 Feb 2007 16:28:21 -0000 1.5.2.3 *************** *** 250,253 **** --- 250,254 ---- fpsController = new('oxygen/FPSController',path+'/physics/controller') fpsController.setAcceleration(accel) + fpsController.setVAngle(30.0) inputControl = get($serverPath+'simulation/InputControl') inputControl.setFPSController(path+'/physics/controller') |
From: Markus R. <rol...@us...> - 2007-02-25 16:27:52
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25212 Modified Files: Tag: WIN32 fpscontroller.cpp fpscontroller.h fpscontroller_c.cpp Log Message: - add and export functions SetHAngle and SetVAngle Index: fpscontroller.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/fpscontroller.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** fpscontroller.h 5 Dec 2005 21:21:17 -0000 1.1 --- fpscontroller.h 25 Feb 2007 16:27:45 -0000 1.1.2.1 *************** *** 50,53 **** --- 50,59 ---- void AdjustVAngle(const float delta); + /** sets the current horizontal angle */ + void SetHAngleDeg(const float angleDeg); + + /** sets the current vertical angle */ + void SetVAngleDeg(const float angleDeg); + /** enables or disables forward movement */ void Forward(const bool state); *************** *** 86,93 **** float mAcceleration; ! /** the current horizontal angle */ float mHAngle; ! /** the current vertical angle */ float mVAngle; --- 92,99 ---- float mAcceleration; ! /** the current horizontal angle in degrees*/ float mHAngle; ! /** the current vertical angle in degrees */ float mVAngle; Index: fpscontroller_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/fpscontroller_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** fpscontroller_c.cpp 5 Dec 2005 21:21:17 -0000 1.1 --- fpscontroller_c.cpp 25 Feb 2007 16:27:45 -0000 1.1.2.1 *************** *** 41,44 **** --- 41,76 ---- } + FUNCTION(FPSController,setHAngle) + { + float inAngleDeg; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inAngleDeg)) + ) + { + return false; + } + + obj->SetHAngleDeg(inAngleDeg); + return true; + } + + FUNCTION(FPSController,setVAngle) + { + float inAngleDeg; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inAngleDeg)) + ) + { + return false; + } + + obj->SetVAngleDeg(inAngleDeg); + return true; + } + FUNCTION(FPSController,getAcceleration) { *************** *** 51,53 **** --- 83,87 ---- DEFINE_FUNCTION(setAcceleration); DEFINE_FUNCTION(getAcceleration); + DEFINE_FUNCTION(setHAngle); + DEFINE_FUNCTION(setVAngle); } Index: fpscontroller.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/fpscontroller.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** fpscontroller.cpp 5 Dec 2005 21:21:17 -0000 1.1 --- fpscontroller.cpp 25 Feb 2007 16:27:45 -0000 1.1.2.1 *************** *** 104,107 **** --- 104,117 ---- } + void FPSController::SetHAngleDeg(const float angleDeg) + { + mHAngle = angleDeg; + } + + void FPSController::SetVAngleDeg(const float angleDeg) + { + mVAngle = angleDeg; + } + void FPSController::Forward(const bool state) { |
From: Markus R. <rol...@us...> - 2007-02-25 16:27:21
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25196 Modified Files: Tag: WIN32 rsgedit.rb Log Message: - move default camera position further up - Index: rsgedit.rb =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.rb,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -C2 -d -r1.4.2.3 -r1.4.2.4 *** rsgedit.rb 18 Feb 2007 13:16:59 -0000 1.4.2.3 --- rsgedit.rb 25 Feb 2007 16:27:18 -0000 1.4.2.4 *************** *** 9,13 **** x = -5, y = -40, ! z = 2, maxSpeed = 15.0, accel = 400.0, --- 9,13 ---- x = -5, y = -40, ! z = 15, maxSpeed = 15.0, accel = 400.0, |
From: Markus R. <rol...@us...> - 2007-02-25 15:54:00
|
Update of /cvsroot/simspark/simspark/contrib/agentspark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11888 Modified Files: Tag: WIN32 agentspark.vcproj Added Files: Tag: WIN32 soccerbotbehavior.cpp soccerbotbehavior.h Log Message: - add default soccerbot behavior from rcssserver3d cvs Index: agentspark.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/agentspark/Attic/agentspark.vcproj,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** agentspark.vcproj 23 Feb 2007 19:58:20 -0000 1.1.2.1 --- agentspark.vcproj 25 Feb 2007 15:53:50 -0000 1.1.2.2 *************** *** 191,194 **** --- 191,202 ---- > </File> + <File + RelativePath=".\soccerbotbehavior.cpp" + > + </File> + <File + RelativePath=".\soccerbotbehavior.h" + > + </File> </Files> <Globals> --- NEW FILE: soccerbotbehavior.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Mar 27 2006 Copyright (C) 2006 RoboCup Simulation League Maintenance Committee 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 SOCCERBOTBEHAVIOR_H #define SOCCERBOTBEHAVIOR_H #include "behavior.h" #include <oxygen/gamecontrolserver/baseparser.h> #include <oxygen/gamecontrolserver/predicate.h> #include <zeitgeist/zeitgeist.h> class SoccerbotBehavior : public Behavior { public: struct HingeJointSense { /** joint angle */ float angle; /** joint angle rate */ float rate; HingeJointSense() : angle(0), rate(0) {}; }; struct UniversalJointSense { /** joint angle axis 1*/ float angle1; /** joint angle axis 2*/ float angle2; /** joint angle rate axis 1*/ float rate1; /** joint angle rate axis 2*/ float rate2; UniversalJointSense() : angle1(0), angle2(0), rate1(0), rate2(0) {}; }; enum JointID { JID_HEAD_1 = 0, JID_HEAD_2 = 1, JID_LLEG_1 = 2, JID_RLEG_1 = 3, JID_LLEG_2_3 = 4, JID_RLEG_2_3 = 5, JID_LLEG_4 = 6, JID_RLEG_4 = 7, JID_LLEG_5_6 = 8, JID_RLEG_5_6 = 9, JID_LARM_1_2 = 10, JID_RARM_1_2 = 11, JID_LARM_3 = 12, JID_RARM_3 = 13, JID_LARM_4 = 14, JID_RARM_4 = 15, JID_LARM_5 = 16, JID_RARM_5 = 17 }; enum BehaviorState { ARM_UP = 0, ARM_ROTATE = 1, ARM_WAVE_1 = 2, ARM_WAVE_2 = 3 }; public: SoccerbotBehavior(); virtual std::string Init(); virtual std::string Think(const std::string& message); protected: void SetupJointIDMap(); void ParseHingeJointInfo(const oxygen::Predicate& predicate); void ParseUniversalJointInfo(const oxygen::Predicate& predicate); protected: zeitgeist::Zeitgeist mZG; boost::shared_ptr<oxygen::BaseParser> mParser; // mapping from joint id to joint hinge sense object typedef std::map<JointID, HingeJointSense> THingeJointSenseMap; THingeJointSenseMap mHingeJointSenseMap; // mapping from joint id to joint hinge sense object typedef std::map<JointID, UniversalJointSense> TUniversalJointSenseMap; TUniversalJointSenseMap mUniversalJointSenseMap; // mapping from object name to joint id typedef std::map<std::string, JointID> TJointIDMap; TJointIDMap mJointIDMap; }; #endif // SOCCERBOTBEHAVIOR_H --- NEW FILE: soccerbotbehavior.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2005 Koblenz University 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 "soccerbotbehavior.h" #include <iostream> #include <sstream> #include <cmath> using namespace oxygen; using namespace zeitgeist; using namespace std; using namespace boost; using namespace salt; SoccerbotBehavior::SoccerbotBehavior() : mZG("." PACKAGE_NAME) { } void SoccerbotBehavior::SetupJointIDMap() { mJointIDMap.clear(); mJointIDMap["head_joint_2"] = JID_HEAD_2; mJointIDMap["head_joint_1"] = JID_HEAD_1; mJointIDMap["lleg_joint_1"] = JID_LLEG_1; mJointIDMap["rleg_joint_1"] = JID_RLEG_1; mJointIDMap["lleg_joint_2_3"] = JID_LLEG_2_3; mJointIDMap["rleg_joint_2_3"] = JID_RLEG_2_3; mJointIDMap["lleg_joint_4"] = JID_LLEG_4; mJointIDMap["rleg_joint_4"] = JID_RLEG_4; mJointIDMap["lleg_joint_5_6"] = JID_LLEG_5_6; mJointIDMap["rleg_joint_5_6"] = JID_RLEG_5_6; mJointIDMap["larm_joint_1_2"] = JID_LARM_1_2; mJointIDMap["rarm_joint_1_2"] = JID_RARM_1_2; mJointIDMap["larm_joint_3"] = JID_LARM_3; mJointIDMap["rarm_joint_3"] = JID_RARM_3; mJointIDMap["larm_joint_4"] = JID_LARM_4; mJointIDMap["rarm_joint_4"] = JID_RARM_4; mJointIDMap["larm_joint_5"] = JID_LARM_5; mJointIDMap["rarm_joint_5"] = JID_RARM_5; } string SoccerbotBehavior::Init() { mZG.GetCore()->ImportBundle("sexpparser"); mParser = shared_static_cast<BaseParser> (mZG.GetCore()->New("SexpParser")); if (mParser.get() == 0) { cerr << "unable to create SexpParser instance." << endl; } SetupJointIDMap(); // use the scene effector to build the agent and beam to a // position near the center of the playing field return "(scene rsg/agent/soccerbot.rsg)"; } void SoccerbotBehavior::ParseHingeJointInfo(const oxygen::Predicate& predicate) { //cout << "(SoccerbotBehavior) parsing HJ info" << endl; // read the object name string name; Predicate::Iterator iter(predicate); if (! predicate.GetValue(iter, "name", name)) { return; } // try to lookup the joint id TJointIDMap::iterator idIter = mJointIDMap.find(name); if (idIter == mJointIDMap.end()) { cerr << "(SoccerbotBehavior) unknown joint id!" << endl; return; } JointID jid = (*idIter).second; // read the angle value HingeJointSense sense; if (! predicate.GetValue(iter,"axis", sense.angle)) { return; } // update the map mHingeJointSenseMap[jid] = sense; } void SoccerbotBehavior::ParseUniversalJointInfo(const oxygen::Predicate& predicate) { // read the object name string name; Predicate::Iterator iter(predicate); if (! predicate.GetValue(iter, "name", name)) { return; } // try to lookup the joint id TJointIDMap::iterator idIter = mJointIDMap.find(name); if (idIter == mJointIDMap.end()) { cerr << "(SoccerbotBehavior) unknown joint id!" << endl; return; } JointID jid = (*idIter).second; // record the angle and rate values UniversalJointSense sense; // try to read axis1 angle if (! predicate.GetValue(iter,"ax1", sense.angle1)) { cerr << "(SoccerbotBehavior) could not parse universal joint angle1!" << endl; return; } // try to read axis1 rate if (! predicate.GetValue(iter,"rt1", sense.rate1)) { cerr << "(SoccerbotBehavior) could not parse universal joint rate1!" << endl; return; } // try to read axis2 angle if (! predicate.GetValue(iter,"ax2", sense.angle2)) { cerr << "(SoccerbotBehavior) could not parse universal joint angle2!" << endl; return; } // try to read axis2 rate if (! predicate.GetValue(iter,"rt2", sense.rate2)) { cerr << "(SoccerbotBehavior) could not parse universal joint rate2!" << endl; return; } //cout << "(ParseUniversalJointInfo) got angles " << sense.angle1 // << " and " << sense.angle2 << endl; // update the map mUniversalJointSenseMap[jid] = sense; } string SoccerbotBehavior::Think(const std::string& message) { //sleep(1); static const float gain = 0.1f; static BehaviorState state = ARM_UP; // parse message and extract joint angles //cout << "(SoccerbotBehavior) received message " << message << endl; shared_ptr<PredicateList> predList = mParser->Parse(message); if (predList.get() != 0) { PredicateList& list = *predList; for ( PredicateList::TList::const_iterator iter = list.begin(); iter != list.end(); ++iter ) { const Predicate& predicate = (*iter); // check for a joint percept switch(predicate.name[0]) { case 'H': // hinge joint (HJ) ParseHingeJointInfo(predicate); break; case 'U': // universal joint (UJ) ParseUniversalJointInfo(predicate); break; default: break; } } } float curAngle = 0; float newAngle = 0; // string stream for the server commands stringstream ss(""); // curAngle = mUniversalJointSenseMap[JID_LLEG_5_6].angle1; // if (curAngle < 40.0) // { // newAngle = gain * (40.0 - curAngle); // ss << "(lleg_eff_5_6 0.0 " << newAngle << ")"; // } #if 0 switch(state) { case ARM_UP: curAngle = mUniversalJointSenseMap[JID_RARM_1_2].angle2; if (curAngle < 90.0) { newAngle = gain * (90.0 - curAngle); ss << "(rarm_eff_1_2 0.0 " << newAngle << ")"; } else { state = ARM_ROTATE; } break; case ARM_ROTATE: curAngle = mHingeJointSenseMap[JID_RARM_3].angle; if (curAngle < 90.0) { newAngle = gain * (90.0 - curAngle); ss << "(rarm_eff_3 " << newAngle << ")"; } else { state = ARM_WAVE_1; } break; case ARM_WAVE_1: curAngle = mHingeJointSenseMap[JID_RARM_4].angle; if (curAngle < 90.0) { newAngle = gain * (90.0 - curAngle); ss << "(rarm_eff_4 " << newAngle << ")"; } else { state = ARM_WAVE_2; } break; case ARM_WAVE_2: curAngle = mHingeJointSenseMap[JID_RARM_4].angle; if (curAngle > 60.0 || curAngle <= 59.5) { newAngle = gain * (60.0 - curAngle); ss << "(rarm_eff_4 " << newAngle << ")"; } else { state = ARM_WAVE_1; } break; default: break; } #endif // cout << "+++" << endl; // cout << "current angle: " << curAngle << endl; // cout << "desired angle: " << newAngle << endl; // cout << "(Behavior) sending string " << ss.str() << " to server" << endl; // cout << "State is " << state << endl; // cout << "---" << endl; //return ss.str(); return string(""); } |
From: Markus R. <rol...@us...> - 2007-02-25 15:53:30
|
Update of /cvsroot/simspark/simspark/simulations/parts/rsg/agent In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11873 Added Files: Tag: WIN32 soccerbot.rsg Log Message: - add soccerbot.rsg from rcssserver3d cvs --- NEW FILE: soccerbot.rsg --- ; -*- mode: lisp; -*- ; ; possible base for the Atlanta 2007 robot ; (RubySceneGraph 0 1) ( ; ; define constants for the robot parts ; ; feet (define $FootLength 0.6) (define $FootWidth 0.956) (define $FootHeight 0.095) (define $FootMass 0.1) ; static box at the ankles (define $AnkleBoxLength 0.355) (define $AnkleBoxWidth 0.143) (define $AnkleBoxHeight 0.476) ; shanks (define $ShankLength 0.56) (define $ShankWidth 0.56) (define $ShankHeight 0.964) (define $ShankMass 0.25) ; thighs (define $ThighLength 0.56) (define $ThighWidth 0.56) (define $ThighHeight 1.3) (define $ThighMass 0.25) ; hips (define $HipLength 0.273) (define $HipWidth 0.273) (define $HipHeight 0.2) (define $HipMass 0.1) ; hand1 (define $HandBox1Length 0.082) (define $HandBox1Width 0.272) (define $HandBox1Height 0.57) ; hand2 (define $HandBox2Length 0.242) (define $HandBox2Width 0.272) (define $HandBox2Height 0.164) ; hand3 (define $HandBox3Length 0.074) (define $HandBox3Width 0.272) (define $HandBox3Height 0.2) ; lower arms (define $LowerarmLength 0.445) (define $LowerarmWidth 0.316) (define $LowerarmHeight 0.6) (define $LowerarmMass 0.2) ; elbows (define $ElbowDirection 1) (define $ElbowRadius 0.134) (define $ElbowLength 0.3) ; upper arms (define $UpperarmLength 0.445) (define $UpperarmWidth 0.398) (define $UpperarmHeight 0.506) (define $UpperarmMass 0.2) ; shoulders (define $ShoulderLength 0.445) (define $ShoulderWidth 1.017) (define $ShoulderHeight 0.536) (define $ShoulderMass 0.5) ; head (define $HeadRadius 0.39) (define $HeadMass 0.00000001) ; neck (define $NeckLength 0.2) (define $NeckWidth 0.2) (define $NeckHeight 0.4) (define $NeckMass 0.1) ; torso1 (define $TorsoBox1Length 1.37) (define $TorsoBox1Width 0.96) (define $TorsoBox1Height 1.41) (define $TorsoBox1Mass 1.8) ; torso2 (define $TorsoBox2Length 1.37) (define $TorsoBox2Width 0.54) (define $TorsoBox2Height 1.81) (define $TorsoBox2Mass 1.8) (define $TorsoCylinderDirection 1) ; oriented along x-axis (define $TorsoCylinderRadius 0.1) (define $TorsoCylinderLength 0.3) ; ; assemble the robot ; ; torso position (absolute) (define $TorsoPosX 5) (define $TorsoPosY 5) (define $TorsoPosZ 3.5) ; calculate offset of the battery pack (define $offsetTorsoBox2X 0.0) (define $offsetTorsoBox2Y (eval -1 * (eval (eval $TorsoBox1Width / 2.0) + (eval $TorsoBox2Width / 2.0)))) (define $offsetTorsoBox2Z (eval -1 * (eval (eval $TorsoBox1Height / 2.0) - (eval $TorsoBox2Height / 2.0)))) ; calculate offset for the left shoulder cylinder (define $offsetLeftShoulderCylX (eval -1 * (eval $TorsoBox1Length / 2.0))) (define $offsetLeftShoulderCylY 0.0) (define $offsetLeftShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; calculate offset for the right shoulder cylinder (define $offsetRightShoulderCylX (eval $TorsoBox1Length / 2.0)) (define $offsetRightShoulderCylY 0.0) (define $offsetRightShoulderCylZ (eval (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0))) ; create the torso (node AgentAspect (setName body) (setLocalPos $TorsoPosX $TorsoPosY $TorsoPosZ) (importScene rsg/boxspheres/box.rsg $TorsoBox1Length $TorsoBox1Width $TorsoBox1Height $TorsoBox1Mass matGrey) ; install a node holding agent state data (node AgentState (setName AgentState) ) ;add a time perceptor (node TimePerceptor) (node VisionPerceptor (setSenseMyPos false) (setStaticSenseAxis false) (addNoise false) ) ; static cylinders for the shoulders (node Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) (node Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) ) ) ;;; ------------------------------------- ;;; HEAD ;;; ------------------------------------- ; attach head (node Transform (setName head) (setLocalPos (eval $TorsoPosX) (eval $TorsoPosY + 0.05) (eval $TorsoPosZ + 0.1 + (eval $TorsoBox1Height / 2.0) + (eval $HeadRadius / 2.0))) (importScene rsg/boxspheres/sphere.rsg $HeadRadius $HeadMass matLightBlue) ; install hinge joint to connect to the neck (node FixedJoint (attach ../sphereBody ../../body/boxBody) (setFixed) ) ) ;;; ------------------------------------- ;;; ARMS ;;; ------------------------------------- (define $LeftShoulderPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 2.0) - (eval $ShoulderLength / 2.0) - (eval $TorsoCylinderLength / 2.0) ) ) (define $LeftShoulderPosY $TorsoPosY) (define $LeftShoulderPosZ (eval $TorsoPosZ + (eval $TorsoBox1Height / 2.0) - (eval $ShoulderHeight / 2.0) ) ) (define $RightShoulderPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 2.0) + (eval $ShoulderLength / 2.0) + (eval $TorsoCylinderLength / 2.0) ) ) (define $RightShoulderPosY $TorsoPosY) (define $RightShoulderPosZ $LeftShoulderPosZ) ; left shoulder (node Transform (setName leftshoulder) (setLocalPos $LeftShoulderPosX $LeftShoulderPosY $LeftShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matRed) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; install a perceptor (node UniversalJointPerceptor (setName larm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName larm_eff_1_2) ) ) ) ; right shoulder (node Transform (setName rightshoulder) (setLocalPos $RightShoulderPosX $RightShoulderPosY $RightShoulderPosZ) (importScene rsg/boxspheres/box.rsg $ShoulderLength $ShoulderWidth $ShoulderHeight $ShoulderMass matRed) (setLocalRotation 0 0 180) ; install universal joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0.0 0.0 0.0) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rarm_joint_1_2) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rarm_eff_1_2) ) ) ) (define $LeftUpperArmPosX $LeftShoulderPosX) ;(define $LeftUpperArmPosY (eval $LeftShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $LeftUpperArmPosY (eval $LeftShoulderPosY)) (define $LeftUpperArmPosZ (eval $LeftShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) (define $RightUpperArmPosX $RightShoulderPosX) ;(define $RightUpperArmPosY (eval $RightShoulderPosY + (eval $UpperarmWidth / 2.0))) (define $RightUpperArmPosY (eval $RightShoulderPosY)) (define $RightUpperArmPosZ (eval $RightShoulderPosZ - (eval $ShoulderHeight / 2.0) - (eval $UpperarmHeight / 2.0))) ; left upper arm (node Transform (setName leftupperarm) (setLocalPos $LeftUpperArmPosX $LeftUpperArmPosY $LeftUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matLightBlue) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../leftshoulder/boxBody) (setAnchor 0.0 0.0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName larm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) ; right upper arm (node Transform (setName rightupperarm) (setLocalPos $RightUpperArmPosX $RightUpperArmPosY $RightUpperArmPosZ) (importScene rsg/boxspheres/box.rsg $UpperarmLength $UpperarmWidth $UpperarmHeight $UpperarmMass matLightBlue) ;(setLocalRotation 180 0 0) ; install hinge joint to connect to the shoulder (node HingeJoint (attach ../boxBody ../../rightshoulder/boxBody) (setAnchor 0 0 (eval $UpperarmHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rarm_joint_3) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_3) ) ) ; static cylinder for the elbow (node Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) (node CCylinder (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) ) ) (define $LeftLowerArmPosX $LeftUpperArmPosX) (define $LeftLowerArmPosY $LeftUpperArmPosY) (define $LeftLowerArmPosZ (eval $LeftUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) (define $RightLowerArmPosX $RightUpperArmPosX) (define $RightLowerArmPosY $RightUpperArmPosY) (define $RightLowerArmPosZ (eval $RightUpperArmPosZ - (eval $UpperarmHeight / 2.0) - $ElbowRadius - (eval $LowerarmHeight / 2.0) ) ) ; left lower arm (node Transform (setName leftlowerarm) (setLocalPos $LeftLowerArmPosX $LeftLowerArmPosY $LeftLowerArmPosZ) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../leftupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName larm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName larm_eff_4) ) ) ; static hand (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ; right lower arm (node Transform (setName rightlowerarm) (setLocalPos $RightLowerArmPosX $RightLowerArmPosY $RightLowerArmPosZ) ;(setLocalRotation 0 0 180) (importScene rsg/boxspheres/box.rsg $LowerarmLength $LowerarmWidth $LowerarmHeight $LowerarmMass matGrey) ; install hinge joint to connect to the upper arm (node HingeJoint (attach ../boxBody ../../rightupperarm/boxBody) (setAnchor 0 0 (eval $LowerarmHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rarm_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rarm_eff_4) ) ) ; static hand (node Transform (setLocalRotation 0 0 180) (node Transform (setLocalPos (eval -1 * (eval (eval $LowerarmLength / 2.0) - (eval $HandBox1Length / 2.0) - 0.06)) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox1Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox1Length $HandBox1Width $HandBox1Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox2Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + (eval $HandBox2Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox2Length $HandBox2Width $HandBox2Height) ) ) (node Transform (setLocalPos (eval (eval $LowerarmLength / 2.0) - (eval $HandBox3Length / 2.0) - 0.06) 0.0 (eval -1 * (eval (eval $LowerarmHeight / 2.0) + $HandBox2Height + (eval $HandBox3Height / 2.0))) ) (node Box (setMaterial matGrey) (setExtents $HandBox3Length $HandBox3Width $HandBox3Width) ) ) ) ) ;;; ------------------------------------- ;;; LEGS ;;; ------------------------------------- (define $LeftHipPosX (eval $TorsoPosX - (eval $TorsoBox1Length / 4.0) - 0.06)) (define $LeftHipPosY $TorsoPosY) (define $LeftHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) (define $RightHipPosX (eval $TorsoPosX + (eval $TorsoBox1Length / 4.0) + 0.06)) (define $RightHipPosY $TorsoPosY) (define $RightHipPosZ (eval $TorsoPosZ - (eval $TorsoBox1Height / 2.0) - (eval $HipHeight / 2.0))) ; left hip (node Transform (setName lefthip) (setLocalPos $LeftHipPosX $LeftHipPosY $LeftHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName lleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_1) ) ) ) ; right hip (node Transform (setName righthip) (setLocalPos $RightHipPosX $RightHipPosY $RightHipPosZ) (importScene rsg/boxspheres/box.rsg $HipLength $HipWidth $HipHeight $HipMass matGrey) ; install hinge joint to connect to the torso (node HingeJoint (attach ../boxBody ../../body/boxBody) (setAnchor 0 0 (eval $HipHeight / 2.0)) (setAxis 2) ; move around z-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rleg_joint_1) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_1) ) ) ) (define $LeftThighPosX $LeftHipPosX) (define $LeftThighPosY $LeftHipPosY) (define $LeftThighPosZ (eval $LeftHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) (define $RightThighPosX $RightHipPosX) (define $RightThighPosY $RightHipPosY) (define $RightThighPosZ (eval $RightHipPosZ - (eval $HipHeight / 2.0) - (eval $ThighHeight / 2.0))) ; left thigh (node Transform (setName leftthigh) (setLocalPos $LeftThighPosX $LeftThighPosY $LeftThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../lefthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_2_3) ) ) ) ; right thigh (node Transform (setName rightthigh) (setLocalPos $RightThighPosX $RightThighPosY $RightThighPosZ) (importScene rsg/boxspheres/box.rsg $ThighLength $ThighWidth $ThighHeight $ThighMass matGrey) ; install hinge joint to connect to the torso (node UniversalJoint (attach ../boxBody ../../righthip/boxBody) (setAnchor 0.0 0.0 (eval $ThighHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_2_3) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_2_3) ) ) ) (define $LeftShankPosX $LeftThighPosX) (define $LeftShankPosY $LeftThighPosY) (define $LeftShankPosZ (eval $LeftThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) (define $RightShankPosX $RightThighPosX) (define $RightShankPosY $RightThighPosY) (define $RightShankPosZ (eval $RightThighPosZ - (eval $ThighHeight / 2.0) - (eval $ShankHeight / 2.0) - 0.05)) ; left shank (node Transform (setName leftshank) (setLocalPos $LeftShankPosX $LeftShankPosY $LeftShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../leftthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName lleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName lleg_eff_4) ) ) ) ; right shank (node Transform (setName rightshank) (setLocalPos $RightShankPosX $RightShankPosY $RightShankPosZ) (importScene rsg/boxspheres/box.rsg $ShankLength $ShankWidth $ShankHeight $ShankMass matGrey) ; install hinge joint to connect to the thigh (node HingeJoint (attach ../boxBody ../../rightthigh/boxBody) (setAnchor 0.0 0.0 (eval $ShankHeight / 2.0)) (setAxis 0) ; move around x-axis ; enable the joint motors (setMaxMotorForce 0 100) ; ; install a perceptor (node HingePerceptor (setName rleg_joint_4) ) ; install an effector to control the joint motors (node HingeEffector (setName rleg_eff_4) ) ) ) ; left foot (node Transform (setName leftfoot) (setLocalPos $LeftShankPosX $LeftShankPosY (eval $LeftShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../leftshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName lleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName lleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ; right foot (node Transform (setName rightfoot) (setLocalPos $RightShankPosX $RightShankPosY (eval $RightShankPosZ - (eval $ShankHeight / 2.0) - (eval $FootHeight / 2.0) - 0.05) ) (importScene rsg/boxspheres/box.rsg $FootLength $FootWidth $FootHeight $FootMass matGrey) ; install hinge joint to connect to the shank (node UniversalJoint (attach ../boxBody ../../rightshank/boxBody) (setAnchor 0.0 0.0 (eval $FootHeight / 2.0)) (setAxis1 1.0 0.0 0.0) ; move around the x-axis (setAxis2 0.0 1.0 0.0) ; move around the y-axis ; enable the joint motors (setMaxMotorForce 0 100) (setMaxMotorForce 1 100) ; ; install a perceptor (node UniversalJointPerceptor (setName rleg_joint_5_6) ) ; install an effector to control the joint motors (node UniversalJointEffector (setName rleg_eff_5_6) ) ) ; static box at the back of the foot (node Transform (setLocalPos 0.0 (eval -1 * (eval (eval $FootWidth / 2.0) - (eval $AnkleBoxWidth / 2.0))) (eval (eval $FootHeight / 2.0) + (eval $AnkleBoxHeight / 2.0)) ) (node Box (setMaterial matGrey) (setExtents $AnkleBoxLength $AnkleBoxWidth $AnkleBoxHeight) ) ) ) ) ; EOF |
From: Markus R. <rol...@us...> - 2007-02-23 22:25:55
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27848 Modified Files: Tag: WIN32 rsgedit.vcproj rsgedit.wxg Log Message: - add agentframe to project Index: rsgedit.vcproj =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/rsgedit.vcproj,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** rsgedit.vcproj 21 Feb 2007 20:11:34 -0000 1.1.2.7 --- rsgedit.vcproj 23 Feb 2007 22:25:48 -0000 1.1.2.8 *************** *** 184,187 **** --- 184,195 ---- </File> <File + RelativePath=".\agentframe.cpp" + > + </File> + <File + RelativePath=".\agentframe.h" + > + </File> + <File RelativePath=".\constants.cpp" > Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -C2 -d -r1.4.2.4 -r1.4.2.5 *** rsgedit.wxg 18 Feb 2007 14:25:17 -0000 1.4.2.4 --- rsgedit.wxg 23 Feb 2007 22:25:48 -0000 1.4.2.5 *************** *** 1,4 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Sun Feb 18 15:24:05 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> --- 1,4 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Feb 23 23:25:00 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> *************** *** 17,20 **** --- 17,24 ---- </item> <item> + <label>Start &Agent</label> + <id>ID_AGENT_OPEN</id> + </item> + <item> <label>&Reload</label> <id>ID_FILE_RELOAD</id> *************** *** 174,178 **** </object> <object class="propertyframe" name="Properties" base="EditFrame"> ! <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> <title>frame_1</title> <size>300, 150</size> --- 178,182 ---- </object> <object class="propertyframe" name="Properties" base="EditFrame"> ! <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> <title>frame_1</title> <size>300, 150</size> *************** *** 223,225 **** --- 227,245 ---- </object> </object> + <object class="agentframe" name="frame_1" base="EditFrame"> + <style>wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> + <title>frame_1</title> + <size>500, 200</size> + <object class="wxBoxSizer" name="sizer_10" base="EditBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <flag>wxEXPAND|wxADJUST_MINSIZE</flag> + <border>0</border> + <option>1</option> + <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> + <style>wxTE_MULTILINE|wxTE_READONLY</style> + </object> + </object> + </object> + </object> </application> |
From: Markus R. <rol...@us...> - 2007-02-23 22:23:40
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26899 Added Files: Tag: WIN32 xpm_stop.xpm Log Message: - add a stop/kill icon --- NEW FILE: xpm_stop.xpm --- /* XPM */ static char *xpm_stop[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c gray100", ". c black", /* pixels */ " ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ............. ", " ", " " }; |
From: Markus R. <rol...@us...> - 2007-02-23 22:23:21
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26837 Added Files: Tag: WIN32 xpm_agent.xpm Log Message: - add an agent icon --- NEW FILE: xpm_agent.xpm --- /* XPM */ static char *xpm_agent[] = { /* columns rows colors chars-per-pixel */ "20 20 108 2", "< c Black", "X c #CACACA", "L c #0F0F0F", "> c #D9D9D9", "@. c #1E1E1E", "' c #E8E8E8", "v c #5A5A5A", "s c #878787", "} c #080808", ". c #D2D2D2", "F c #171717", "3 c #353535", " c None", "=. c #9E9E9E", "c c #010101", "Q c #CBCBCB", ":. c #101010", "N c #1F1F1F", "_ c #2E2E2E", "* c #3D3D3D", "e c #888888", "#. c #979797", "y c #090909", "6 c #181818", "Z c #E2E2E2", "d c #818181", "- c #9F9F9F", "C c #AEAEAE", "t c #020202", "@ c #CCCCCC", "^ c #111111", "# c #DBDBDB", "r c #202020", "! c #EAEAEA", "U c #2F2F2F", "+. c #4D4D4D", "a c #6B6B6B", "w c #7A7A7A", "g c #A7A7A7", "7 c #0A0A0A", "-. c #D4D4D4", "J c #191919", "K c #282828", "R c #555555", "8 c #A0A0A0", "4 c #AFAFAF", "i c #030303", "O c #CDCDCD", "j c #121212", "o c #DCDCDC", "/ c #212121", "h c #5D5D5D", "%. c #7B7B7B", "& c #999999", "( c #0B0B0B", ") c #1A1A1A", "1 c #292929", "V c #747474", ";. c #838383", "B c #040404", "x c #131313", "$. c #DDDDDD", "5 c #222222", "G c #4F4F4F", ": c #6D6D6D", "X. c #7C7C7C", "` c #9A9A9A", "z c #0C0C0C", " . c #D6D6D6", "{ c #1B1B1B", "I c #2A2A2A", "; c #393939", "W c #484848", "M c #A2A2A2", "b c #B1B1B1", "u c #050505", ".. c #DEDEDE", "A c #5F5F5F", "o. c #6E6E6E", "*. c #8C8C8C", "T c #B9B9B9", "[ c #0D0D0D", "] c #D7D7D7", "k c #1C1C1C", "P c #2B2B2B", "H c #676767", "S c #060606", "m c #D0D0D0", "E c #151515", "n c #DFDFDF", "p c #242424", ", c #424242", "q c #0E0E0E", "+ c #D8D8D8", "~ c #1D1D1D", "0 c #2C2C2C", "= c #C2C2C2", "l c #070707", "$ c #D1D1D1", "% c #E0E0E0", "D c #252525", "2 c #343434", "Y c #434343", "&. c #525252", "f c #616161", "9 c #9D9D9D", "| c #ACACAC", "O. c #BBBBBB", /* pixels */ " . X o O + @ # $ ", " % & * = - ; : > ", " @ , < 1 2 < 3 # ", " 4 5 6 < 7 < < 8 ", " 9 0 7 < < q < w ", " e r t y u i < p a s d f g ", " h j k q l < z t < x c v b ", " n m M N q 7 i < u B < x V C ", " Z A B 7 < < c S D F < G ", " H J K y c < L P I U I Y ", " T O = R < E l I r N N W ", " Q ! X ~ < ^ 5 K / ( k - ", " m V 7 J ) L < z i S _ ` ", " ' ] D [ i { < } E < < { | ", " ...X.u < i < c l < < o. ", " ..O.+.( < u ( < l l u @.#. ", " $.%.( i B B B u B i i < k &. ", " .%.6 < < < < < < < < < 7 [ p *.", " =.f p B t l S u u S S u B x } y A ", "-.;.N c x { F L x :.q q :.:.L [ :.[ ^ h " }; |
From: Markus R. <rol...@us...> - 2007-02-23 22:22:59
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26451 Added Files: Tag: WIN32 agentframe.cpp agentframe.h Log Message: - added a console window to view stdout and stderr of a running agent. The window contains buttons to automatically kill and restart an agent --- NEW FILE: agentframe.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: agentframe.h,v 1.1.2.1 2007/02/23 22:22:50 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ // -*- C++ -*- generated by wxGlade 0.4.1 on Fri Feb 23 21:06:30 2007 #include <wx/wx.h> #include <wx/image.h> #include <wx/process.h> #ifndef AGENTFRAME_H #define AGENTFRAME_H // begin wxGlade: ::dependencies // end wxGlade class agentframe: public wxFrame { public: // begin wxGlade: agentframe::ids // end wxGlade agentframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE); virtual ~agentframe(); void KillAgent(); bool StartAgent(const wxString& cmd); void OnUpdateAgentStart(wxUpdateUIEvent& event); void OnAgentStart(wxCommandEvent& /*event*/); void OnUpdateAgentKill(wxUpdateUIEvent& event); void OnAgentKill(wxCommandEvent& /*event*/); private: // begin wxGlade: agentframe::methods void set_properties(); void do_layout(); // end wxGlade void Output(const wxString& str); void Output(wxInputStream* istream); void OnLogTimer(wxTimerEvent& event); void OnClose(wxCloseEvent& event); void OnEndProcess(wxProcessEvent& event); bool StartAgent(); protected: // begin wxGlade: agentframe::attributes wxTextCtrl* mCtrLog; // end wxGlade wxTimer mTimer; wxProcess *mProcess; int mPid; wxString mCmd; wxToolBar* mToolBar; DECLARE_EVENT_TABLE() }; // wxGlade: end class #endif // AGENTFRAME_H --- NEW FILE: agentframe.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: agentframe.cpp,v 1.1.2.1 2007/02/23 22:22:50 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ // -*- C++ -*- generated by wxGlade 0.4.1 on Fri Feb 23 21:06:30 2007 #include "agentframe.h" #include "constants.h" #include <wx/filename.h> #include <rsgedit/res/xpm_play.xpm> #include <rsgedit/res/xpm_stop.xpm> //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro #undef DECLARE_CLASS BEGIN_EVENT_TABLE(agentframe, wxFrame) EVT_TIMER(1, agentframe::OnLogTimer) EVT_CLOSE(agentframe::OnClose) EVT_END_PROCESS(1, agentframe::OnEndProcess) EVT_UPDATE_UI(ID_AGENT_START, agentframe::OnUpdateAgentStart) EVT_MENU(ID_AGENT_START, agentframe::OnAgentStart) EVT_UPDATE_UI(ID_AGENT_KILL, agentframe::OnUpdateAgentKill) EVT_MENU(ID_AGENT_KILL, agentframe::OnAgentKill) END_EVENT_TABLE() agentframe::agentframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN), mTimer(this,1),mProcess(0),mPid(0) { mToolBar = 0; // begin wxGlade: agentframe::agentframe mCtrLog = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); set_properties(); do_layout(); // end wxGlade // create toolbar mToolBar = CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY ); mToolBar->AddTool(ID_AGENT_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_AGENT_KILL, wxT("Kill"), wxBitmap(xpm_stop)); mToolBar->Realize(); SetToolBar(mToolBar); } agentframe::~agentframe() { KillAgent(); } void agentframe::set_properties() { // begin wxGlade: agentframe::set_properties SetTitle(wxT("frame_1")); SetSize(wxSize(500, 200)); // end wxGlade } void agentframe::do_layout() { // begin wxGlade: agentframe::do_layout wxBoxSizer* sizer_10 = new wxBoxSizer(wxVERTICAL); sizer_10->Add(mCtrLog, 1, wxEXPAND|wxADJUST_MINSIZE, 0); SetAutoLayout(true); SetSizer(sizer_10); Layout(); // end wxGlade } void agentframe::Output(const wxString& str) { mCtrLog->AppendText(str); } void agentframe::Output(wxInputStream* istream) { if (istream == 0) { return; } while (istream->CanRead()) { static wxChar buffer[4096]; buffer[istream->Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = _T('\0'); Output(buffer); } } void agentframe::KillAgent() { if (mProcess == 0) { return; } Output("(agentframe::KillAgent) killing agent\n"); mProcess->Detach(); wxKillError error = wxProcess::Kill(mPid,wxSIGKILL); switch (error) { case wxKILL_OK: break; case wxKILL_BAD_SIGNAL: Output("(agentframe::KillAgent) no such signal"); break; case wxKILL_ACCESS_DENIED: Output("(agentframe::KillAgent) permission denied"); break; case wxKILL_NO_PROCESS: Output("(agentframe::KillAgent) no such process"); break; case wxKILL_ERROR: Output("(agentframe::KillAgent) error killing process"); break; } mProcess = 0; mPid = 0; mTimer.Stop(); UpdateWindowUI(wxUPDATE_UI_RECURSE); } bool agentframe::StartAgent() { Output("(agentframe::StartAgent) starting agent '" + mCmd + "'\n"); mProcess = new wxProcess(this, 1); mProcess->Redirect(); #ifdef WIN32 // make sure that the working directory is set to the directory where // the executable is wxString cwd = wxGetCwd(); wxSetWorkingDirectory(wxFileName(mCmd).GetPath()); #endif mPid = wxExecute(mCmd, wxEXEC_ASYNC, mProcess); #ifdef WIN32 // restore working directory wxSetWorkingDirectory(cwd); #endif if (mPid == 0) { Output("(agentframe::StartAgent) failed to start '"+mCmd+"' \n"); mProcess = 0; return false; } mTimer.Start(LOGWND_UPDATE_INTERVAL); UpdateWindowUI(wxUPDATE_UI_RECURSE); return true; } bool agentframe::StartAgent(const wxString& cmd) { KillAgent(); mCmd = cmd; return StartAgent(); } void agentframe::OnLogTimer(wxTimerEvent& event) { if (mProcess == 0) { return; } wxInputStream* procIStream = mProcess->GetInputStream(); if (procIStream != 0) { Output(procIStream); } wxInputStream* procEStream = mProcess->GetErrorStream(); if (procEStream != 0) { Output(procEStream); } } void agentframe::OnClose(wxCloseEvent& event) { KillAgent(); event.Skip(); } void agentframe::OnEndProcess(wxProcessEvent& event) { Output("(agentframe::OnEndProcess) agent died"); mTimer.Stop(); mProcess->Detach(); mProcess = 0; } void agentframe::OnUpdateAgentStart(wxUpdateUIEvent& event) { event.Enable(mProcess == 0); } void agentframe::OnAgentStart(wxCommandEvent& /*event*/) { StartAgent(); } void agentframe::OnUpdateAgentKill(wxUpdateUIEvent& event) { event.Enable(mProcess != 0); } void agentframe::OnAgentKill(wxCommandEvent& /*event*/) { KillAgent(); } |
From: Markus R. <rol...@us...> - 2007-02-23 22:21:41
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25921 Modified Files: Tag: WIN32 mainframe.cpp mainframe.h Log Message: - added file seclector for agent spawn Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.7.2.6 retrieving revision 1.7.2.7 diff -C2 -d -r1.7.2.6 -r1.7.2.7 *** mainframe.h 18 Feb 2007 14:25:15 -0000 1.7.2.6 --- mainframe.h 23 Feb 2007 22:21:38 -0000 1.7.2.7 *************** *** 96,99 **** --- 96,101 ---- void OnUpdateFileReload(wxUpdateUIEvent& event); + void OnAgentOpen(wxCommandEvent& event); + void OnHelpAbout(wxCommandEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.8.2.8 retrieving revision 1.8.2.9 diff -C2 -d -r1.8.2.8 -r1.8.2.9 *** mainframe.cpp 21 Feb 2007 20:12:25 -0000 1.8.2.8 --- mainframe.cpp 23 Feb 2007 22:21:38 -0000 1.8.2.9 *************** *** 23,27 **** --- 23,29 ---- #include "main.h" #include "propertyframe.h" + #include "agentframe.h" + #include <wx/filename.h> #include <wx/filedlg.h> *************** *** 30,33 **** --- 32,36 ---- #include <rsgedit/res/xpm_open.xpm> #include <rsgedit/res/xpm_reload.xpm> + #include <rsgedit/res/xpm_agent.xpm> #include "aboutdlg.h" *************** *** 62,65 **** --- 65,70 ---- EVT_UPDATE_UI(ID_FILE_OPEN, mainframe::OnUpdateFileOpen) + EVT_MENU(ID_AGENT_OPEN, mainframe::OnAgentOpen) + EVT_MENU(ID_FILE_RELOAD, mainframe::OnFileReload) EVT_UPDATE_UI(ID_FILE_RELOAD, mainframe::OnUpdateFileReload) *************** *** 80,92 **** using namespace oxygen; - // the default height of the log window pane [pixel] - static const int LOGWND_DEFAULT_HEIGHT = 150; - - // the update interval of the log window [milliseconds} - static const int LOGWND_UPDATE_INTERVAL = 100; - - // the default width of the tree window pane [pixel] - static const int TREEWND_DEFAULT_WIDTH = 270; - mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE), --- 85,88 ---- *************** *** 109,112 **** --- 105,109 ---- wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(ID_FILE_OPEN, wxT("&Open"), wxT(""), wxITEM_NORMAL); + wxglade_tmp_menu_1->Append(ID_AGENT_OPEN, wxT("Start &Agent"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(ID_FILE_RELOAD, wxT("&Reload"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxT(""), wxITEM_NORMAL); *************** *** 139,142 **** --- 136,141 ---- mToolBar->AddTool(ID_FILE_RELOAD, wxT("Reload"), wxBitmap(xpm_reload)); mToolBar->AddSeparator(); + mToolBar->AddTool(ID_AGENT_OPEN, wxT("Start Agent"), wxBitmap(xpm_agent)); + mToolBar->AddSeparator(); mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); *************** *** 684,685 **** --- 683,704 ---- dlg.ShowModal(); } + + void mainframe::OnAgentOpen(wxCommandEvent& event) + { + wxString message = "Choose an agent executable to run"; + wxString default_path = "."; + wxString default_filename = ""; + wxString default_extension = ""; + wxString wildcard = "agent executables (*.exe)|*.exe"; + + wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); + if (filename.empty() ) + { + return; + } + + agentframe* frame(new agentframe(this, wxID_ANY, filename)); + frame->SetTitle(wxFileName(filename).GetName()); + frame->Show(); + frame->StartAgent(filename); + } |
From: Markus R. <rol...@us...> - 2007-02-23 22:20:57
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25329 Modified Files: Tag: WIN32 constants.cpp constants.h Log Message: - moved some constants from mainframe.cpp to constants - added ID_AGENT_OPEN, ID_AGENT_START and ID_AGENT_KILL Index: constants.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/constants.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** constants.h 21 Feb 2007 20:11:33 -0000 1.1.2.5 --- constants.h 23 Feb 2007 22:20:53 -0000 1.1.2.6 *************** *** 41,45 **** ID_FILE_RELOAD = (wxID_HIGHEST+24), ! ID_HELP_ABOUT = (wxID_HIGHEST+25) }; --- 41,49 ---- ID_FILE_RELOAD = (wxID_HIGHEST+24), ! ID_HELP_ABOUT = (wxID_HIGHEST+25), ! ! ID_AGENT_OPEN = (wxID_HIGHEST+26), ! ID_AGENT_START = (wxID_HIGHEST+27), ! ID_AGENT_KILL = (wxID_HIGHEST+28) }; *************** *** 47,49 **** --- 51,62 ---- extern const float SIM_SIMSTEP; + // the default height of the log window pane [pixel] + extern const int LOGWND_DEFAULT_HEIGHT; + + // the update interval of the log window [milliseconds} + extern const int LOGWND_UPDATE_INTERVAL; + + // the default width of the tree window pane [pixel] + extern const int TREEWND_DEFAULT_WIDTH; + #endif // RSGEDIT_CONSTANTS_H Index: constants.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Attic/constants.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** constants.cpp 22 Feb 2007 16:06:01 -0000 1.1.2.2 --- constants.cpp 23 Feb 2007 22:20:53 -0000 1.1.2.3 *************** *** 23,24 **** --- 23,32 ---- const float SIM_SIMSTEP = 0.02f; + // the default height of the log window pane [pixel] + const int LOGWND_DEFAULT_HEIGHT = 150; + + // the update interval of the log window [milliseconds} + const int LOGWND_UPDATE_INTERVAL = 100; + + // the default width of the tree window pane [pixel] + const int TREEWND_DEFAULT_WIDTH = 270; |
From: Markus R. <rol...@us...> - 2007-02-23 22:18:08
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23525 Modified Files: Tag: WIN32 Makefile.am Log Message: - added aboutDlg.cpp and agentframe.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Makefile.am,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** Makefile.am 22 Jan 2006 17:25:23 -0000 1.5 --- Makefile.am 23 Feb 2007 22:18:01 -0000 1.5.2.1 *************** *** 27,31 **** propertylist.cpp\ propertyframe.cpp\ ! property.cpp --- 27,34 ---- propertylist.cpp\ propertyframe.cpp\ ! property.cpp\ ! aboutDlg.cpp\ ! agentframe.cpp ! |
From: Markus R. <rol...@us...> - 2007-02-23 22:17:38
|
Update of /cvsroot/simspark/simspark/contrib/agentspark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23392 Modified Files: Tag: WIN32 main.cpp Log Message: - flush stdout on agent startup and agent stop Index: main.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/agentspark/Attic/main.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** main.cpp 23 Feb 2007 19:58:20 -0000 1.1.2.1 --- main.cpp 23 Feb 2007 22:17:34 -0000 1.1.2.2 *************** *** 84,88 **** bool Init() { ! cout << "connecting to TCP " << gHost << ":" << gPort << "\n"; try --- 84,88 ---- bool Init() { ! cout << "connecting to TCP " << gHost << ":" << gPort << endl; try *************** *** 121,125 **** { gSocket.close(); ! cout << "closed connection to " << gHost << ":" << gPort << "\n"; } --- 121,125 ---- { gSocket.close(); ! cout << "closed connection to " << gHost << ":" << gPort << endl; } |
Update of /cvsroot/simspark/simspark/contrib/agentspark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20113 Added Files: Tag: WIN32 .cvsignore agentspark.vcproj behavior.h hoap2behavior.cpp hoap2behavior.h main.cpp Log Message: - add agentspark with hoap2behavior --- NEW FILE: .cvsignore --- .deps .libs Makefile Makefile.in agentspark --- NEW FILE: agentspark.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="agentspark" ProjectGUID="{A544868D-F263-40AC-BEDF-FFF0660B3E32}" RootNamespace="agentspark" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib rpcrt4.lib msvcrt-ruby18.lib ode.lib wsock32.lib opengl32.lib glu32.lib glaux.lib wxbase28d.lib wxmsw28d_core.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxbase28d_xml.lib wxexpatd.lib wxmsw28d_aui.lib wxmsw28d_gl.lib wxzlibd.lib wxpngd.lib" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\spark\win32;..\..\spark;..\..\spark\utility;..\" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="comctl32.lib rpcrt4.lib wsock32.lib opengl32.lib glu32.lib glaux.lib c:\ruby\lib\msvcrt-ruby18.lib ode.lib wxbase28.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib wxjpeg.lib wxmsw28_adv.lib wxmsw28_aui.lib wxmsw28_core.lib wxmsw28_gl.lib wxmsw28_html.lib wxmsw28_media.lib wxmsw28_qa.lib wxmsw28_richtext.lib wxmsw28_xrc.lib wxpng.lib wxregex.lib wxtiff.lib wxzlib.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\behavior.h" > </File> <File RelativePath=".\hoap2behavior.cpp" > </File> <File RelativePath=".\hoap2behavior.h" > </File> <File RelativePath=".\main.cpp" > </File> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: main.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: main.cpp,v 1.1.2.1 2007/02/23 19:58:20 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <string> #include <iostream> #include <boost/scoped_ptr.hpp> #include <rcssnet/tcpsocket.hpp> #include <rcssnet/exception.hpp> #include "behavior.h" #ifdef __linux__ #include <netinet/in.h> #endif #include "hoap2behavior.h" using namespace rcss::net; using namespace std; using namespace boost; TCPSocket gSocket; string gHost = "127.0.0.1"; int gPort = 3100; void PrintGreeting() { cout << "agentspark, a spark demo agent\n" << "Copyright (C) 2004 Koblenz University.\n" << "2004 RoboCup Soccer Server 3D Maintenance Group.\n\n"; } void PrintHelp() { cout << "\nusage: agentspark [options]" << endl; cout << "\noptions:" << endl; cout << " --help prints this message." << endl; cout << " --host=IP IP of the server." << endl; cout << "\n"; } void ReadOptions(int argc, char* argv[]) { for( int i = 0; i < argc; i++) { if ( strcmp( argv[i], "--help" ) == 0 ) { PrintHelp(); exit(0); } else if ( strncmp( argv[i], "--host", 6 ) == 0 ) { string tmp=argv[i]; if ( tmp.length() <= 7 ) // minimal sanity check { PrintHelp(); exit(0); } gHost = tmp.substr(7); } } } bool Init() { cout << "connecting to TCP " << gHost << ":" << gPort << "\n"; try { Addr local(INADDR_ANY,INADDR_ANY); gSocket.bind(local); } catch (BindErr error) { cerr << "failed to bind socket with '" << error.what() << "'" << endl; gSocket.close(); return false; } try { Addr server(gPort,gHost); gSocket.connect(server); } catch (ConnectErr error) { cerr << "connection failed with: '" << error.what() << "'" << endl; gSocket.close(); return false; } return true; } void Done() { gSocket.close(); cout << "closed connection to " << gHost << ":" << gPort << "\n"; } bool SelectInput() { fd_set readfds; FD_ZERO(&readfds); FD_SET(gSocket.getFD(),&readfds); #ifdef WIN32 int maxFd = 0; #else int maxFd = gSocket.getFD()+1; #endif return select(maxFd,&readfds, 0, 0, 0) > 0; } void PutMessage(const string& msg) { if (msg.empty()) { return; } // prefix the message with it's payload length unsigned int len = static_cast<unsigned int>(htonl(msg.size())); gSocket.send((const char*)&len, sizeof(unsigned int)); gSocket.send(msg.data(), msg.size()); } bool GetMessage(string& msg) { // try to read the first message segment if (! SelectInput()) { return false; } static char buffer[16 * 1024]; int bytesRead = gSocket.recv(buffer, sizeof(buffer)); //cerr << "buffer = |" << string(buffer+1) << "|\n"; //cerr << "bytesRead = |" << bytesRead << "|\n"; //cerr << "Size of buffer = |" << sizeof(buffer) << "|\n"; //cerr << "buffer = |" << buffer << "|\n"; //cerr << "buffer[5] = |" << buffer[5] << "|\n"; //printf ("xxx-%s\n", buffer+5); if (bytesRead < sizeof(unsigned int)) { return false; } // msg is prefixed with it's total length unsigned int msgLen = ntohl(*(unsigned int*)buffer); //cerr << "GM 6 / " << msgLen << "\n"; // read remaining message segments unsigned int msgRead = bytesRead - sizeof(unsigned int); //cerr << "msgRead = |" << msgRead << "|\n"; char *offset = buffer + bytesRead; while (msgRead < msgLen) { if (! SelectInput()) { return false; } msgRead += gSocket.recv(offset, sizeof(buffer) - msgRead); //cerr << "msgRead = |" << msgRead << "|\n"; offset += msgRead; } // zero terminate received data (*offset) = 0; msg = string(buffer+sizeof(unsigned int)); //cerr << msg << endl; return true; } void Run() { scoped_ptr<Behavior> behavior(new Hoap2Behavior()); PutMessage(behavior->Init()); string msg; while (GetMessage(msg)) { PutMessage(behavior->Think(msg)); } } int main(int argc, char* argv[]) { PrintGreeting(); ReadOptions(argc,argv); if (! Init()) { return 1; } Run(); Done(); } --- NEW FILE: hoap2behavior.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Nov 8 2005 Copyright (C) 2005 Koblenz University 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 "hoap2behavior.h" #include <iostream> #include <sstream> #include <cmath> using namespace oxygen; using namespace zeitgeist; using namespace std; using namespace boost; using namespace salt; Hoap2Behavior::Hoap2Behavior() : mZG("." PACKAGE_NAME) { } void Hoap2Behavior::SetupJointIDMap() { mJointIDMap.clear(); mJointIDMap["head_joint_2"] = JID_HEAD_2; mJointIDMap["head_joint_1"] = JID_HEAD_1; mJointIDMap["lleg_joint_1"] = JID_LLEG_1; mJointIDMap["rleg_joint_1"] = JID_RLEG_1; mJointIDMap["lleg_joint_2_3"] = JID_LLEG_2_3; mJointIDMap["rleg_joint_2_3"] = JID_RLEG_2_3; mJointIDMap["lleg_joint_4"] = JID_LLEG_4; mJointIDMap["rleg_joint_4"] = JID_RLEG_4; mJointIDMap["lleg_joint_5_6"] = JID_LLEG_5_6; mJointIDMap["rleg_joint_5_6"] = JID_RLEG_5_6; mJointIDMap["larm_joint_1_2"] = JID_LARM_1_2; mJointIDMap["rarm_joint_1_2"] = JID_RARM_1_2; mJointIDMap["larm_joint_3"] = JID_LARM_3; mJointIDMap["rarm_joint_3"] = JID_RARM_3; mJointIDMap["larm_joint_4"] = JID_LARM_4; mJointIDMap["rarm_joint_4"] = JID_RARM_4; mJointIDMap["larm_joint_5"] = JID_LARM_5; mJointIDMap["rarm_joint_5"] = JID_RARM_5; } string Hoap2Behavior::Init() { mZG.GetCore()->ImportBundle("sexpparser"); mParser = shared_static_cast<BaseParser> (mZG.GetCore()->New("SexpParser")); if (mParser.get() == 0) { cerr << "unable to create SexpParser instance." << endl; } SetupJointIDMap(); // use the scene effector to build the agent and beam to a // position near the center of the playing field return "(scene rsg/agent/hoap2.rsg)"; } void Hoap2Behavior::ParseHingeJointInfo(const oxygen::Predicate& predicate) { //cout << "(Hoap2Behavior) parsing HJ info" << endl; // read the object name string name; Predicate::Iterator iter(predicate); if (! predicate.GetValue(iter, "name", name)) { return; } // try to lookup the joint id TJointIDMap::iterator idIter = mJointIDMap.find(name); if (idIter == mJointIDMap.end()) { cerr << "(Hoap2Behavior) unknown joint id!" << endl; return; } JointID jid = (*idIter).second; // read the angle value HingeJointSense sense; if (! predicate.GetValue(iter,"axis", sense.angle)) { return; } // update the map mHingeJointSenseMap[jid] = sense; } void Hoap2Behavior::ParseUniversalJointInfo(const oxygen::Predicate& predicate) { // read the object name string name; Predicate::Iterator iter(predicate); if (! predicate.GetValue(iter, "name", name)) { return; } // try to lookup the joint id TJointIDMap::iterator idIter = mJointIDMap.find(name); if (idIter == mJointIDMap.end()) { cerr << "(Hoap2Behavior) unknown joint id!" << endl; return; } JointID jid = (*idIter).second; // record the angle and rate values UniversalJointSense sense; // try to read axis1 angle if (! predicate.GetValue(iter,"axis1", sense.angle1)) { cerr << "(Hoap2Behavior) could not parse universal joint angle1!" << endl; return; } // try to read axis1 rate if (! predicate.GetValue(iter,"rate1", sense.rate1)) { cerr << "(Hoap2Behavior) could not parse universal joint rate1!" << endl; return; } // try to read axis2 angle if (! predicate.GetValue(iter,"axis2", sense.angle2)) { cerr << "(Hoap2Behavior) could not parse universal joint angle2!" << endl; return; } // try to read axis2 rate if (! predicate.GetValue(iter,"rate2", sense.rate2)) { cerr << "(Hoap2Behavior) could not parse universal joint rate2!" << endl; return; } //cout << "(ParseUniversalJointInfo) got angles " << sense.angle1 // << " and " << sense.angle2 << endl; // update the map mUniversalJointSenseMap[jid] = sense; } string Hoap2Behavior::Think(const std::string& message) { //sleep(1); static const float gain = 0.1f; static BehaviorState state = ARM_UP; // parse message and extract joint angles //cout << "(Hoap2Behavior) received message " << message << endl; shared_ptr<PredicateList> predList = mParser->Parse(message); if (predList.get() != 0) { PredicateList& list = *predList; for ( PredicateList::TList::const_iterator iter = list.begin(); iter != list.end(); ++iter ) { const Predicate& predicate = (*iter); // check for a joint percept switch(predicate.name[0]) { case 'H': // hinge joint (HJ) ParseHingeJointInfo(predicate); break; case 'U': // universal joint (UJ) ParseUniversalJointInfo(predicate); break; default: break; } } } float curAngle = 0; float newAngle = 0; // string stream for the server commands stringstream ss(""); // curAngle = mUniversalJointSenseMap[JID_LLEG_5_6].angle1; // if (curAngle < 40.0) // { // newAngle = gain * (40.0 - curAngle); // ss << "(lleg_eff_5_6 0.0 " << newAngle << ")"; // } #if 1 switch(state) { case ARM_UP: curAngle = mUniversalJointSenseMap[JID_RARM_1_2].angle2; if (curAngle < 90.0) { newAngle = gain * (90.0f - curAngle); ss << "(rarm_eff_1_2 0.0 " << newAngle << ")"; } else { state = ARM_ROTATE; } break; case ARM_ROTATE: curAngle = mHingeJointSenseMap[JID_RARM_3].angle; if (curAngle > -90.0f) { newAngle = gain * (-90.0f - curAngle); ss << "(rarm_eff_3 " << newAngle << ")"; } else { state = ARM_WAVE_1; } break; case ARM_WAVE_1: curAngle = mHingeJointSenseMap[JID_RARM_4].angle; if (curAngle < 90.0) { newAngle = gain * (90.0f - curAngle); ss << "(rarm_eff_4 " << newAngle << ")"; } else { state = ARM_WAVE_2; } break; case ARM_WAVE_2: curAngle = mHingeJointSenseMap[JID_RARM_4].angle; if (curAngle > 60.0 || curAngle <= 59.5) { newAngle = gain * (60.0f - curAngle); ss << "(rarm_eff_4 " << newAngle << ")"; } else { state = ARM_WAVE_1; } break; default: break; } #endif // cout << "+++" << endl; // cout << "current angle: " << curAngle << endl; // cout << "desired angle: " << newAngle << endl; // cout << "(Behavior) sending string " << ss.str() << " to server" << endl; // cout << "State is " << state << endl; // cout << "---" << endl; return ss.str(); //return string(""); } --- NEW FILE: hoap2behavior.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Thu Mar 27 2006 Copyright (C) 2006 RoboCup Simulation League Maintenance Committee 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 HOAP2BEHAVIOR_H #define HOAP2BEHAVIOR_H #include "behavior.h" #include <oxygen/gamecontrolserver/baseparser.h> #include <oxygen/gamecontrolserver/predicate.h> #include <zeitgeist/zeitgeist.h> class Hoap2Behavior : public Behavior { public: struct HingeJointSense { /** joint angle */ float angle; /** joint angle rate */ float rate; HingeJointSense() : angle(0), rate(0) {}; }; struct UniversalJointSense { /** joint angle axis 1*/ float angle1; /** joint angle axis 2*/ float angle2; /** joint angle rate axis 1*/ float rate1; /** joint angle rate axis 2*/ float rate2; UniversalJointSense() : angle1(0), angle2(0), rate1(0), rate2(0) {}; }; enum JointID { JID_HEAD_1 = 0, JID_HEAD_2 = 1, JID_LLEG_1 = 2, JID_RLEG_1 = 3, JID_LLEG_2_3 = 4, JID_RLEG_2_3 = 5, JID_LLEG_4 = 6, JID_RLEG_4 = 7, JID_LLEG_5_6 = 8, JID_RLEG_5_6 = 9, JID_LARM_1_2 = 10, JID_RARM_1_2 = 11, JID_LARM_3 = 12, JID_RARM_3 = 13, JID_LARM_4 = 14, JID_RARM_4 = 15, JID_LARM_5 = 16, JID_RARM_5 = 17 }; enum BehaviorState { ARM_UP = 0, ARM_ROTATE = 1, ARM_WAVE_1 = 2, ARM_WAVE_2 = 3 }; public: Hoap2Behavior(); virtual std::string Init(); virtual std::string Think(const std::string& message); protected: void SetupJointIDMap(); void ParseHingeJointInfo(const oxygen::Predicate& predicate); void ParseUniversalJointInfo(const oxygen::Predicate& predicate); protected: zeitgeist::Zeitgeist mZG; boost::shared_ptr<oxygen::BaseParser> mParser; // mapping from joint id to joint hinge sense object typedef std::map<JointID, HingeJointSense> THingeJointSenseMap; THingeJointSenseMap mHingeJointSenseMap; // mapping from joint id to joint hinge sense object typedef std::map<JointID, UniversalJointSense> TUniversalJointSenseMap; TUniversalJointSenseMap mUniversalJointSenseMap; // mapping from object name to joint id typedef std::map<std::string, JointID> TJointIDMap; TJointIDMap mJointIDMap; }; #endif // HOAP2BEHAVIOR_H --- NEW FILE: behavior.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: behavior.h,v 1.1.2.1 2007/02/23 19:58:20 rollmark Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef BEHAVIOR_H #define BEHAVIOR_H #include <string> class Behavior { public: /** called once when the initially connected to the server */ virtual std::string Init() = 0; /** called for every message received from the server; should return an action string */ virtual std::string Think(const std::string& message) = 0; }; #endif // BEHAVIOR_H |
From: Markus R. <rol...@us...> - 2007-02-23 19:57:28
|
Update of /cvsroot/simspark/simspark/contrib/agentspark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19693/agentspark Log Message: Directory /cvsroot/simspark/simspark/contrib/agentspark added to the repository --> Using per-directory sticky tag `WIN32' |
From: Markus R. <rol...@us...> - 2007-02-23 19:28:25
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7940 Modified Files: Tag: WIN32 simspark.sln Log Message: - added sceneffector plugin Index: simspark.sln =================================================================== RCS file: /cvsroot/simspark/simspark/spark/Attic/simspark.sln,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** simspark.sln 18 Feb 2007 12:06:36 -0000 1.1.2.6 --- simspark.sln 23 Feb 2007 19:28:20 -0000 1.1.2.7 *************** *** 10,19 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "coretest", "test\coretest\coretest.vcproj", "{FC4C3571-034B-4CB5-9CF3-3411205C9433}" ProjectSection(ProjectDependencies) = postProject - {ABCC65CE-0762-42F2-8459-41722DCF02D9} = {ABCC65CE-0762-42F2-8459-41722DCF02D9} - {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} - {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} - {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} - {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject --- 10,19 ---- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "coretest", "test\coretest\coretest.vcproj", "{FC4C3571-034B-4CB5-9CF3-3411205C9433}" ProjectSection(ProjectDependencies) = postProject {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} + {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {ABCC65CE-0762-42F2-8459-41722DCF02D9} = {ABCC65CE-0762-42F2-8459-41722DCF02D9} EndProjectSection EndProject *************** *** 35,48 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filesystemstd", "plugin\filesystemstd\filesystemstd.vcproj", "{4A4E1738-60BC-4BB4-AFC8-92320D769D90}" ProjectSection(ProjectDependencies) = postProject - {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sexpparser", "plugin\sexpparser\sexpparser.vcproj", "{949142E4-5E9B-4C5F-9BD9-2EF9DA5CCCA6}" ProjectSection(ProjectDependencies) = postProject - {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} - {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} - {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} EndProjectSection EndProject --- 35,48 ---- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filesystemstd", "plugin\filesystemstd\filesystemstd.vcproj", "{4A4E1738-60BC-4BB4-AFC8-92320D769D90}" ProjectSection(ProjectDependencies) = postProject {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sexpparser", "plugin\sexpparser\sexpparser.vcproj", "{949142E4-5E9B-4C5F-9BD9-2EF9DA5CCCA6}" ProjectSection(ProjectDependencies) = postProject {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject *************** *** 51,65 **** Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugin", "plugin", "{A1E81A09-EF57-41FE-AA50-05FF6B1597FC}" EndProject - Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rsgedit", "rsgedit", "{1A100CE2-0121-4595-AF1F-A15CE8B09D30}" - EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rsgedit", "..\contrib\rsgedit\rsgedit.vcproj", "{38B680B0-B535-40F0-B5DB-FC307C40C7D6}" ProjectSection(ProjectDependencies) = postProject - {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} - {87C2BFBA-8299-432F-B2E6-08E650E74230} = {87C2BFBA-8299-432F-B2E6-08E650E74230} - {ABCC65CE-0762-42F2-8459-41722DCF02D9} = {ABCC65CE-0762-42F2-8459-41722DCF02D9} - {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} - {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} - {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} EndProjectSection EndProject --- 51,63 ---- Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugin", "plugin", "{A1E81A09-EF57-41FE-AA50-05FF6B1597FC}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rsgedit", "..\contrib\rsgedit\rsgedit.vcproj", "{38B680B0-B535-40F0-B5DB-FC307C40C7D6}" ProjectSection(ProjectDependencies) = postProject {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} + {ABCC65CE-0762-42F2-8459-41722DCF02D9} = {ABCC65CE-0762-42F2-8459-41722DCF02D9} + {87C2BFBA-8299-432F-B2E6-08E650E74230} = {87C2BFBA-8299-432F-B2E6-08E650E74230} + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject *************** *** 68,80 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rubysceneimporter", "plugin\rubysceneimporter\rubysceneimporter.vcproj", "{8A81E2A6-8337-4003-8BDD-59F6F54C2EFC}" ProjectSection(ProjectDependencies) = postProject - {87C2BFBA-8299-432F-B2E6-08E650E74230} = {87C2BFBA-8299-432F-B2E6-08E650E74230} - {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} - {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inputwx", "..\contrib\plugin\inputwx\inputwx.vcproj", "{038D947F-6223-4EA7-BE4E-A41984923336}" ProjectSection(ProjectDependencies) = postProject {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} --- 66,95 ---- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rubysceneimporter", "plugin\rubysceneimporter\rubysceneimporter.vcproj", "{8A81E2A6-8337-4003-8BDD-59F6F54C2EFC}" ProjectSection(ProjectDependencies) = postProject {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {87C2BFBA-8299-432F-B2E6-08E650E74230} = {87C2BFBA-8299-432F-B2E6-08E650E74230} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inputwx", "..\contrib\plugin\inputwx\inputwx.vcproj", "{038D947F-6223-4EA7-BE4E-A41984923336}" ProjectSection(ProjectDependencies) = postProject + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soccer", "..\contrib\plugin\soccer\soccer.vcproj", "{D6BD532A-E11A-4391-A37C-2D55027EE219}" + ProjectSection(ProjectDependencies) = postProject + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sparkagent", "plugin\sparkagent\sparkagent.vcproj", "{9E5D17FC-5665-48A8-9298-747A3D690787}" + ProjectSection(ProjectDependencies) = postProject + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} *************** *** 82,95 **** EndProjectSection EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soccer", "..\contrib\plugin\soccer\soccer.vcproj", "{D6BD532A-E11A-4391-A37C-2D55027EE219}" ProjectSection(ProjectDependencies) = postProject {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} - {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sparkagent", "plugin\sparkagent\sparkagent.vcproj", "{9E5D17FC-5665-48A8-9298-747A3D690787}" ProjectSection(ProjectDependencies) = postProject {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} --- 97,110 ---- EndProjectSection EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agentspark", "..\contrib\agentspark\agentspark.vcproj", "{A544868D-F263-40AC-BEDF-FFF0660B3E32}" ProjectSection(ProjectDependencies) = postProject + {ABCC65CE-0762-42F2-8459-41722DCF02D9} = {ABCC65CE-0762-42F2-8459-41722DCF02D9} {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} EndProjectSection EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sceneeffector", "plugin\sceneeffector\sceneeffector.vcproj", "{AE03EAFA-DFD9-43B3-8777-13A27167A692}" ProjectSection(ProjectDependencies) = postProject {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} *************** *** 196,199 **** --- 211,226 ---- {9E5D17FC-5665-48A8-9298-747A3D690787}.VCRelease|Win32.ActiveCfg = VCRelease|Win32 {9E5D17FC-5665-48A8-9298-747A3D690787}.VCRelease|Win32.Build.0 = VCRelease|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.Debug|Win32.ActiveCfg = Debug|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.Debug|Win32.Build.0 = Debug|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.Release|Win32.ActiveCfg = VCRelease|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.Release|Win32.Build.0 = VCRelease|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.VCRelease|Win32.ActiveCfg = VCRelease|Win32 + {A544868D-F263-40AC-BEDF-FFF0660B3E32}.VCRelease|Win32.Build.0 = VCRelease|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.Debug|Win32.Build.0 = Debug|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.Release|Win32.ActiveCfg = VCRelease|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.Release|Win32.Build.0 = VCRelease|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.VCRelease|Win32.ActiveCfg = VCRelease|Win32 + {AE03EAFA-DFD9-43B3-8777-13A27167A692}.VCRelease|Win32.Build.0 = VCRelease|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution *************** *** 213,221 **** {8A81E2A6-8337-4003-8BDD-59F6F54C2EFC} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {9E5D17FC-5665-48A8-9298-747A3D690787} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} ! {1A100CE2-0121-4595-AF1F-A15CE8B09D30} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} {038D947F-6223-4EA7-BE4E-A41984923336} = {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} {D6BD532A-E11A-4391-A37C-2D55027EE219} = {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} - {38B680B0-B535-40F0-B5DB-FC307C40C7D6} = {1A100CE2-0121-4595-AF1F-A15CE8B09D30} EndGlobalSection EndGlobal --- 240,249 ---- {8A81E2A6-8337-4003-8BDD-59F6F54C2EFC} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {9E5D17FC-5665-48A8-9298-747A3D690787} = {9FA74610-97C1-48A3-BD56-3C086F819A90} + {AE03EAFA-DFD9-43B3-8777-13A27167A692} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} ! {38B680B0-B535-40F0-B5DB-FC307C40C7D6} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} ! {A544868D-F263-40AC-BEDF-FFF0660B3E32} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} {038D947F-6223-4EA7-BE4E-A41984923336} = {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} {D6BD532A-E11A-4391-A37C-2D55027EE219} = {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} EndGlobalSection EndGlobal |
From: Markus R. <rol...@us...> - 2007-02-23 19:28:24
|
Update of /cvsroot/simspark/simspark/spark/plugin/sceneeffector In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7940/plugin/sceneeffector Added Files: Tag: WIN32 sceneeffector.vcproj Log Message: - added sceneffector plugin --- NEW FILE: sceneeffector.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="sceneeffector" ProjectGUID="{AE03EAFA-DFD9-43B3-8777-13A27167A692}" RootNamespace="sceneeffector" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\win32;..\..\;..\..\utility" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="msvcrt-ruby18.lib ode.lib" LinkIncremental="2" GenerateDebugInformation="true" SubSystem="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\..\win32;..\..\;..\..\utility" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="msvcrt-ruby18.lib ode.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <File RelativePath=".\export.cpp" > </File> <File RelativePath=".\sceneeffector.cpp" > </File> <File RelativePath=".\sceneeffector.h" > </File> <File RelativePath=".\sceneeffector_c.cpp" > </File> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Markus R. <rol...@us...> - 2007-02-23 19:27:26
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7501 Modified Files: Tag: WIN32 agentcontrol.cpp monitorcontrol.cpp Log Message: - SendMesssage renamed to SendClientMessage Index: monitorcontrol.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/monitorcontrol.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** monitorcontrol.cpp 16 Feb 2007 15:42:55 -0000 1.1.2.1 --- monitorcontrol.cpp 23 Feb 2007 19:27:18 -0000 1.1.2.2 *************** *** 65,69 **** string header = mMonitorServer->GetMonitorHeaderInfo(); mNetMessage->PrepareToSend(header); ! SendMessage(client->addr,header); } --- 65,69 ---- string header = mMonitorServer->GetMonitorHeaderInfo(); mNetMessage->PrepareToSend(header); ! SendClientMessage(client->addr,header); } *************** *** 88,92 **** // send updates to all connected monitors ! string info = mMonitorServer->GetMonitorInfo(); mNetMessage->PrepareToSend(info); --- 88,92 ---- // send updates to all connected monitors ! string info = mMonitorServer->GetMonitorData(); mNetMessage->PrepareToSend(info); *************** *** 97,101 **** ) { ! SendMessage((*iter).second,info); } --- 97,101 ---- ) { ! SendClientMessage((*iter).second,info); } *************** *** 159,162 **** mMonitorInterval = i; } - - --- 159,160 ---- Index: agentcontrol.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/agentcontrol.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** agentcontrol.cpp 16 Feb 2007 15:42:54 -0000 1.1.2.1 --- agentcontrol.cpp 23 Feb 2007 19:27:18 -0000 1.1.2.2 *************** *** 172,176 **** mNetMessage->PrepareToSend(senses); ! SendMessage(client,senses); } } --- 172,176 ---- mNetMessage->PrepareToSend(senses); ! SendClientMessage(client,senses); } } |
From: Markus R. <rol...@us...> - 2007-02-23 19:26:35
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7098 Modified Files: Tag: WIN32 netmessage.cpp Log Message: - add socket.h include Index: netmessage.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/netmessage.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** netmessage.cpp 9 Feb 2007 20:11:56 -0000 1.1.2.1 --- netmessage.cpp 23 Feb 2007 19:26:28 -0000 1.1.2.2 *************** *** 20,23 **** --- 20,24 ---- #include "netmessage.h" #include "netbuffer.h" + #include <rcssnet/socket.hpp> #ifndef WIN32 |