📄 wmbuilder.h
字号:
/*************************************************************************** * Copyright (C) 2005 by Rujia Liu * * rujialiu@hotmail.com * * * * 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; either version 2 of the License, or * * (at your option) any later version. * * * * 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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/#ifndef WMBUILDER_H#define WMBUILDER_H#include <soccer/soccertypes.h>#include <oxygen/gamecontrolserver/predicate.h>#include <oxygen/gamecontrolserver/baseparser.h>#include "geometry.h"#include "logserver.h"using namespace Geometry;enum VisionObject { VO_BALL = 0, VO_FLAG1L = 1, VO_FLAG1R = 2, VO_FLAG2L = 3, VO_FLAG2R = 4, VO_GOAL1L = 5, VO_GOAL1R = 6, VO_GOAL2L = 7, VO_GOAL2R = 8};class WMBuilder{public: WMBuilder(); ~WMBuilder();public: // called from agent, to update the world model bool Init(); void Parse(const std::string& message); protected: // three types of sensation void ParseGameState(const oxygen::Predicate& predicate); void ParseAgentState(const oxygen::Predicate& predicate); void ParseVision(const oxygen::Predicate& predicate); // sub-routine for GameState void ParsePlayMode(const oxygen::Predicate& predicate); void ParseTeamIndex(const oxygen::Predicate& predicate); // get vision sense of a static object VisionSense GetVisionSense(VisionObject obj); // self-locating float GetVariance(VisionObject vo); salt::Vector3f LocalizeWithOneFlag(VisionObject vo); salt::Vector3f Localize(); protected: typedef std::map<std::string, TPlayMode> TPlayModeMap; TPlayModeMap mPlayModeMap; typedef std::map<VisionObject, VisionSense> TVisionMap; TVisionMap mVisionMap; typedef std::map<std::string, VisionObject> TVisionObjectMap; TVisionObjectMap mVisionObjectMap; // s-expression parser boost::shared_ptr<oxygen::BaseParser> mParser; // temperory vision sense in current vision sense VisionSense mPlayerPositionSense[2][12]; // [0][mTeamUnum]public: LogServer log;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -