底层robocup3d源码。
suse10.0 kdevelop 开发.
源代码在线查看: command.cpp~
#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() { } }
|
相关资源 |
|
-
底层robocup3d源码。
suse10.0 kdevelop 开发.
-
Labview编写的EPP控制程序源码。labview7.0
-
ti-Chipcon CC1010、2510 1G以下Soc应用开发源码实例。包括rf,powermodes,clockmodes底层驱动源码。有了这些实例,包括误码率测试等。对你更好的理解和应用这颗
-
ti-Chipcon CCxx11 USB + MCU +RF 应用开发源码实例。包括2.0usb,rf,powermodes,clockmodes底层驱动源码。有了这些实例,包括误码率测试等。对你更
-
ti-Chipcon CC2430 zigbee Soc应用开发源码实例。包括rf,powermodes,clockmodes底层驱动源码。有了这些实例,包括误码率测试等。对你更好的理解和应用这颗芯片
-
AT91SAM7X256芯片底层驱动源码。在IAR430环境下编译
-
AT91SAM7X256芯片底层驱动源码。在IAR430环境下编译
-
AT91SAM7X256芯片底层驱动源码。在IAR430环境下编译
|