底层robocup3d源码。 suse10.0 kdevelop 开发.

源代码在线查看: command.cpp~

软件大小: 478 K
上传用户: shicg666666
关键词: robocup3d kdevelop suse 底层
下载地址: 免注册下载 普通下载 VIP

相关代码

				#include "command.h"				extern MSpace::Connect net;				extern MSpace::Geometry geometry;				namespace MSpace {								Command::Command()				{					lastdrive.sentcycle=0.0;				}				void Command::Create(std::string TeamName,int Number)				{					std::stringstream ss;					ss					net.PutOutputs(ss.str());				}				void Command::Done()				{					net.PutOutputs("D");				}				void Command::Kick(Angel ang,float force)				{					std::stringstream ss;					ss 					net.PutOutputs(ss.str());					lastdrive.sentcycle=param.CycleReceive;					lastdrive.force=Vec(0,0,0);				}				void  Command::Notify(int time)				{					std::stringstream ss;					ss 					net.PutOutputs(ss.str());				}				void Command::Drive(Vec v)				{					if(v.GetMod()>100)v.SetMod(100);					std::stringstream ss;					ss 					net.PutOutputs(ss.str());					lastdrive.sentcycle=param.CycleReceive;					lastdrive.force=v;				}				void Command::Beam(Vec v)				{					std::stringstream ss;					ss 					net.PutOutputs(ss.str());				}				void Command::Catch()				{					net.PutOutputs("A(catch)");				}				void Command::PutKick(Angel ang,float force)				{					std::stringstream ss;					ss 					comq.enQueue(ss.str());					lastdrive.sentcycle=param.CycleReceive;					lastdrive.force=Vec(0,0,0);				}				void Command::PutDrive(Vec v)				{					if(v.GetMod()>100)v.SetMod(100);					std::stringstream ss;					ss 					//std::cout					comq.enQueue(ss.str());				}				void Command::PutCatch()				{					comq.enQueue("A(catch)");				}				void Command::SentCommand()				{					std::string cmd;					if(comq.getFront(cmd)!=DOWNFLOW)					{						net.PutOutputs(cmd);						comq.delQueue();						int i=1;						if(param.GetString(cmd.c_str(),i)=="drive")						{							lastdrive.sentcycle=param.CycleReceive;							lastdrive.force.Vx=param.GetFloat(cmd.c_str(),i);							lastdrive.force.Vy=param.GetFloat(cmd.c_str(),i);							//std::cout						}					}				}				void Command::TurnCamera(Angel pan,Angel tilt)				{					std::stringstream ss;					ss 					net.PutOutputs(ss.str());					Angel tempAn(param.pan);					tempAn=tempAn+pan;					param.pan=tempAn.angel;				}				void Command::Say(std::string word)				{					std::stringstream ss;					ss 					net.PutOutputs(ss.str());				}				Vec Command::GetLastDriveForce()				{					return lastdrive.force;				}					long Command::GetLastDriveCycle()				{					return lastdrive.sentcycle;				}				Command::~Command()				{				}												}							

相关资源