📄 action.h
字号:
/* 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 ACTION_H#define ACTION_H#include <boost/any.hpp>#include <boost/shared_ptr.hpp>#include <boost/shared_array.hpp>#include "types.h"//#include "Logger.h"class Robot;class Self;class Action{public: Action(); virtual ~Action(); virtual void Init(); virtual void SetParam(/*boost::any param*/) = 0; virtual bool DoAction(); virtual std::string GetActionCommand() { return mActionCommand; } virtual bool IsDone() { return mIsDone; }protected: virtual void OnUnlink(); virtual void Update(); virtual void Execute() = 0; virtual void GeneralActionCommand(); /** calculate velocity need achieve the desired angle * for each Joint Angle according to JID */ virtual void CalculateVel(JointID id, float angle, float maxVel);protected: boost::shared_ptr<Robot> mRobot; boost::shared_ptr<Self> mSelf; boost::shared_array<float> mJointAngle; boost::shared_array<float> mJointVel; std::string mActionCommand; bool mIsDone;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -