From 308c8640c9fca4780e65ca1408b788169d85d7aa Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sat, 5 Nov 2016 15:51:24 +0330 Subject: [PATCH 01/15] first time to commit kn2cSSL --- src/ai/Skills.h.autosave | 12 + src/ai/agent.cpp | 0 src/ai/agent.h | 0 src/ai/ai.cpp | 6 + src/ai/play/mantomandefense.cpp | 59 ++ src/ai/play/mantomandefense.h | 19 + src/ai/play/playhalt.cpp | 6 +- src/ai/play/playhw2_1.cpp | 23 + src/ai/play/playhw2_1.h | 20 + src/ai/play/playstop_hejazi.cpp | 3 + src/ai/play/playstop_hejazi.h | 15 + src/ai/play/playtest.cpp | 20 +- src/ai/play/playtest.h | 8 +- src/ai/play/playtest2.cpp | 55 +- src/ai/play/playtest2.h | 8 +- src/ai/skill/shootball.cpp | 2 + src/ai/skill/shootball.h | 22 + src/ai/skill/skillkick.cpp | 222 ++++---- src/ai/tactic/tactictest.cpp | 138 ++++- src/ai/tactic/tactictest.h | 7 +- src/ai/tactic/tactictest2.cpp | 437 +++++++++++++++ src/ai/tactic/tactictest2.h | 8 +- .../tactic/tacticteststandingforwardenemy.cpp | 48 ++ .../tactic/tacticteststandingforwardenemy.h | 25 + src/ai/tactic/taticgoliealihejazi.cpp | 16 + src/ai/tactic/taticgoliealihejazi.h | 13 + src/ai/tactics.h | 2 + src/kn2cssl_new.pro | 16 +- src/kn2cssl_new.pro.user | 336 ++++++++++++ src/kn2cssl_new.pro.user.18 | 271 +++++++++ src/kn2cssl_new.pro.user.3.2-pre1 | 260 +++++++++ src/output/controller.cpp | 0 src/output/controller.h | 0 src/output/controller_struct.h | 0 src/output/wpacket.cpp | 0 src/output/wpacket.h | 0 src/proto/Ball_message.pb.cc | 46 +- src/proto/Ball_message.pb.h | 19 +- src/proto/RobotCommand_message.pb.cc | 92 ++-- src/proto/RobotCommand_message.pb.h | 29 +- src/proto/Robot_message.pb.cc | 66 ++- src/proto/Robot_message.pb.h | 31 +- src/proto/grSim_Commands.pb.cc | 171 +++--- src/proto/grSim_Commands.pb.h | 51 +- src/proto/grSim_Packet.pb.cc | 41 +- src/proto/grSim_Packet.pb.h | 17 +- src/proto/grSim_Replacement.pb.cc | 195 ++++--- src/proto/grSim_Replacement.pb.h | 51 +- src/proto/log.pb.cc | 46 +- src/proto/log.pb.h | 20 +- .../messages_robocup_ssl_detection.pb.cc | 279 ++++++---- src/proto/messages_robocup_ssl_detection.pb.h | 78 ++- src/proto/messages_robocup_ssl_geometry.pb.cc | 518 +++++++++++------- src/proto/messages_robocup_ssl_geometry.pb.h | 175 ++++-- ...messages_robocup_ssl_geometry_legacy.pb.cc | 182 +++--- .../messages_robocup_ssl_geometry_legacy.pb.h | 54 +- .../messages_robocup_ssl_refbox_log.pb.cc | 103 ++-- .../messages_robocup_ssl_refbox_log.pb.h | 50 +- src/proto/messages_robocup_ssl_wrapper.pb.cc | 41 +- src/proto/messages_robocup_ssl_wrapper.pb.h | 17 +- .../messages_robocup_ssl_wrapper_legacy.pb.cc | 41 +- .../messages_robocup_ssl_wrapper_legacy.pb.h | 17 +- src/proto/position_message.pb.cc | 64 ++- src/proto/position_message.pb.h | 17 +- src/proto/ref_log.pb.cc | 110 ++-- src/proto/ref_log.pb.h | 32 +- src/proto/referee.pb.cc | 213 ++++--- src/proto/referee.pb.h | 79 ++- src/proto/ssl_log.pb.cc | 126 +++-- src/proto/ssl_log.pb.h | 42 +- src/proto/vision_log.pb.cc | 110 ++-- src/proto/vision_log.pb.h | 32 +- src/ssl/mobileobject.cpp | 0 src/ui/mainwindow.cpp | 3 + src/ui/mainwindow.ui | 6 + 75 files changed, 3994 insertions(+), 1347 deletions(-) create mode 100644 src/ai/Skills.h.autosave mode change 100644 => 100755 src/ai/agent.cpp mode change 100644 => 100755 src/ai/agent.h create mode 100644 src/ai/play/mantomandefense.cpp create mode 100644 src/ai/play/mantomandefense.h create mode 100644 src/ai/play/playhw2_1.cpp create mode 100644 src/ai/play/playhw2_1.h create mode 100644 src/ai/play/playstop_hejazi.cpp create mode 100644 src/ai/play/playstop_hejazi.h create mode 100644 src/ai/skill/shootball.cpp create mode 100644 src/ai/skill/shootball.h create mode 100644 src/ai/tactic/tacticteststandingforwardenemy.cpp create mode 100644 src/ai/tactic/tacticteststandingforwardenemy.h create mode 100644 src/ai/tactic/taticgoliealihejazi.cpp create mode 100644 src/ai/tactic/taticgoliealihejazi.h create mode 100644 src/kn2cssl_new.pro.user create mode 100644 src/kn2cssl_new.pro.user.18 create mode 100644 src/kn2cssl_new.pro.user.3.2-pre1 mode change 100644 => 100755 src/output/controller.cpp mode change 100644 => 100755 src/output/controller.h mode change 100644 => 100755 src/output/controller_struct.h mode change 100644 => 100755 src/output/wpacket.cpp mode change 100644 => 100755 src/output/wpacket.h mode change 100644 => 100755 src/ssl/mobileobject.cpp diff --git a/src/ai/Skills.h.autosave b/src/ai/Skills.h.autosave new file mode 100644 index 0000000..7e8f8b9 --- /dev/null +++ b/src/ai/Skills.h.autosave @@ -0,0 +1,12 @@ +#ifndef SKILLS_H +#define SKILLS_H + +#include "skill.h" +#include "skill/skillkick.h" +#include "skill/skilltest.h" +#include "skill/skillonetouch.h" +#include "skill/skillpassreceive.h" +//seyed ali hejazi +#include "skill/shootball.h" + +#endif // SKILLS_H diff --git a/src/ai/agent.cpp b/src/ai/agent.cpp old mode 100644 new mode 100755 diff --git a/src/ai/agent.h b/src/ai/agent.h old mode 100644 new mode 100755 diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index 23ec217..cf83e8f 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -14,6 +14,9 @@ #include "play/playtest2.h" #include "play/playlearning.h" #include "play/playformations.h" +//ali hejazi +#include "play/playhw2_1.h" +#include "play/mantomandefense.h" AI::AI(WorldModel *worldmodel, QString field_size, OutputBuffer *outputbuffer, QObject *parent) : QObject(parent), @@ -52,6 +55,9 @@ AI::AI(WorldModel *worldmodel, QString field_size, OutputBuffer *outputbuffer, Q plays.append(new PlayTest2(wm)); plays.append(new PlayLearning(wm)); plays.append(new PlayFormations(wm)); + //ali hejazi + plays.append(new PlayHW2_1(wm)); + plays.append(new mantomanDefense(wm)); } void AI::Start() diff --git a/src/ai/play/mantomandefense.cpp b/src/ai/play/mantomandefense.cpp new file mode 100644 index 0000000..8b3b2a9 --- /dev/null +++ b/src/ai/play/mantomandefense.cpp @@ -0,0 +1,59 @@ +#include "mantomandefense.h" + +mantomanDefense::mantomanDefense(WorldModel *worldmodel, QObject *parent) : + Play("PlayTest", worldmodel, parent) +{ + +} + +int mantomanDefense::enterCondition() +{ + return 0; +} + +void mantomanDefense::initRole() +{ +} + +void mantomanDefense::execute() +{ + + QList diffender = wm->kn->ActiveAgents(); + QList enemy = wm->kn->ActiveOppAgents(); + QList > distances; + for(int i = diffender.length() ; i > 0 ; i--){ + AlgorithmMin(diffender,enemy); + } +} + +void mantomanDefense::AlgorithmMin(QList& enm,QList& ally){ + QList > distances; + for(int i = 0 ; i < ally.length() ; i++){ + QList dists; + for(int j = 0 ; j < enm.length() ; j++){ + Segment2D seg(wm->ourRobot[ally[i]].pos.loc,wm->oppRobot[enm[j]].pos.loc); + std::cout << "i am here" << std::endl; + dists.append(seg.length()); + } + distances.append(dists); + } + + double min = 99999999; + int minIndex1 = 0; + int minIndex2 = 0; + for(int i = 0 ; i < ally.length() ; i++){ + for(int j = 0 ; j < enm.length() ; j++){ + if(distances[i][j] < min){ + min = distances[i][j]; + minIndex1 = i; + minIndex2 = j; + } + } + } + tacticmantoman = new TacticTestStandingForwardEnemy(wm); + tacticmantoman->setDistance(4); + tacticmantoman->setOppRobotIndex(enm[minIndex2]); + tactics[ally[minIndex1]] = tacticmantoman; + ally.removeAt(minIndex1); + enm.removeAt(minIndex2); +} diff --git a/src/ai/play/mantomandefense.h b/src/ai/play/mantomandefense.h new file mode 100644 index 0000000..3a544e4 --- /dev/null +++ b/src/ai/play/mantomandefense.h @@ -0,0 +1,19 @@ +#ifndef MANTOMANDEFENSE_H +#define MANTOMANDEFENSE_H +#include "play.h" +#include "man2man.h" + +class mantomanDefense : public Play +{ + Q_OBJECT +public: + explicit mantomanDefense(WorldModel *worldmodel, QObject *parent = 0); + virtual void execute(); + virtual void initRole(); + virtual int enterCondition(); +private: + TacticTestStandingForwardEnemy* tacticmantoman; + void AlgorithmMin(QList& enm, QList& ally); +}; + +#endif // MANTOMANDEFENSE_H diff --git a/src/ai/play/playhalt.cpp b/src/ai/play/playhalt.cpp index 0b8449c..4288c60 100644 --- a/src/ai/play/playhalt.cpp +++ b/src/ai/play/playhalt.cpp @@ -8,9 +8,9 @@ PlayHalt::PlayHalt(WorldModel *worldmodel, QObject *parent) : int PlayHalt::enterCondition() { - if(wm->cmgs.canMove() == false || wm->cmgs.timeout()) - return 1000000; - else +// if(wm->cmgs.canMove() == false || wm->cmgs.timeout()) +// return 1000000; +// else return 0; } diff --git a/src/ai/play/playhw2_1.cpp b/src/ai/play/playhw2_1.cpp new file mode 100644 index 0000000..b5b6e2b --- /dev/null +++ b/src/ai/play/playhw2_1.cpp @@ -0,0 +1,23 @@ +#include "playhw2_1.h" + +PlayHW2_1::PlayHW2_1(WorldModel *worldmodel, QObject *parent) : + Play("PlayTest", worldmodel, parent) +{ + tTest = new TacticTestStandingForwardEnemy(wm); +} + +int PlayHW2_1::enterCondition() +{ + return 0; +} + +void PlayHW2_1::initRole() +{ +} + +void PlayHW2_1::execute() +{ + tTest->setDistance(5); + tactics[wm->kn->ActiveAgents()[0]] = tTest; + +} diff --git a/src/ai/play/playhw2_1.h b/src/ai/play/playhw2_1.h new file mode 100644 index 0000000..589e98a --- /dev/null +++ b/src/ai/play/playhw2_1.h @@ -0,0 +1,20 @@ +#ifndef PLAYHW2_1_H +#define PLAYHW2_1_H +#include "play.h" +#include "man2man.h" +#include "tactic/tacticteststandingforwardenemy.h" + +class PlayHW2_1 : public Play +{ + + Q_OBJECT +public: + explicit PlayHW2_1(WorldModel *worldmodel, QObject *parent = 0); + virtual void execute(); + virtual void initRole(); + virtual int enterCondition(); +private: + TacticTestStandingForwardEnemy* tTest; +}; + +#endif // PLAYHW2_1_H diff --git a/src/ai/play/playstop_hejazi.cpp b/src/ai/play/playstop_hejazi.cpp new file mode 100644 index 0000000..edb5cc2 --- /dev/null +++ b/src/ai/play/playstop_hejazi.cpp @@ -0,0 +1,3 @@ +#include "playstop_hejazi.h" + + diff --git a/src/ai/play/playstop_hejazi.h b/src/ai/play/playstop_hejazi.h new file mode 100644 index 0000000..4422374 --- /dev/null +++ b/src/ai/play/playstop_hejazi.h @@ -0,0 +1,15 @@ +#ifndef PLAYSTOP_HEJAZI_H +#define PLAYSTOP_HEJAZI_H +#include "play.h" +#include + +class PlayStop_Hejazi : public Play +{ +public: + explicit PlayStop_Hejazi(WorldModel *worldmodel, QObject *parent = 0); + virtual void execute(); + virtual void initRole(); + PlayStop_Hejazi(); +}; + +#endif // PLAYSTOP_HEJAZI_H diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 51df22f..8d6abb8 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -1,15 +1,14 @@ #include "playtest.h" PlayTest::PlayTest(WorldModel *worldmodel, QObject *parent) : Play("PlayTest", worldmodel, parent) -{////////////////////////////////// - test = new TacticTest(wm); - test2 = new TacticTest2(wm); - /////////////////////////////////// +{ + tTest = new TacticTest(wm); + tTest2 = new TacticTest(wm); } int PlayTest::enterCondition() { - return 0; + return 999999; } void PlayTest::initRole() @@ -17,10 +16,11 @@ void PlayTest::initRole() } void PlayTest::execute() -{//---//////////////////////////////////////////////////// - - tactics[0] = test; - tactics[1] = test; - tactics[2] = test; +{ +// std::cout << wm->kn->ActiveAgents()[0] << std::endl; +// wm->debug_pos.clear(); +// wm->debug_pos.append(wm->ourRobot[1].pos.loc); +// wm->debug_pos.append(wm->ourRobot[0].pos.loc); + tactics[2] = tTest; } diff --git a/src/ai/play/playtest.h b/src/ai/play/playtest.h index 106b915..6ea392a 100644 --- a/src/ai/play/playtest.h +++ b/src/ai/play/playtest.h @@ -11,12 +11,8 @@ class PlayTest : public Play virtual void execute(); virtual void initRole(); virtual int enterCondition(); - - //////////////////////////// private: - int flag=0; - TacticTest *test; - TacticTest2 *test2; - /////////////////////////// + TacticTest* tTest; + TacticTest* tTest2; }; #endif // PLAYTEST_H diff --git a/src/ai/play/playtest2.cpp b/src/ai/play/playtest2.cpp index 0c70527..cf3970b 100644 --- a/src/ai/play/playtest2.cpp +++ b/src/ai/play/playtest2.cpp @@ -3,16 +3,12 @@ PlayTest2::PlayTest2(WorldModel *worldmodel, QObject *parent) : Play("PlayTest2", worldmodel, parent) { - // Goaler. - tGolie = new TacticGoalie(wm); - tTF = new TacticTestFriction(wm); - thalt = new TacticHalt(wm); - tTest = new TacticTest(wm); + tTest = new TacticTest2(wm); } int PlayTest2::enterCondition() { - return 0; + return 990; } void PlayTest2::initRole() @@ -22,8 +18,49 @@ void PlayTest2::initRole() void PlayTest2::execute() { -// tactics[wm->ref_goalie_our] = tGolie; - tactics[3] = tTest; - qDebug()<<"Ball Speed is "<ball.vel.loc.length(); + if(wm->gs == STATE_Stop){ + tactics[wm->ref_goalie_our] = tTest; + //step1 + if(wm->kn->ActiveAgents().size() == 3){ + tactics[wm->kn->ActiveAgents()[0]] = tTest; + tactics[wm->kn->ActiveAgents()[1]] = tTest; + tactics[wm->kn->ActiveAgents()[2]] = tTest; + } + if(wm->kn->ActiveAgents().size() == 4){ + tactics[wm->kn->ActiveAgents()[0]] = tTest; + tactics[wm->kn->ActiveAgents()[1]] = tTest; + tactics[wm->kn->ActiveAgents()[2]] = tTest; + tactics[wm->kn->ActiveAgents()[3]] = tTest; + } + if(wm->kn->ActiveAgents().size() == 5){ + tactics[wm->kn->ActiveAgents()[0]] = tTest; + tactics[wm->kn->ActiveAgents()[1]] = tTest; + tactics[wm->kn->ActiveAgents()[2]] = tTest; + tactics[wm->kn->ActiveAgents()[3]] = tTest; + tactics[wm->kn->ActiveAgents()[4]] = tTest; + } + if(wm->kn->ActiveAgents().size() == 6){ + tactics[wm->kn->ActiveAgents()[0]] = tTest; + tactics[wm->kn->ActiveAgents()[1]] = tTest; + tactics[wm->kn->ActiveAgents()[2]] = tTest; + tactics[wm->kn->ActiveAgents()[3]] = tTest; + tactics[wm->kn->ActiveAgents()[4]] = tTest; + tactics[wm->kn->ActiveAgents()[5]] = tTest; + } + } + if(wm->gs == STATE_Halt){ + for(int i = 0 ; i < wm->kn->ActiveAgents().size() ; i++){ + tactics[i] = new TacticHalt(wm); + } + } + if(wm->gs == STATE_Free_kick_Opp){ + tactics[wm->ref_goalie_our] = tTest; + } + if(wm->gs == STATE_Free_kick_Our){ + tactics[0] = (Tactic*) (new TacticTest(wm)); + } } +//Vector2D PlayTest2::generatePos(int radius,double alpha){ +// return Vector2D(wm->ball.pos.loc.x + radius*std::sin() +//} diff --git a/src/ai/play/playtest2.h b/src/ai/play/playtest2.h index 1a5d002..7289d37 100644 --- a/src/ai/play/playtest2.h +++ b/src/ai/play/playtest2.h @@ -3,6 +3,7 @@ #include "play.h" #include "QDebug" +#include "tactic/tactichalt.h" class PlayTest2 : public Play { @@ -12,14 +13,11 @@ class PlayTest2 : public Play virtual void execute(); //virtual Tactic* getTactic(int id); virtual int enterCondition(); + Vector2D generatePos (int radius,double alpha); private: - TacticGoalie* tGolie; - TacticTestFriction* tTF; - TacticHalt* thalt; - TacticTest* tTest; - virtual void initRole(); + TacticTest2* tTest; }; #endif // PLAYTEST2_H diff --git a/src/ai/skill/shootball.cpp b/src/ai/skill/shootball.cpp new file mode 100644 index 0000000..d46d812 --- /dev/null +++ b/src/ai/skill/shootball.cpp @@ -0,0 +1,2 @@ +#include "shootball.h" + diff --git a/src/ai/skill/shootball.h b/src/ai/skill/shootball.h new file mode 100644 index 0000000..42a85f9 --- /dev/null +++ b/src/ai/skill/shootball.h @@ -0,0 +1,22 @@ +#ifndef SHOOTBALL_H +#define SHOOTBALL_H +#include +#include "skill.h" + +//class shootBall : public Skill +//{ +// Q_OBJECT +//public: +// shootBall(); +// explicit shootBall(WorldModel* wm, QObject *parent = 0); +// bool execute(RobotCommand& rc); +//private: +// bool targetMove; +// Vector2D* _target; +// /*! +// is ball shooted or not. +// */ +// bool ballShooted; +//}; + +#endif // SHOOTBALL_H diff --git a/src/ai/skill/skillkick.cpp b/src/ai/skill/skillkick.cpp index ce0e7f5..1341b7a 100644 --- a/src/ai/skill/skillkick.cpp +++ b/src/ai/skill/skillkick.cpp @@ -8,116 +8,118 @@ SkillKick::SkillKick(WorldModel* wm, QObject *parent) : bool SkillKick::execute(RobotCommand &rc) { - //locating behind the ball... - - Vector2D goal; - - Vector2D ball2target; - - ball2target=this->_Target - wm->ball.pos.loc; - - ball2target.setLength(ROBOT_RADIUS+8); - - goal=wm->ball.pos.loc - ball2target; - - // Vector2D checkingPoint; - - // ball2target.setLength(2*ROBOT_RADIUS+20); - - // checkingPoint=wm->ball.pos.loc - ball2target; - - // Segment2D *kicker2chekingPoint=new Segment2D(wm->ourRobot[index].pos.loc,checkingPoint); - - // Circle2D checkingCircle(wm->ball.pos.loc,ROBOT_RADIUS*2); - - - Circle2D checkingCircle(wm->ball.pos.loc,ROBOT_RADIUS); - Segment2D *kicker2goal=new Segment2D(wm->ourRobot[index].pos.loc,goal); - - if( checkingCircle.HasIntersection( *kicker2goal ) ) - { - ball2target.setLength(200+200); - Vector2D temp1=goal+(-ball2target).rotatedVector(60); - Vector2D temp2=goal+(-ball2target).rotatedVector(-60); - if((wm->ourRobot[index].pos.loc-temp1).length2()<(wm->ourRobot[index].pos.loc-temp2).length2()) - { - goal=temp1; - } - else - { - goal=temp2; - } - } - - rc.fin_pos.loc=goal; - - rc.fin_pos.dir=ball2target.dir().radian(); - - - - - //kicking... - - if( wm->isSim ) - { - //simulatuion - Vector2D centerofrarecircle; - ball2target.setLength(ROBOT_RADIUS+10); - centerofrarecircle=wm->ball.pos.loc-ball2target; - Circle2D rearCircle(centerofrarecircle,20); - Circle2D ballCircle(wm->ball.pos.loc,ROBOT_RADIUS+50); - if( wm->ball.isValid&& - ballCircle.contains(wm->ourRobot[index].pos.loc)&& - rearCircle.contains(wm->ourRobot[index].pos.loc)//&& - // fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<3 - ) - { - if( !isShoot ) - rc.kickspeedx = 3.5; - else - rc.kickspeedx = 8; - } - } - else - { - // real: - - if( !wm->useShootSensor ) - { - //without kicking sensor - Vector2D centerofrarecircle; - ball2target.setLength(ROBOT_RADIUS+10); - centerofrarecircle=wm->ball.pos.loc-ball2target; - Circle2D rearCircle(centerofrarecircle,20); - Circle2D ballCircle(wm->ball.pos.loc,ROBOT_RADIUS+20); - if( wm->ball.isValid&& - ballCircle.contains(wm->ourRobot[index].pos.loc)&& - rearCircle.contains(wm->ourRobot[index].pos.loc)//&& - // fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<3 - ) - { - if( !isShoot ) - rc.kickspeedx = 30; - else - rc.kickspeedx = 100; - } - } - else - { - //with kicking sensor - if( ((wm->ball.pos.loc-wm->ourRobot[index].pos.loc).length()<500) && (fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<90 || fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))>270) ) - { - if( !isShoot ) - rc.kickspeedx = 140; - else - rc.kickspeedx = 200; - // if(passFlag) - // { - // rc.kickspeedx=sqrt(2*10*lossFactor*(this->_Target-wm->ourRobot[index].pos.loc).length()); - // } - } - } - } +/*cod khodam*/ + +// //locating behind the ball... + +// Vector2D goal; + +// Vector2D ball2target; + +// ball2target=this->_Target - wm->ball.pos.loc; + +// ball2target.setLength(ROBOT_RADIUS+8); + +// goal=wm->ball.pos.loc - ball2target; + +// // Vector2D checkingPoint; + +// // ball2target.setLength(2*ROBOT_RADIUS+20); + +// // checkingPoint=wm->ball.pos.loc - ball2target; + +// // Segment2D *kicker2chekingPoint=new Segment2D(wm->ourRobot[index].pos.loc,checkingPoint); + +// // Circle2D checkingCircle(wm->ball.pos.loc,ROBOT_RADIUS*2); + + +// Circle2D checkingCircle(wm->ball.pos.loc,ROBOT_RADIUS); +// Segment2D *kicker2goal=new Segment2D(wm->ourRobot[index].pos.loc,goal); + +// if( checkingCircle.HasIntersection( *kicker2goal ) ) +// { +// ball2target.setLength(200+200); +// Vector2D temp1=goal+(-ball2target).rotatedVector(60); +// Vector2D temp2=goal+(-ball2target).rotatedVector(-60); +// if((wm->ourRobot[index].pos.loc-temp1).length2()<(wm->ourRobot[index].pos.loc-temp2).length2()) +// { +// goal=temp1; +// } +// else +// { +// goal=temp2; +// } +// } + +// rc.fin_pos.loc=goal; + +// rc.fin_pos.dir=ball2target.dir().radian(); + + + + +// //kicking... + +// if( wm->isSim ) +// { +// //simulatuion +// Vector2D centerofrarecircle; +// ball2target.setLength(ROBOT_RADIUS+10); +// centerofrarecircle=wm->ball.pos.loc-ball2target; +// Circle2D rearCircle(centerofrarecircle,20); +// Circle2D ballCircle(wm->ball.pos.loc,ROBOT_RADIUS+50); +// if( wm->ball.isValid&& +// ballCircle.contains(wm->ourRobot[index].pos.loc)&& +// rearCircle.contains(wm->ourRobot[index].pos.loc)//&& +// // fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<3 +// ) +// { +// if( !isShoot ) +// rc.kickspeedx = 3.5; +// else +// rc.kickspeedx = 8; +// } +// } +// else +// { +// // real: + +// if( !wm->useShootSensor ) +// { +// //without kicking sensor +// Vector2D centerofrarecircle; +// ball2target.setLength(ROBOT_RADIUS+10); +// centerofrarecircle=wm->ball.pos.loc-ball2target; +// Circle2D rearCircle(centerofrarecircle,20); +// Circle2D ballCircle(wm->ball.pos.loc,ROBOT_RADIUS+20); +// if( wm->ball.isValid&& +// ballCircle.contains(wm->ourRobot[index].pos.loc)&& +// rearCircle.contains(wm->ourRobot[index].pos.loc)//&& +// // fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<3 +// ) +// { +// if( !isShoot ) +// rc.kickspeedx = 30; +// else +// rc.kickspeedx = 100; +// } +// } +// else +// { +// //with kicking sensor +// if( ((wm->ball.pos.loc-wm->ourRobot[index].pos.loc).length()<500) && (fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))<90 || fabs((ball2target.dir().degree())-((wm->ourRobot[index].pos.dir)*180/M_PI))>270) ) +// { +// if( !isShoot ) +// rc.kickspeedx = 140; +// else +// rc.kickspeedx = 200; +// // if(passFlag) +// // { +// // rc.kickspeedx=sqrt(2*10*lossFactor*(this->_Target-wm->ourRobot[index].pos.loc).length()); +// // } +// } +// } +// } } diff --git a/src/ai/tactic/tactictest.cpp b/src/ai/tactic/tactictest.cpp index 1420b6f..f78a6d1 100644 --- a/src/ai/tactic/tactictest.cpp +++ b/src/ai/tactic/tactictest.cpp @@ -1,17 +1,147 @@ #include "tactictest.h" +#include TacticTest::TacticTest(WorldModel *worldmodel, QObject *parent) : Tactic("TacticTest", worldmodel, parent) { - sTest = new SkillKick(wm); } +bool TacticTest::kicked = false; +//namespace { +//bool firstPos1 = false; +//bool active = false; +//bool firstPos2 = false; +//RobotCommand rc0; +//RobotCommand rc1; +//} + RobotCommand TacticTest::getCommand() { RobotCommand rc; - if(!wm->ourRobot[id].isValid) return rc; + if(!wm->ourRobot[id].isValid) + return rc; + rc.fin_pos.loc.x = -3000; + rc.fin_pos.loc.y = 0; + rc.useNav = true; + rc.maxSpeed = 3; + qDebug() << wm->ourRobot[2].pos.loc.x <<" - " << wm->ourRobot[2].pos.loc.y; + return rc; +// /* +// * TAMARIN GHABL - sTest->execute(rc); +// rc0.maxSpeed = 3; +// rc0.useNav = true; +// rc1.maxSpeed = 3; +// rc1.useNav = true; +// if((id == 0)&&(firstPos1 == false)){ +// rc0.fin_pos.loc = Vector2D(-2000,1000); +// firstPos1 = true; +// } +// else if((id == 1)&&(firstPos2 == false)){ +// rc1.fin_pos.loc = Vector2D(-2000,-1000); +// firstPos2 = true; +// } +// else if((id == 0)&&(firstPos1 == true)&&(active == true)&&(firstPos2 == true)){ +// rc0.fin_pos.loc.x = wm->ourRobot[1].pos.loc.x; +// if(std::abs(wm->ourRobot[0].pos.loc.x - wm->ourRobot[0].pos.loc.x) < 20){ +// active = false; +// } +// } +// else if((id == 1)&&(firstPos2 == true)&&(active == false)&&(firstPos1 == true)){ +// rc1.fin_pos.loc = Vector2D(-wm->ourRobot[0].pos.loc.x,-1000); +// if(std::abs(wm->ourRobot[1].pos.loc.x - (-wm->ourRobot[0].pos.loc.x)) < 20){ +// active = true; +// } +// } +// if(id == 0) +// return rc0; +// if(id == 1) +// return rc1; - return rc; +// */ +// //Step1 +// qDebug() << "fskdfj"; + +// if(!wm->ourRobot[id].isValid) return rc; +//// // wm->debug_pos.clear(); +//// // wm->debug_pos.append(wm->ourRobot[1].pos.loc); +//// // wm->debug_pos.append(wm->ourRobot[0].pos.loc); +//// // Vector2D p2 = Field::ourGoalCenter; +//// // Vector2D p1 = wm->ball.pos.loc; +//// // Segment2D ballViewMidSeg(p2,p1); +//// static double rad = 90; +//// double khata = 0.2; +//// if((id == 0) && (kicked == false)){ +//// Ray2D ray(wm->ourRobot[1].pos.loc,wm->ball.pos.loc); +//// Circle2D cir(wm->ball.pos.loc,rad); +//// Vector2D* v1 = new Vector2D(); +//// Vector2D* v2 = new Vector2D(); +//// cir.intersection(ray,v1,v2); +//// if(v1->dist(wm->ourRobot[1].pos.loc) > v2->dist(wm->ourRobot[1].pos.loc)){ +//// rc.fin_pos.loc = *v1; +//// rc.useNav = true; +//// rc.maxSpeed = 3; +//// Ray2D rayInvert(wm->ball.pos.loc,wm->ourRobot[1].pos.loc); +//// rc.fin_pos.dir = rayInvert.dir().radian(); +//// rc.isBallObs = true; +//// if(wm->ourRobot[0].pos.loc.dist(*v1) < 150){ +//// rc.maxSpeed = 3; +//// rc.isBallObs = false; +//// if(((std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian()) < khata) || +//// (((M_PI*2) - std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian())) < khata)) && (wm->ourRobot[0].pos.loc.dist(wm->ball.pos.loc) < 110)){ +//// rc.kickspeedx = 4; +//// rc.kickspeedz = 1; +//// kicked = true; +//// } +//// } +//// } +//// else{ +//// rc.fin_pos.loc = *v2; +//// rc.useNav = true; +//// rc.maxSpeed = 3; +//// rc.isBallObs = true; +//// if(wm->ourRobot[0].pos.loc.dist(*v2) < 150){ +//// rc.maxSpeed = 3; +//// rc.isBallObs = false; +//// Ray2D rayInvert(wm->ball.pos.loc,wm->ourRobot[1].pos.loc); +//// rc.fin_pos.dir = rayInvert.dir().radian(); +//// double rand = ((double) std::rand() / (RAND_MAX)); +//// std::cout << (wm->ourRobot[0].pos.loc.dir() - rayInvert.dir()).radian() << std::endl; +//// if(((std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian()) < khata) || +//// (((M_PI*2) - std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian())) < khata)) && (wm->ourRobot[0].pos.loc.dist(wm->ball.pos.loc) < 110)){ +//// rc.kickspeedx = 4; +//// rc.kickspeedz = 1; +//// kicked = true; +//// } +//// } +//// } +//// } +//// if((id == 1) && (kicked == true)){ +//// AngleDeg angSefr(0); +//// Line2D ray(wm->ourRobot[1].pos.loc,angSefr); +//// Vector2D jabejaSorat(wm->ball.vel.loc.x - wm->ball.pos.loc.x,wm->ball.vel.loc.y - wm->ball.pos.loc.y); +//// Line2D ray2(wm->ball.pos.loc,jabejaSorat); +//// Vector2D javab = ray.intersection(ray2); +//// rc.fin_pos.loc.x = javab.x; +//// rc.fin_pos.loc.y = javab.y; +//// rc.fin_pos.dir = (*(new Ray2D(wm->oppRobot[1].pos.loc,Field::ourGoalCenter))).dir().radian(); +//// rc.maxSpeed = 6; +//// rc.useNav = true; +//// if(wm->ourRobot[1].pos.loc.dist(wm->ball.pos.loc) < 700) +//// kicked = false; +//// } +//// if((id == 1) && (kicked == false)){ +//// rc.fin_pos.loc.x = wm->ourRobot[1].pos.loc.x; +//// rc.fin_pos.loc.y = wm->ourRobot[1].pos.loc.y; +//// } +//// if((id == 0) && (kicked == true)){ +//// rc.fin_pos.loc.x = wm->ourRobot[0].pos.loc.x; +//// rc.fin_pos.loc.y = wm->ourRobot[0].pos.loc.y; +//// } +// rc.fin_pos.loc.x = -2800; +// rc.fin_pos.loc.y = 0; +// rc.useNav = true; +// rc.maxSpeed = 2; +// qDebug()<<"i am here"; +// return rc; } diff --git a/src/ai/tactic/tactictest.h b/src/ai/tactic/tactictest.h index 3b2f8cb..b5e16fb 100644 --- a/src/ai/tactic/tactictest.h +++ b/src/ai/tactic/tactictest.h @@ -4,14 +4,13 @@ #define DangerDist 300 class TacticTest : public Tactic { +private: + Vector2D* finalPos; Q_OBJECT public: + static bool kicked; explicit TacticTest(WorldModel *worldmodel, QObject *parent = 0); virtual RobotCommand getCommand(); - -private: - Skill *sTest; - }; #endif // TACTICTEST_H diff --git a/src/ai/tactic/tactictest2.cpp b/src/ai/tactic/tactictest2.cpp index 40fcffd..ff3244b 100644 --- a/src/ai/tactic/tactictest2.cpp +++ b/src/ai/tactic/tactictest2.cpp @@ -1,12 +1,449 @@ #include "tactictest2.h" + +Vector2D* TacticTest2::getFinalPos() +{ + return &finalPos; +} + +void TacticTest2::setFinalPos(Vector2D value) +{ + finalPos = value; +} + +int TacticTest2::getBallVelocity() const +{ + return ballVelocity; +} + +void TacticTest2::setBallVelocity(int value) +{ + ballVelocity = value; +} TacticTest2::TacticTest2(WorldModel *worldmodel, QObject *parent) : Tactic("TacticTest2", worldmodel, parent) { } + RobotCommand TacticTest2::getCommand() { RobotCommand rc; if(!wm->ourRobot[id].isValid) return rc; + Vector2D p2 = Field::ourGoalCenter; + Vector2D p1 = wm->ball.pos.loc; + Segment2D ballViewMidSeg(p2,p1); + //goal keeper + if(id == wm->ref_goalie_our){ + if(wm->ball.vel.loc.r() < 0.1){ + rc.fin_pos.loc = Field::ourGoalCenter; + rc.fin_pos.dir = ballViewMidSeg.direction().radian(); + rc.maxSpeed = 2; + return rc; + } + rc.useNav = true; + rc.maxSpeed = 3; + Ray2D seg(wm->ball.pos.loc,wm->ball.vel.loc.dir()); + rc.fin_pos.loc = seg.intersection(Field::leftLine); + // rc.fin_pos.dir = seg.direction().deg2rad(seg.direction().degree()); + if((rc.fin_pos.loc.y < Field::ourGoalPost_L.y+5) && (rc.fin_pos.loc.y > Field::ourGoalPost_R.y-5) && (rc.fin_pos.loc.x = Field::ourGoalPost_L.x)) + return rc; + else + rc.fin_pos.loc = Field::ourGoalCenter; + rc.maxSpeed = 2; + return rc; + } + double ang = 7; + AngleDeg zaveEkhtelaf(30); +// Vector2D p2 = Field::ourGoalPost_L; +// Vector2D p3 = Field::ourGoalPost_R; + + /* + Segment2D SegBallView1(wm->ball.pos.loc,Field::ourDefPost_R); + Segment2D SegBallView2(wm->ball.pos.loc,Field::ourDefPost_L);*/ +// ballViewMidSeg.direction().; +/* Segment2D ballViewBotLine(p1,p3); + Segment2D ballViewTopLine(p1,p2)*/; + if(id == wm->kn->ActiveAgents()[1]){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + seg = new Segment2D(p2,Field::goalCircle_R + 200,*(new AngleDeg(ballViewMidSeg.direction().degree() + 1))); + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 200,*(new AngleDeg(ballViewMidSeg.direction().degree() + ang))); + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + rc.maxSpeed = 4; + } + if(id == wm->kn->ActiveAgents()[2]){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + seg = new Segment2D(p2,Field::goalCircle_R + 200,*(new AngleDeg(ballViewMidSeg.direction().degree() - 1))); + rc.useNav = true; + rc.maxSpeed = 6; + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 200,*(new AngleDeg(ballViewMidSeg.direction().degree()- ang))); + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + if(wm->kn->ActiveAgents().size() > 3){ + if(id == wm->kn->ActiveAgents()[3]){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 300){ + seg = new Segment2D(p2,seg2.length() - 500,*(new AngleDeg(ballViewMidSeg.direction().degree()))); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree()))); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 300){ + seg = new Segment2D(p2,seg2.length() - 500,*(new AngleDeg(ballViewMidSeg.direction().degree()))); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree()))); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + rc.maxSpeed = 4; + } + } + if(wm->kn->ActiveAgents().size() == 5){ + if(id == wm->kn->ActiveAgents()[4]){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.maxSpeed = 4; + } + } + if(wm->kn->ActiveAgents().size() == 6){ + Vector2D* j1 = new Vector2D(); + Vector2D* j2 = new Vector2D(); + if((id == wm->kn->ActiveAgents()[4]) || (id == wm->kn->ActiveAgents()[5])){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + /* + Circle2D cir1(p2,Field::goalCircle_R + 600 + (((seg2.length() - Field::goalCircle_R - 500)/3)*2)); + Circle2D cir2(wm->ball.pos.loc,200 + ((seg2.length() - Field::goalCircle_R - 500)/3)); + cir1.intersection(cir2,j1,j2); + std::cout << "j21 x" << j2->x << std::endl; + rc.fin_pos.loc = *j1; + Segment2D seg3(*j1,wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian();*/ + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() + 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + /* + Circle2D cir1(p2,Field::goalCircle_R + 600 + (((seg2.length() - Field::goalCircle_R - 500)/3)*2)); + Circle2D cir2(wm->ball.pos.loc,200 + ((seg2.length() - Field::goalCircle_R - 500)/3)); + cir1.intersection(cir2,j1,j2); + std::cout << "j22 x" << j2->x << std::endl; + rc.fin_pos.loc = *j1; + Segment2D seg3(*j1,wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian();*/ + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() + 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.maxSpeed = 4; + } + if(id == wm->kn->ActiveAgents()[5]){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() + zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "x : " << j2->x << std::endl; +// std::cout << "y : " << j2->y << std::endl; +// rc.fin_pos.loc = *j2; +// std::cout << "1x : " << j2->x << std::endl; +// std::cout << "1y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() + zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "2x : " << j2->x << std::endl; +// std::cout << "2y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// rc.fin_pos.loc = *j2; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.maxSpeed = 4; + } + } + + + + + + + + + + + + + + + + + qDebug() << ballViewMidSeg.direction().radian(); + if((ballViewMidSeg.direction().radian() > 1.1)&& (id == 4) && (wm->kn->ActiveAgents().size() == 6)){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() + zaveEkhtelaf + zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "x : " << j2->x << std::endl; +// std::cout << "y : " << j2->y << std::endl; +// rc.fin_pos.loc = *j2; +// std::cout << "1x : " << j2->x << std::endl; +// std::cout << "1y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() + 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() + zaveEkhtelaf + zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "2x : " << j2->x << std::endl; +// std::cout << "2y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// rc.fin_pos.loc = *j2; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() + 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.maxSpeed = 4; + } + + + + + + + + + + + + + + + + + + + + + + + if((ballViewMidSeg.direction().radian() < -1.1)&& (id == 5) && (wm->kn->ActiveAgents().size() == 6)){ + Segment2D* seg; + if(wm->ball.vel.loc.r() > 0.1){ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "x : " << j2->x << std::endl; +// std::cout << "y : " << j2->y << std::endl; +// rc.fin_pos.loc = *j2; +// std::cout << "1x : " << j2->x << std::endl; +// std::cout << "1y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 6; + + } + else{ + Segment2D seg2(p2,wm->ball.pos.loc); + if(seg2.length() > Field::goalCircle_R + 500){ + Segment2D seg5(wm->ball.pos.loc,p2); + Segment2D seg4(wm->ball.pos.loc , 500 , seg5.direction() - zaveEkhtelaf - zaveEkhtelaf); + rc.fin_pos.loc = seg4.terminal(); + Segment2D seg3(seg4.terminal(),wm->ball.pos.loc); + rc.fin_pos.dir = seg3.direction().radian(); + // std::cout << "2x : " << j2->x << std::endl; +// std::cout << "2y : " << j2->y << std::endl; +//// std::cout << "fasele do dayere" << cir1.center().dist(cir2.center()) << " jame shoaha" << (cir1.radius() + cir2.radius()) << std::endl; +// rc.fin_pos.loc = *j2; +// Segment2D seg3(*j2,wm->ball.pos.loc); +// rc.fin_pos.dir = seg3.direction().radian(); + } + else{ + seg = new Segment2D(p2,Field::goalCircle_R + 300,*(new AngleDeg(ballViewMidSeg.direction().degree() - 2*ang))); + rc.fin_pos.loc = seg->terminal(); + rc.fin_pos.dir = seg->direction().radian(); + } + rc.useNav = true; + rc.maxSpeed = 4; + } + rc.maxSpeed = 4; + } +// Vector2D* p4; +// Segment2D* S1; +// if(ballViewBotLine.length() < ballViewTopLine.length()){ +// AngleDeg A1(ballViewMidSeg.direction().degree() + 90); +// Line2D l1(p3,A1); +// p4 = &ballViewBotLine.intersection(l1); +// S1 = new Segment2D(p3,&p4); +// int ScaleNum = (S1->length()/(2*robotSize)); +// AngleDeg A2(-ballViewBotLine.direction().degree()); +// Segment2D MainTriBot(p1,ScaleNum*ballViewBotLine,A2); +// } +// else{ +// AngleDeg A1(ballViewMidSeg.direction().degree() + 90); +// Line2D l1(p2,A1); +// p4 = &ballViewBotLine.intersection(l1); +// S1 = new Segment2D(p2,&p4); +// int ScaleNum = (S1->length()/(2*robotSize)); +// AngleDeg A2(-ballViewTopLine.direction().degree()); +// Segment2D MainTriTop(p1,ScaleNum*ballViewBotLine,A2); +// } return rc; + //baraye rahati dayere tarif mikonim. } diff --git a/src/ai/tactic/tactictest2.h b/src/ai/tactic/tactictest2.h index a60e6b9..c4d8be8 100644 --- a/src/ai/tactic/tactictest2.h +++ b/src/ai/tactic/tactictest2.h @@ -6,10 +6,16 @@ class TacticTest2: public Tactic { +private: + Vector2D finalPos; + int ballVelocity; Q_OBJECT public: explicit TacticTest2(WorldModel *worldmodel, QObject *parent = 0); virtual RobotCommand getCommand(); - + Vector2D* getFinalPos(); + void setFinalPos(Vector2D value); + int getBallVelocity() const; + void setBallVelocity(int value); }; #endif // TACTICTEST2_H diff --git a/src/ai/tactic/tacticteststandingforwardenemy.cpp b/src/ai/tactic/tacticteststandingforwardenemy.cpp new file mode 100644 index 0000000..eb78de2 --- /dev/null +++ b/src/ai/tactic/tacticteststandingforwardenemy.cpp @@ -0,0 +1,48 @@ +#include "tacticteststandingforwardenemy.h" + + +int TacticTestStandingForwardEnemy::getDistance() const +{ + return distance; +} + +void TacticTestStandingForwardEnemy::setDistance(int value) +{ + distance = value; +} + +int TacticTestStandingForwardEnemy::getOppRobotIndex() const +{ + return OppRobotIndex; +} + +void TacticTestStandingForwardEnemy::setOppRobotIndex(int value) +{ + OppRobotIndex = value; +} +TacticTestStandingForwardEnemy::TacticTestStandingForwardEnemy(WorldModel *worldmodel, QObject *parent) : + Tactic("TacticTest", worldmodel, parent) +{ +} + +RobotCommand TacticTestStandingForwardEnemy::getCommand(){ + RobotCommand rc; + if(!wm->ourRobot[id].isValid) + return rc; + rcsc::Segment2D line(wm->oppRobot[OppRobotIndex].pos.loc,Field::ourGoalCenter); + rcsc::Circle2D circle(wm->oppRobot[OppRobotIndex].pos.loc,distance); + Vector2D* v1 = new Vector2D(); + Vector2D* v2 = new Vector2D(); + circle.intersection(line,v1,v2); + if((v1->x != 0) && (v1->y != 0)){ + rc.fin_pos.loc.x = v1->x; + rc.fin_pos.loc.y = v1->y; + } + if((v2->x != 0) && (v2->y != 0)){ + rc.fin_pos.loc.x = v2->x; + rc.fin_pos.loc.y = v2->y; + } + rc.useNav = true; + rc.maxSpeed = 3; + return rc; +} diff --git a/src/ai/tactic/tacticteststandingforwardenemy.h b/src/ai/tactic/tacticteststandingforwardenemy.h new file mode 100644 index 0000000..9f81bfd --- /dev/null +++ b/src/ai/tactic/tacticteststandingforwardenemy.h @@ -0,0 +1,25 @@ +#ifndef TACTICTESTSTANDINGFORWARDENEMY_H +#define TACTICTESTSTANDINGFORWARDENEMY_H +#include "tactic.h" +#define DangerDist 300 +#include "geom.h" +#include "constants.h" + +class TacticTestStandingForwardEnemy : public Tactic +{ +private: + //distanse between enemy and ally robot + int distance; + int OppRobotIndex; + Q_OBJECT +public: + TacticTestStandingForwardEnemy(); + explicit TacticTestStandingForwardEnemy(WorldModel *worldmodel, QObject *parent = 0); + virtual RobotCommand getCommand(); + int getDistance() const; + void setDistance(int value); + int getOppRobotIndex() const; + void setOppRobotIndex(int value); +}; + +#endif // TACTICTESTSTANDINGFORWARDENEMY_H diff --git a/src/ai/tactic/taticgoliealihejazi.cpp b/src/ai/tactic/taticgoliealihejazi.cpp new file mode 100644 index 0000000..b161aef --- /dev/null +++ b/src/ai/tactic/taticgoliealihejazi.cpp @@ -0,0 +1,16 @@ +#include "taticgoliealihejazi.h" + +taticgoliealihejazi::taticgoliealihejazi(WorldModel *worldmodel, QObject *parent) : + Tactic("TacticTest", worldmodel, parent) +{ +} + +RobotCommand taticgoliealihejazi::getCommand() +{ + RobotCommand rc; + if(wm->ball.vel.loc.dist(*new Vector2D(0,0)) < 40){ + rc.fin_pos.loc = Vector2D(0,0); + } + return rc; +} + diff --git a/src/ai/tactic/taticgoliealihejazi.h b/src/ai/tactic/taticgoliealihejazi.h new file mode 100644 index 0000000..9924f5c --- /dev/null +++ b/src/ai/tactic/taticgoliealihejazi.h @@ -0,0 +1,13 @@ +#ifndef TATICGOLIEALIHEJAZI_H +#define TATICGOLIEALIHEJAZI_H +#include "tactic.h" + +class taticgoliealihejazi : public Tactic +{ + Q_OBJECT +public: + explicit taticgoliealihejazi(WorldModel *worldmodel, QObject *parent = 0); + virtual RobotCommand getCommand(); +}; + +#endif // TATICGOLIEALIHEJAZI_H diff --git a/src/ai/tactics.h b/src/ai/tactics.h index 50d9d2b..ec1f6f8 100644 --- a/src/ai/tactics.h +++ b/src/ai/tactics.h @@ -21,5 +21,7 @@ #include "tactic/tacticcontrol.h" #include "tactic/tactickicklearning.h" #include "tactic/tacticformation.h" +//seyed ali hejazi +#include "tactic/tacticteststandingforwardenemy.h" #endif // TACTICS_H diff --git a/src/kn2cssl_new.pro b/src/kn2cssl_new.pro index c498e74..d56e284 100644 --- a/src/kn2cssl_new.pro +++ b/src/kn2cssl_new.pro @@ -209,7 +209,13 @@ SOURCES += main.cpp \ ai/skill/skillpassreceive.cpp \ ai/skill/skillonetouch.cpp \ ai/tactic/tacticformation.cpp \ - ai/play/playformations.cpp + ai/play/playformations.cpp \ + ai/tactic/tacticteststandingforwardenemy.cpp \ + ai/play/playhw2_1.cpp \ + ai/play/mantomandefense.cpp \ + ai/tactic/taticgoliealihejazi.cpp \ + ai/skill/shootball.cpp \ + ai/play/playstop_hejazi.cpp HEADERS += \ etc/settings.h \ @@ -354,7 +360,13 @@ HEADERS += \ ai/skill/skillpassreceive.h \ ai/skill/skillonetouch.h \ ai/tactic/tacticformation.h \ - ai/play/playformations.h + ai/play/playformations.h \ + ai/tactic/tacticteststandingforwardenemy.h \ + ai/play/playhw2_1.h \ + ai/play/mantomandefense.h \ + ai/tactic/taticgoliealihejazi.h \ + ai/skill/shootball.h \ + ai/play/playstop_hejazi.h FORMS += ui/mainwindow.ui diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user new file mode 100644 index 0000000..e289cba --- /dev/null +++ b/src/kn2cssl_new.pro.user @@ -0,0 +1,336 @@ + + + + + + EnvironmentId + {ef07ef72-173d-42d4-81ff-ba5650ee6fde} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.7.0 GCC 64bit + Desktop Qt 5.7.0 GCC 64bit + qt.57.gcc_64_kit + 0 + 0 + 0 + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_7_0_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + -l4 -j4 + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_7_0_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_7_0_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + kn2cssl_new + + Qt4ProjectManager.Qt4RunConfiguration:/home/jafar/kn2cPrograms/src/kn2cssl_new.pro + true + + kn2cssl_new.pro + false + + /home/jafar/kn2cPrograms/bin + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/src/kn2cssl_new.pro.user.18 b/src/kn2cssl_new.pro.user.18 new file mode 100644 index 0000000..ac465c8 --- /dev/null +++ b/src/kn2cssl_new.pro.user.18 @@ -0,0 +1,271 @@ + + + + + + EnvironmentId + {ef07ef72-173d-42d4-81ff-ba5650ee6fde} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.5.0 GCC 64bit + Desktop Qt 5.5.0 GCC 64bit + qt.55.gcc_64_kit + 0 + 0 + 0 + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_5_0_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + -j4 -l4 + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_5_0_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + kn2cssl_new + + Qt4ProjectManager.Qt4RunConfiguration:/home/jafar/kn2cPrograms/src/kn2cssl_new.pro + + kn2cssl_new.pro + false + false + + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/src/kn2cssl_new.pro.user.3.2-pre1 b/src/kn2cssl_new.pro.user.3.2-pre1 new file mode 100644 index 0000000..38ef00a --- /dev/null +++ b/src/kn2cssl_new.pro.user.3.2-pre1 @@ -0,0 +1,260 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.2.1 GCC 64bit + Desktop Qt 5.2.1 GCC 64bit + qt.521.gcc_64.essentials_kit + 0 + 0 + 0 + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_2_1_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + -j4 -l4 + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_2_1_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + kn2cssl_new + + Qt4ProjectManager.Qt4RunConfiguration:/home/jafar/kn2cPrograms/src/kn2cssl_new.pro + + kn2cssl_new.pro + false + false + + 3768 + true + false + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {ef07ef72-173d-42d4-81ff-ba5650ee6fde} + + + ProjectExplorer.Project.Updater.FileVersion + 15 + + diff --git a/src/output/controller.cpp b/src/output/controller.cpp old mode 100644 new mode 100755 diff --git a/src/output/controller.h b/src/output/controller.h old mode 100644 new mode 100755 diff --git a/src/output/controller_struct.h b/src/output/controller_struct.h old mode 100644 new mode 100755 diff --git a/src/output/wpacket.cpp b/src/output/wpacket.cpp old mode 100644 new mode 100755 diff --git a/src/output/wpacket.h b/src/output/wpacket.h old mode 100644 new mode 100755 diff --git a/src/proto/Ball_message.pb.cc b/src/proto/Ball_message.pb.cc index 03079e5..9075726 100644 --- a/src/proto/Ball_message.pb.cc +++ b/src/proto/Ball_message.pb.cc @@ -108,6 +108,7 @@ const int Ball_message::kVelocityFieldNumber; Ball_message::Ball_message() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Ball_message) } void Ball_message::InitAsDefaultInstance() { @@ -119,6 +120,7 @@ Ball_message::Ball_message(const Ball_message& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Ball_message) } void Ball_message::SharedCtor() { @@ -130,6 +132,7 @@ void Ball_message::SharedCtor() { } Ball_message::~Ball_message() { + // @@protoc_insertion_point(destructor:Ball_message) SharedDtor(); } @@ -162,7 +165,7 @@ Ball_message* Ball_message::New() const { } void Ball_message::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 7) { isvalid_ = false; if (has_position()) { if (position_ != NULL) position_->::position_message::Clear(); @@ -177,20 +180,23 @@ void Ball_message::Clear() { bool Ball_message::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Ball_message) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required bool isValid = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &isvalid_))); set_has_isvalid(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_position; break; @@ -198,13 +204,12 @@ bool Ball_message::MergePartialFromCodedStream( // required .position_message position = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_position: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_position())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_velocity; break; @@ -212,23 +217,23 @@ bool Ball_message::MergePartialFromCodedStream( // required .position_message velocity = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_velocity: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_velocity())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -236,12 +241,18 @@ bool Ball_message::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Ball_message) return true; +failure: + // @@protoc_insertion_point(parse_failure:Ball_message) + return false; #undef DO_ } void Ball_message::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Ball_message) // required bool isValid = 1; if (has_isvalid()) { ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->isvalid(), output); @@ -263,10 +274,12 @@ void Ball_message::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Ball_message) } ::google::protobuf::uint8* Ball_message::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Ball_message) // required bool isValid = 1; if (has_isvalid()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->isvalid(), target); @@ -290,6 +303,7 @@ ::google::protobuf::uint8* Ball_message::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Ball_message) return target; } diff --git a/src/proto/Ball_message.pb.h b/src/proto/Ball_message.pb.h index 059e7d0..759c39c 100644 --- a/src/proto/Ball_message.pb.h +++ b/src/proto/Ball_message.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -83,7 +83,6 @@ class Ball_message : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -126,13 +125,11 @@ class Ball_message : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::position_message* position_; ::position_message* velocity_; bool isvalid_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_Ball_5fmessage_2eproto(); friend void protobuf_AssignDesc_Ball_5fmessage_2eproto(); friend void protobuf_ShutdownFile_Ball_5fmessage_2eproto(); @@ -162,11 +159,13 @@ inline void Ball_message::clear_isvalid() { clear_has_isvalid(); } inline bool Ball_message::isvalid() const { + // @@protoc_insertion_point(field_get:Ball_message.isValid) return isvalid_; } inline void Ball_message::set_isvalid(bool value) { set_has_isvalid(); isvalid_ = value; + // @@protoc_insertion_point(field_set:Ball_message.isValid) } // required .position_message position = 2; @@ -184,11 +183,13 @@ inline void Ball_message::clear_position() { clear_has_position(); } inline const ::position_message& Ball_message::position() const { + // @@protoc_insertion_point(field_get:Ball_message.position) return position_ != NULL ? *position_ : *default_instance_->position_; } inline ::position_message* Ball_message::mutable_position() { set_has_position(); if (position_ == NULL) position_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:Ball_message.position) return position_; } inline ::position_message* Ball_message::release_position() { @@ -205,6 +206,7 @@ inline void Ball_message::set_allocated_position(::position_message* position) { } else { clear_has_position(); } + // @@protoc_insertion_point(field_set_allocated:Ball_message.position) } // required .position_message velocity = 3; @@ -222,11 +224,13 @@ inline void Ball_message::clear_velocity() { clear_has_velocity(); } inline const ::position_message& Ball_message::velocity() const { + // @@protoc_insertion_point(field_get:Ball_message.velocity) return velocity_ != NULL ? *velocity_ : *default_instance_->velocity_; } inline ::position_message* Ball_message::mutable_velocity() { set_has_velocity(); if (velocity_ == NULL) velocity_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:Ball_message.velocity) return velocity_; } inline ::position_message* Ball_message::release_velocity() { @@ -243,6 +247,7 @@ inline void Ball_message::set_allocated_velocity(::position_message* velocity) { } else { clear_has_velocity(); } + // @@protoc_insertion_point(field_set_allocated:Ball_message.velocity) } diff --git a/src/proto/RobotCommand_message.pb.cc b/src/proto/RobotCommand_message.pb.cc index 5cbc3b2..e204c10 100644 --- a/src/proto/RobotCommand_message.pb.cc +++ b/src/proto/RobotCommand_message.pb.cc @@ -121,6 +121,7 @@ const int RobotCommand_message::kIsKickObsFieldNumber; RobotCommand_message::RobotCommand_message() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:RobotCommand_message) } void RobotCommand_message::InitAsDefaultInstance() { @@ -132,6 +133,7 @@ RobotCommand_message::RobotCommand_message(const RobotCommand_message& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:RobotCommand_message) } void RobotCommand_message::SharedCtor() { @@ -148,6 +150,7 @@ void RobotCommand_message::SharedCtor() { } RobotCommand_message::~RobotCommand_message() { + // @@protoc_insertion_point(destructor:RobotCommand_message) SharedDtor(); } @@ -180,38 +183,50 @@ RobotCommand_message* RobotCommand_message::New() const { } void RobotCommand_message::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(maxspeed_, iskickobs_); if (has_fin_pos()) { if (fin_pos_ != NULL) fin_pos_->::position_message::Clear(); } if (has_fin_vel()) { if (fin_vel_ != NULL) fin_vel_->::position_message::Clear(); } - maxspeed_ = 0; - kickspeedx_ = 0; - kickspeedz_ = 0; - usenav_ = false; - isballobs_ = false; - iskickobs_ = false; } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool RobotCommand_message::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:RobotCommand_message) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required .position_message fin_pos = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_fin_pos())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_fin_vel; break; @@ -219,13 +234,12 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required .position_message fin_vel = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_fin_vel: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_fin_vel())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_maxSpeed; break; @@ -233,15 +247,14 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required float maxSpeed = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_maxSpeed: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &maxspeed_))); set_has_maxspeed(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_kickspeedx; break; @@ -249,15 +262,14 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required float kickspeedx = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_kickspeedx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &kickspeedx_))); set_has_kickspeedx(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_kickspeedz; break; @@ -265,15 +277,14 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required float kickspeedz = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_kickspeedz: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &kickspeedz_))); set_has_kickspeedz(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(48)) goto parse_useNav; break; @@ -281,15 +292,14 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required bool useNav = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 48) { parse_useNav: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &usenav_))); set_has_usenav(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(56)) goto parse_isBallObs; break; @@ -297,15 +307,14 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required bool isBallObs = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 56) { parse_isBallObs: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &isballobs_))); set_has_isballobs(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(64)) goto parse_isKickObs; break; @@ -313,25 +322,25 @@ bool RobotCommand_message::MergePartialFromCodedStream( // required bool isKickObs = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 64) { parse_isKickObs: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &iskickobs_))); set_has_iskickobs(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -339,12 +348,18 @@ bool RobotCommand_message::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:RobotCommand_message) return true; +failure: + // @@protoc_insertion_point(parse_failure:RobotCommand_message) + return false; #undef DO_ } void RobotCommand_message::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:RobotCommand_message) // required .position_message fin_pos = 1; if (has_fin_pos()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -391,10 +406,12 @@ void RobotCommand_message::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:RobotCommand_message) } ::google::protobuf::uint8* RobotCommand_message::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:RobotCommand_message) // required .position_message fin_pos = 1; if (has_fin_pos()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -443,6 +460,7 @@ ::google::protobuf::uint8* RobotCommand_message::SerializeWithCachedSizesToArray target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:RobotCommand_message) return target; } diff --git a/src/proto/RobotCommand_message.pb.h b/src/proto/RobotCommand_message.pb.h index 6a1acc5..3a296c0 100644 --- a/src/proto/RobotCommand_message.pb.h +++ b/src/proto/RobotCommand_message.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -83,7 +83,6 @@ class RobotCommand_message : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -171,6 +170,8 @@ class RobotCommand_message : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::position_message* fin_pos_; ::position_message* fin_vel_; float maxspeed_; @@ -179,10 +180,6 @@ class RobotCommand_message : public ::google::protobuf::Message { bool usenav_; bool isballobs_; bool iskickobs_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; - friend void protobuf_AddDesc_RobotCommand_5fmessage_2eproto(); friend void protobuf_AssignDesc_RobotCommand_5fmessage_2eproto(); friend void protobuf_ShutdownFile_RobotCommand_5fmessage_2eproto(); @@ -212,11 +209,13 @@ inline void RobotCommand_message::clear_fin_pos() { clear_has_fin_pos(); } inline const ::position_message& RobotCommand_message::fin_pos() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.fin_pos) return fin_pos_ != NULL ? *fin_pos_ : *default_instance_->fin_pos_; } inline ::position_message* RobotCommand_message::mutable_fin_pos() { set_has_fin_pos(); if (fin_pos_ == NULL) fin_pos_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:RobotCommand_message.fin_pos) return fin_pos_; } inline ::position_message* RobotCommand_message::release_fin_pos() { @@ -233,6 +232,7 @@ inline void RobotCommand_message::set_allocated_fin_pos(::position_message* fin_ } else { clear_has_fin_pos(); } + // @@protoc_insertion_point(field_set_allocated:RobotCommand_message.fin_pos) } // required .position_message fin_vel = 2; @@ -250,11 +250,13 @@ inline void RobotCommand_message::clear_fin_vel() { clear_has_fin_vel(); } inline const ::position_message& RobotCommand_message::fin_vel() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.fin_vel) return fin_vel_ != NULL ? *fin_vel_ : *default_instance_->fin_vel_; } inline ::position_message* RobotCommand_message::mutable_fin_vel() { set_has_fin_vel(); if (fin_vel_ == NULL) fin_vel_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:RobotCommand_message.fin_vel) return fin_vel_; } inline ::position_message* RobotCommand_message::release_fin_vel() { @@ -271,6 +273,7 @@ inline void RobotCommand_message::set_allocated_fin_vel(::position_message* fin_ } else { clear_has_fin_vel(); } + // @@protoc_insertion_point(field_set_allocated:RobotCommand_message.fin_vel) } // required float maxSpeed = 3; @@ -288,11 +291,13 @@ inline void RobotCommand_message::clear_maxspeed() { clear_has_maxspeed(); } inline float RobotCommand_message::maxspeed() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.maxSpeed) return maxspeed_; } inline void RobotCommand_message::set_maxspeed(float value) { set_has_maxspeed(); maxspeed_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.maxSpeed) } // required float kickspeedx = 4; @@ -310,11 +315,13 @@ inline void RobotCommand_message::clear_kickspeedx() { clear_has_kickspeedx(); } inline float RobotCommand_message::kickspeedx() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.kickspeedx) return kickspeedx_; } inline void RobotCommand_message::set_kickspeedx(float value) { set_has_kickspeedx(); kickspeedx_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.kickspeedx) } // required float kickspeedz = 5; @@ -332,11 +339,13 @@ inline void RobotCommand_message::clear_kickspeedz() { clear_has_kickspeedz(); } inline float RobotCommand_message::kickspeedz() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.kickspeedz) return kickspeedz_; } inline void RobotCommand_message::set_kickspeedz(float value) { set_has_kickspeedz(); kickspeedz_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.kickspeedz) } // required bool useNav = 6; @@ -354,11 +363,13 @@ inline void RobotCommand_message::clear_usenav() { clear_has_usenav(); } inline bool RobotCommand_message::usenav() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.useNav) return usenav_; } inline void RobotCommand_message::set_usenav(bool value) { set_has_usenav(); usenav_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.useNav) } // required bool isBallObs = 7; @@ -376,11 +387,13 @@ inline void RobotCommand_message::clear_isballobs() { clear_has_isballobs(); } inline bool RobotCommand_message::isballobs() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.isBallObs) return isballobs_; } inline void RobotCommand_message::set_isballobs(bool value) { set_has_isballobs(); isballobs_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.isBallObs) } // required bool isKickObs = 8; @@ -398,11 +411,13 @@ inline void RobotCommand_message::clear_iskickobs() { clear_has_iskickobs(); } inline bool RobotCommand_message::iskickobs() const { + // @@protoc_insertion_point(field_get:RobotCommand_message.isKickObs) return iskickobs_; } inline void RobotCommand_message::set_iskickobs(bool value) { set_has_iskickobs(); iskickobs_ = value; + // @@protoc_insertion_point(field_set:RobotCommand_message.isKickObs) } diff --git a/src/proto/Robot_message.pb.cc b/src/proto/Robot_message.pb.cc index 005b78b..1abb9aa 100644 --- a/src/proto/Robot_message.pb.cc +++ b/src/proto/Robot_message.pb.cc @@ -245,6 +245,7 @@ const int Robot_message::kRcFieldNumber; Robot_message::Robot_message() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Robot_message) } void Robot_message::InitAsDefaultInstance() { @@ -257,6 +258,7 @@ Robot_message::Robot_message(const Robot_message& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Robot_message) } void Robot_message::SharedCtor() { @@ -272,6 +274,7 @@ void Robot_message::SharedCtor() { } Robot_message::~Robot_message() { + // @@protoc_insertion_point(destructor:Robot_message) SharedDtor(); } @@ -305,7 +308,7 @@ Robot_message* Robot_message::New() const { } void Robot_message::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 127) { isvalid_ = false; if (has_position()) { if (position_ != NULL) position_->::position_message::Clear(); @@ -326,20 +329,23 @@ void Robot_message::Clear() { bool Robot_message::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Robot_message) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required bool isValid = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &isvalid_))); set_has_isvalid(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_position; break; @@ -347,13 +353,12 @@ bool Robot_message::MergePartialFromCodedStream( // required .position_message position = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_position: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_position())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_velocity; break; @@ -361,13 +366,12 @@ bool Robot_message::MergePartialFromCodedStream( // required .position_message velocity = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_velocity: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_velocity())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_status; break; @@ -375,8 +379,7 @@ bool Robot_message::MergePartialFromCodedStream( // optional .Robot_message.AgentStatus status = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_status: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< @@ -388,7 +391,7 @@ bool Robot_message::MergePartialFromCodedStream( mutable_unknown_fields()->AddVarint(4, value); } } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_role; break; @@ -396,8 +399,7 @@ bool Robot_message::MergePartialFromCodedStream( // optional .Robot_message.AgentRole role = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_role: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< @@ -409,7 +411,7 @@ bool Robot_message::MergePartialFromCodedStream( mutable_unknown_fields()->AddVarint(5, value); } } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(48)) goto parse_region; break; @@ -417,8 +419,7 @@ bool Robot_message::MergePartialFromCodedStream( // optional .Robot_message.AgentRegion region = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 48) { parse_region: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< @@ -430,7 +431,7 @@ bool Robot_message::MergePartialFromCodedStream( mutable_unknown_fields()->AddVarint(6, value); } } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(58)) goto parse_rc; break; @@ -438,23 +439,23 @@ bool Robot_message::MergePartialFromCodedStream( // optional .RobotCommand_message rc = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 58) { parse_rc: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_rc())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -462,12 +463,18 @@ bool Robot_message::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Robot_message) return true; +failure: + // @@protoc_insertion_point(parse_failure:Robot_message) + return false; #undef DO_ } void Robot_message::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Robot_message) // required bool isValid = 1; if (has_isvalid()) { ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->isvalid(), output); @@ -513,10 +520,12 @@ void Robot_message::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Robot_message) } ::google::protobuf::uint8* Robot_message::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Robot_message) // required bool isValid = 1; if (has_isvalid()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->isvalid(), target); @@ -565,6 +574,7 @@ ::google::protobuf::uint8* Robot_message::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Robot_message) return target; } diff --git a/src/proto/Robot_message.pb.h b/src/proto/Robot_message.pb.h index 66ae584..6a5d3ab 100644 --- a/src/proto/Robot_message.pb.h +++ b/src/proto/Robot_message.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -163,7 +163,6 @@ class Robot_message : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -337,6 +336,8 @@ class Robot_message : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::position_message* position_; bool isvalid_; int status_; @@ -344,10 +345,6 @@ class Robot_message : public ::google::protobuf::Message { int role_; int region_; ::RobotCommand_message* rc_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; - friend void protobuf_AddDesc_Robot_5fmessage_2eproto(); friend void protobuf_AssignDesc_Robot_5fmessage_2eproto(); friend void protobuf_ShutdownFile_Robot_5fmessage_2eproto(); @@ -377,11 +374,13 @@ inline void Robot_message::clear_isvalid() { clear_has_isvalid(); } inline bool Robot_message::isvalid() const { + // @@protoc_insertion_point(field_get:Robot_message.isValid) return isvalid_; } inline void Robot_message::set_isvalid(bool value) { set_has_isvalid(); isvalid_ = value; + // @@protoc_insertion_point(field_set:Robot_message.isValid) } // required .position_message position = 2; @@ -399,11 +398,13 @@ inline void Robot_message::clear_position() { clear_has_position(); } inline const ::position_message& Robot_message::position() const { + // @@protoc_insertion_point(field_get:Robot_message.position) return position_ != NULL ? *position_ : *default_instance_->position_; } inline ::position_message* Robot_message::mutable_position() { set_has_position(); if (position_ == NULL) position_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:Robot_message.position) return position_; } inline ::position_message* Robot_message::release_position() { @@ -420,6 +421,7 @@ inline void Robot_message::set_allocated_position(::position_message* position) } else { clear_has_position(); } + // @@protoc_insertion_point(field_set_allocated:Robot_message.position) } // required .position_message velocity = 3; @@ -437,11 +439,13 @@ inline void Robot_message::clear_velocity() { clear_has_velocity(); } inline const ::position_message& Robot_message::velocity() const { + // @@protoc_insertion_point(field_get:Robot_message.velocity) return velocity_ != NULL ? *velocity_ : *default_instance_->velocity_; } inline ::position_message* Robot_message::mutable_velocity() { set_has_velocity(); if (velocity_ == NULL) velocity_ = new ::position_message; + // @@protoc_insertion_point(field_mutable:Robot_message.velocity) return velocity_; } inline ::position_message* Robot_message::release_velocity() { @@ -458,6 +462,7 @@ inline void Robot_message::set_allocated_velocity(::position_message* velocity) } else { clear_has_velocity(); } + // @@protoc_insertion_point(field_set_allocated:Robot_message.velocity) } // optional .Robot_message.AgentStatus status = 4; @@ -475,12 +480,14 @@ inline void Robot_message::clear_status() { clear_has_status(); } inline ::Robot_message_AgentStatus Robot_message::status() const { + // @@protoc_insertion_point(field_get:Robot_message.status) return static_cast< ::Robot_message_AgentStatus >(status_); } inline void Robot_message::set_status(::Robot_message_AgentStatus value) { assert(::Robot_message_AgentStatus_IsValid(value)); set_has_status(); status_ = value; + // @@protoc_insertion_point(field_set:Robot_message.status) } // optional .Robot_message.AgentRole role = 5; @@ -498,12 +505,14 @@ inline void Robot_message::clear_role() { clear_has_role(); } inline ::Robot_message_AgentRole Robot_message::role() const { + // @@protoc_insertion_point(field_get:Robot_message.role) return static_cast< ::Robot_message_AgentRole >(role_); } inline void Robot_message::set_role(::Robot_message_AgentRole value) { assert(::Robot_message_AgentRole_IsValid(value)); set_has_role(); role_ = value; + // @@protoc_insertion_point(field_set:Robot_message.role) } // optional .Robot_message.AgentRegion region = 6; @@ -521,12 +530,14 @@ inline void Robot_message::clear_region() { clear_has_region(); } inline ::Robot_message_AgentRegion Robot_message::region() const { + // @@protoc_insertion_point(field_get:Robot_message.region) return static_cast< ::Robot_message_AgentRegion >(region_); } inline void Robot_message::set_region(::Robot_message_AgentRegion value) { assert(::Robot_message_AgentRegion_IsValid(value)); set_has_region(); region_ = value; + // @@protoc_insertion_point(field_set:Robot_message.region) } // optional .RobotCommand_message rc = 7; @@ -544,11 +555,13 @@ inline void Robot_message::clear_rc() { clear_has_rc(); } inline const ::RobotCommand_message& Robot_message::rc() const { + // @@protoc_insertion_point(field_get:Robot_message.rc) return rc_ != NULL ? *rc_ : *default_instance_->rc_; } inline ::RobotCommand_message* Robot_message::mutable_rc() { set_has_rc(); if (rc_ == NULL) rc_ = new ::RobotCommand_message; + // @@protoc_insertion_point(field_mutable:Robot_message.rc) return rc_; } inline ::RobotCommand_message* Robot_message::release_rc() { @@ -565,6 +578,7 @@ inline void Robot_message::set_allocated_rc(::RobotCommand_message* rc) { } else { clear_has_rc(); } + // @@protoc_insertion_point(field_set_allocated:Robot_message.rc) } @@ -574,14 +588,17 @@ inline void Robot_message::set_allocated_rc(::RobotCommand_message* rc) { namespace google { namespace protobuf { +template <> struct is_proto_enum< ::Robot_message_AgentStatus> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::Robot_message_AgentStatus>() { return ::Robot_message_AgentStatus_descriptor(); } +template <> struct is_proto_enum< ::Robot_message_AgentRegion> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::Robot_message_AgentRegion>() { return ::Robot_message_AgentRegion_descriptor(); } +template <> struct is_proto_enum< ::Robot_message_AgentRole> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::Robot_message_AgentRole>() { return ::Robot_message_AgentRole_descriptor(); diff --git a/src/proto/grSim_Commands.pb.cc b/src/proto/grSim_Commands.pb.cc index e8e69b1..bafc327 100644 --- a/src/proto/grSim_Commands.pb.cc +++ b/src/proto/grSim_Commands.pb.cc @@ -157,6 +157,7 @@ const int grSim_Robot_Command::kWheel4FieldNumber; grSim_Robot_Command::grSim_Robot_Command() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_Robot_Command) } void grSim_Robot_Command::InitAsDefaultInstance() { @@ -166,6 +167,7 @@ grSim_Robot_Command::grSim_Robot_Command(const grSim_Robot_Command& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_Robot_Command) } void grSim_Robot_Command::SharedCtor() { @@ -186,6 +188,7 @@ void grSim_Robot_Command::SharedCtor() { } grSim_Robot_Command::~grSim_Robot_Command() { + // @@protoc_insertion_point(destructor:grSim_Robot_Command) SharedDtor(); } @@ -216,42 +219,47 @@ grSim_Robot_Command* grSim_Robot_Command::New() const { } void grSim_Robot_Command::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - id_ = 0u; - kickspeedx_ = 0; - kickspeedz_ = 0; - veltangent_ = 0; - velnormal_ = 0; - velangular_ = 0; - spinner_ = false; - wheelsspeed_ = false; - } - if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { - wheel1_ = 0; - wheel2_ = 0; - wheel3_ = 0; - wheel4_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(id_, wheelsspeed_); } + ZR_(wheel1_, wheel4_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool grSim_Robot_Command::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_Robot_Command) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint32 id = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &id_))); set_has_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(21)) goto parse_kickspeedx; break; @@ -259,15 +267,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required float kickspeedx = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 21) { parse_kickspeedx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &kickspeedx_))); set_has_kickspeedx(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_kickspeedz; break; @@ -275,15 +282,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required float kickspeedz = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_kickspeedz: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &kickspeedz_))); set_has_kickspeedz(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_veltangent; break; @@ -291,15 +297,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required float veltangent = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_veltangent: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &veltangent_))); set_has_veltangent(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_velnormal; break; @@ -307,15 +312,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required float velnormal = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_velnormal: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &velnormal_))); set_has_velnormal(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(53)) goto parse_velangular; break; @@ -323,15 +327,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required float velangular = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 53) { parse_velangular: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &velangular_))); set_has_velangular(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(56)) goto parse_spinner; break; @@ -339,15 +342,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required bool spinner = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 56) { parse_spinner: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &spinner_))); set_has_spinner(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(64)) goto parse_wheelsspeed; break; @@ -355,15 +357,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // required bool wheelsspeed = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 64) { parse_wheelsspeed: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &wheelsspeed_))); set_has_wheelsspeed(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(77)) goto parse_wheel1; break; @@ -371,15 +372,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // optional float wheel1 = 9; case 9: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 77) { parse_wheel1: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &wheel1_))); set_has_wheel1(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(85)) goto parse_wheel2; break; @@ -387,15 +387,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // optional float wheel2 = 10; case 10: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 85) { parse_wheel2: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &wheel2_))); set_has_wheel2(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(93)) goto parse_wheel3; break; @@ -403,15 +402,14 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // optional float wheel3 = 11; case 11: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 93) { parse_wheel3: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &wheel3_))); set_has_wheel3(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(101)) goto parse_wheel4; break; @@ -419,25 +417,25 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( // optional float wheel4 = 12; case 12: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 101) { parse_wheel4: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &wheel4_))); set_has_wheel4(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -445,12 +443,18 @@ bool grSim_Robot_Command::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_Robot_Command) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_Robot_Command) + return false; #undef DO_ } void grSim_Robot_Command::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_Robot_Command) // required uint32 id = 1; if (has_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->id(), output); @@ -515,10 +519,12 @@ void grSim_Robot_Command::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_Robot_Command) } ::google::protobuf::uint8* grSim_Robot_Command::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_Robot_Command) // required uint32 id = 1; if (has_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->id(), target); @@ -583,6 +589,7 @@ ::google::protobuf::uint8* grSim_Robot_Command::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_Robot_Command) return target; } @@ -781,6 +788,7 @@ const int grSim_Commands::kRobotCommandsFieldNumber; grSim_Commands::grSim_Commands() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_Commands) } void grSim_Commands::InitAsDefaultInstance() { @@ -790,6 +798,7 @@ grSim_Commands::grSim_Commands(const grSim_Commands& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_Commands) } void grSim_Commands::SharedCtor() { @@ -800,6 +809,7 @@ void grSim_Commands::SharedCtor() { } grSim_Commands::~grSim_Commands() { + // @@protoc_insertion_point(destructor:grSim_Commands) SharedDtor(); } @@ -830,7 +840,7 @@ grSim_Commands* grSim_Commands::New() const { } void grSim_Commands::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { timestamp_ = 0; isteamyellow_ = false; } @@ -841,20 +851,23 @@ void grSim_Commands::Clear() { bool grSim_Commands::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_Commands) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required double timestamp = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, ×tamp_))); set_has_timestamp(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_isteamyellow; break; @@ -862,15 +875,14 @@ bool grSim_Commands::MergePartialFromCodedStream( // required bool isteamyellow = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_isteamyellow: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &isteamyellow_))); set_has_isteamyellow(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_robot_commands; break; @@ -878,24 +890,24 @@ bool grSim_Commands::MergePartialFromCodedStream( // repeated .grSim_Robot_Command robot_commands = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_robot_commands: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_robot_commands())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_robot_commands; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -903,12 +915,18 @@ bool grSim_Commands::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_Commands) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_Commands) + return false; #undef DO_ } void grSim_Commands::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_Commands) // required double timestamp = 1; if (has_timestamp()) { ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->timestamp(), output); @@ -929,10 +947,12 @@ void grSim_Commands::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_Commands) } ::google::protobuf::uint8* grSim_Commands::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_Commands) // required double timestamp = 1; if (has_timestamp()) { target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->timestamp(), target); @@ -954,6 +974,7 @@ ::google::protobuf::uint8* grSim_Commands::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_Commands) return target; } @@ -1032,9 +1053,7 @@ void grSim_Commands::CopyFrom(const grSim_Commands& from) { bool grSim_Commands::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; - for (int i = 0; i < robot_commands_size(); i++) { - if (!this->robot_commands(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->robot_commands())) return false; return true; } diff --git a/src/proto/grSim_Commands.pb.h b/src/proto/grSim_Commands.pb.h index e051035..e555f74 100644 --- a/src/proto/grSim_Commands.pb.h +++ b/src/proto/grSim_Commands.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -83,7 +83,6 @@ class grSim_Robot_Command : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -203,6 +202,8 @@ class grSim_Robot_Command : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::uint32 id_; float kickspeedx_; float kickspeedz_; @@ -215,10 +216,6 @@ class grSim_Robot_Command : public ::google::protobuf::Message { float wheel2_; float wheel3_; float wheel4_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(12 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fCommands_2eproto(); friend void protobuf_AssignDesc_grSim_5fCommands_2eproto(); friend void protobuf_ShutdownFile_grSim_5fCommands_2eproto(); @@ -275,7 +272,6 @@ class grSim_Commands : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -317,13 +313,11 @@ class grSim_Commands : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; double timestamp_; ::google::protobuf::RepeatedPtrField< ::grSim_Robot_Command > robot_commands_; bool isteamyellow_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fCommands_2eproto(); friend void protobuf_AssignDesc_grSim_5fCommands_2eproto(); friend void protobuf_ShutdownFile_grSim_5fCommands_2eproto(); @@ -353,11 +347,13 @@ inline void grSim_Robot_Command::clear_id() { clear_has_id(); } inline ::google::protobuf::uint32 grSim_Robot_Command::id() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.id) return id_; } inline void grSim_Robot_Command::set_id(::google::protobuf::uint32 value) { set_has_id(); id_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.id) } // required float kickspeedx = 2; @@ -375,11 +371,13 @@ inline void grSim_Robot_Command::clear_kickspeedx() { clear_has_kickspeedx(); } inline float grSim_Robot_Command::kickspeedx() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.kickspeedx) return kickspeedx_; } inline void grSim_Robot_Command::set_kickspeedx(float value) { set_has_kickspeedx(); kickspeedx_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.kickspeedx) } // required float kickspeedz = 3; @@ -397,11 +395,13 @@ inline void grSim_Robot_Command::clear_kickspeedz() { clear_has_kickspeedz(); } inline float grSim_Robot_Command::kickspeedz() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.kickspeedz) return kickspeedz_; } inline void grSim_Robot_Command::set_kickspeedz(float value) { set_has_kickspeedz(); kickspeedz_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.kickspeedz) } // required float veltangent = 4; @@ -419,11 +419,13 @@ inline void grSim_Robot_Command::clear_veltangent() { clear_has_veltangent(); } inline float grSim_Robot_Command::veltangent() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.veltangent) return veltangent_; } inline void grSim_Robot_Command::set_veltangent(float value) { set_has_veltangent(); veltangent_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.veltangent) } // required float velnormal = 5; @@ -441,11 +443,13 @@ inline void grSim_Robot_Command::clear_velnormal() { clear_has_velnormal(); } inline float grSim_Robot_Command::velnormal() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.velnormal) return velnormal_; } inline void grSim_Robot_Command::set_velnormal(float value) { set_has_velnormal(); velnormal_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.velnormal) } // required float velangular = 6; @@ -463,11 +467,13 @@ inline void grSim_Robot_Command::clear_velangular() { clear_has_velangular(); } inline float grSim_Robot_Command::velangular() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.velangular) return velangular_; } inline void grSim_Robot_Command::set_velangular(float value) { set_has_velangular(); velangular_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.velangular) } // required bool spinner = 7; @@ -485,11 +491,13 @@ inline void grSim_Robot_Command::clear_spinner() { clear_has_spinner(); } inline bool grSim_Robot_Command::spinner() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.spinner) return spinner_; } inline void grSim_Robot_Command::set_spinner(bool value) { set_has_spinner(); spinner_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.spinner) } // required bool wheelsspeed = 8; @@ -507,11 +515,13 @@ inline void grSim_Robot_Command::clear_wheelsspeed() { clear_has_wheelsspeed(); } inline bool grSim_Robot_Command::wheelsspeed() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.wheelsspeed) return wheelsspeed_; } inline void grSim_Robot_Command::set_wheelsspeed(bool value) { set_has_wheelsspeed(); wheelsspeed_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.wheelsspeed) } // optional float wheel1 = 9; @@ -529,11 +539,13 @@ inline void grSim_Robot_Command::clear_wheel1() { clear_has_wheel1(); } inline float grSim_Robot_Command::wheel1() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.wheel1) return wheel1_; } inline void grSim_Robot_Command::set_wheel1(float value) { set_has_wheel1(); wheel1_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.wheel1) } // optional float wheel2 = 10; @@ -551,11 +563,13 @@ inline void grSim_Robot_Command::clear_wheel2() { clear_has_wheel2(); } inline float grSim_Robot_Command::wheel2() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.wheel2) return wheel2_; } inline void grSim_Robot_Command::set_wheel2(float value) { set_has_wheel2(); wheel2_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.wheel2) } // optional float wheel3 = 11; @@ -573,11 +587,13 @@ inline void grSim_Robot_Command::clear_wheel3() { clear_has_wheel3(); } inline float grSim_Robot_Command::wheel3() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.wheel3) return wheel3_; } inline void grSim_Robot_Command::set_wheel3(float value) { set_has_wheel3(); wheel3_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.wheel3) } // optional float wheel4 = 12; @@ -595,11 +611,13 @@ inline void grSim_Robot_Command::clear_wheel4() { clear_has_wheel4(); } inline float grSim_Robot_Command::wheel4() const { + // @@protoc_insertion_point(field_get:grSim_Robot_Command.wheel4) return wheel4_; } inline void grSim_Robot_Command::set_wheel4(float value) { set_has_wheel4(); wheel4_ = value; + // @@protoc_insertion_point(field_set:grSim_Robot_Command.wheel4) } // ------------------------------------------------------------------- @@ -621,11 +639,13 @@ inline void grSim_Commands::clear_timestamp() { clear_has_timestamp(); } inline double grSim_Commands::timestamp() const { + // @@protoc_insertion_point(field_get:grSim_Commands.timestamp) return timestamp_; } inline void grSim_Commands::set_timestamp(double value) { set_has_timestamp(); timestamp_ = value; + // @@protoc_insertion_point(field_set:grSim_Commands.timestamp) } // required bool isteamyellow = 2; @@ -643,11 +663,13 @@ inline void grSim_Commands::clear_isteamyellow() { clear_has_isteamyellow(); } inline bool grSim_Commands::isteamyellow() const { + // @@protoc_insertion_point(field_get:grSim_Commands.isteamyellow) return isteamyellow_; } inline void grSim_Commands::set_isteamyellow(bool value) { set_has_isteamyellow(); isteamyellow_ = value; + // @@protoc_insertion_point(field_set:grSim_Commands.isteamyellow) } // repeated .grSim_Robot_Command robot_commands = 3; @@ -658,20 +680,25 @@ inline void grSim_Commands::clear_robot_commands() { robot_commands_.Clear(); } inline const ::grSim_Robot_Command& grSim_Commands::robot_commands(int index) const { + // @@protoc_insertion_point(field_get:grSim_Commands.robot_commands) return robot_commands_.Get(index); } inline ::grSim_Robot_Command* grSim_Commands::mutable_robot_commands(int index) { + // @@protoc_insertion_point(field_mutable:grSim_Commands.robot_commands) return robot_commands_.Mutable(index); } inline ::grSim_Robot_Command* grSim_Commands::add_robot_commands() { + // @@protoc_insertion_point(field_add:grSim_Commands.robot_commands) return robot_commands_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::grSim_Robot_Command >& grSim_Commands::robot_commands() const { + // @@protoc_insertion_point(field_list:grSim_Commands.robot_commands) return robot_commands_; } inline ::google::protobuf::RepeatedPtrField< ::grSim_Robot_Command >* grSim_Commands::mutable_robot_commands() { + // @@protoc_insertion_point(field_mutable_list:grSim_Commands.robot_commands) return &robot_commands_; } diff --git a/src/proto/grSim_Packet.pb.cc b/src/proto/grSim_Packet.pb.cc index b1cf8a6..ddec27e 100644 --- a/src/proto/grSim_Packet.pb.cc +++ b/src/proto/grSim_Packet.pb.cc @@ -107,6 +107,7 @@ const int grSim_Packet::kReplacementFieldNumber; grSim_Packet::grSim_Packet() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_Packet) } void grSim_Packet::InitAsDefaultInstance() { @@ -118,6 +119,7 @@ grSim_Packet::grSim_Packet(const grSim_Packet& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_Packet) } void grSim_Packet::SharedCtor() { @@ -128,6 +130,7 @@ void grSim_Packet::SharedCtor() { } grSim_Packet::~grSim_Packet() { + // @@protoc_insertion_point(destructor:grSim_Packet) SharedDtor(); } @@ -160,7 +163,7 @@ grSim_Packet* grSim_Packet::New() const { } void grSim_Packet::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { if (has_commands()) { if (commands_ != NULL) commands_->::grSim_Commands::Clear(); } @@ -174,18 +177,21 @@ void grSim_Packet::Clear() { bool grSim_Packet::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_Packet) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .grSim_Commands commands = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_commands())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_replacement; break; @@ -193,23 +199,23 @@ bool grSim_Packet::MergePartialFromCodedStream( // optional .grSim_Replacement replacement = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_replacement: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_replacement())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -217,12 +223,18 @@ bool grSim_Packet::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_Packet) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_Packet) + return false; #undef DO_ } void grSim_Packet::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_Packet) // optional .grSim_Commands commands = 1; if (has_commands()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -239,10 +251,12 @@ void grSim_Packet::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_Packet) } ::google::protobuf::uint8* grSim_Packet::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_Packet) // optional .grSim_Commands commands = 1; if (has_commands()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -261,6 +275,7 @@ ::google::protobuf::uint8* grSim_Packet::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_Packet) return target; } diff --git a/src/proto/grSim_Packet.pb.h b/src/proto/grSim_Packet.pb.h index 7012587..9a3d98d 100644 --- a/src/proto/grSim_Packet.pb.h +++ b/src/proto/grSim_Packet.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class grSim_Packet : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -118,12 +117,10 @@ class grSim_Packet : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::grSim_Commands* commands_; ::grSim_Replacement* replacement_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fPacket_2eproto(); friend void protobuf_AssignDesc_grSim_5fPacket_2eproto(); friend void protobuf_ShutdownFile_grSim_5fPacket_2eproto(); @@ -153,11 +150,13 @@ inline void grSim_Packet::clear_commands() { clear_has_commands(); } inline const ::grSim_Commands& grSim_Packet::commands() const { + // @@protoc_insertion_point(field_get:grSim_Packet.commands) return commands_ != NULL ? *commands_ : *default_instance_->commands_; } inline ::grSim_Commands* grSim_Packet::mutable_commands() { set_has_commands(); if (commands_ == NULL) commands_ = new ::grSim_Commands; + // @@protoc_insertion_point(field_mutable:grSim_Packet.commands) return commands_; } inline ::grSim_Commands* grSim_Packet::release_commands() { @@ -174,6 +173,7 @@ inline void grSim_Packet::set_allocated_commands(::grSim_Commands* commands) { } else { clear_has_commands(); } + // @@protoc_insertion_point(field_set_allocated:grSim_Packet.commands) } // optional .grSim_Replacement replacement = 2; @@ -191,11 +191,13 @@ inline void grSim_Packet::clear_replacement() { clear_has_replacement(); } inline const ::grSim_Replacement& grSim_Packet::replacement() const { + // @@protoc_insertion_point(field_get:grSim_Packet.replacement) return replacement_ != NULL ? *replacement_ : *default_instance_->replacement_; } inline ::grSim_Replacement* grSim_Packet::mutable_replacement() { set_has_replacement(); if (replacement_ == NULL) replacement_ = new ::grSim_Replacement; + // @@protoc_insertion_point(field_mutable:grSim_Packet.replacement) return replacement_; } inline ::grSim_Replacement* grSim_Packet::release_replacement() { @@ -212,6 +214,7 @@ inline void grSim_Packet::set_allocated_replacement(::grSim_Replacement* replace } else { clear_has_replacement(); } + // @@protoc_insertion_point(field_set_allocated:grSim_Packet.replacement) } diff --git a/src/proto/grSim_Replacement.pb.cc b/src/proto/grSim_Replacement.pb.cc index 5e5f2e2..d0f2796 100644 --- a/src/proto/grSim_Replacement.pb.cc +++ b/src/proto/grSim_Replacement.pb.cc @@ -167,6 +167,7 @@ const int grSim_RobotReplacement::kYellowteamFieldNumber; grSim_RobotReplacement::grSim_RobotReplacement() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_RobotReplacement) } void grSim_RobotReplacement::InitAsDefaultInstance() { @@ -176,6 +177,7 @@ grSim_RobotReplacement::grSim_RobotReplacement(const grSim_RobotReplacement& fro : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_RobotReplacement) } void grSim_RobotReplacement::SharedCtor() { @@ -189,6 +191,7 @@ void grSim_RobotReplacement::SharedCtor() { } grSim_RobotReplacement::~grSim_RobotReplacement() { + // @@protoc_insertion_point(destructor:grSim_RobotReplacement) SharedDtor(); } @@ -219,33 +222,46 @@ grSim_RobotReplacement* grSim_RobotReplacement::New() const { } void grSim_RobotReplacement::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - x_ = 0; - y_ = 0; - dir_ = 0; - id_ = 0u; - yellowteam_ = false; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 31) { + ZR_(x_, yellowteam_); } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool grSim_RobotReplacement::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_RobotReplacement) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required double x = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(17)) goto parse_y; break; @@ -253,15 +269,14 @@ bool grSim_RobotReplacement::MergePartialFromCodedStream( // required double y = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 17) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(25)) goto parse_dir; break; @@ -269,15 +284,14 @@ bool grSim_RobotReplacement::MergePartialFromCodedStream( // required double dir = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 25) { parse_dir: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &dir_))); set_has_dir(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_id; break; @@ -285,15 +299,14 @@ bool grSim_RobotReplacement::MergePartialFromCodedStream( // required uint32 id = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &id_))); set_has_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_yellowteam; break; @@ -301,25 +314,25 @@ bool grSim_RobotReplacement::MergePartialFromCodedStream( // required bool yellowteam = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_yellowteam: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &yellowteam_))); set_has_yellowteam(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -327,12 +340,18 @@ bool grSim_RobotReplacement::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_RobotReplacement) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_RobotReplacement) + return false; #undef DO_ } void grSim_RobotReplacement::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_RobotReplacement) // required double x = 1; if (has_x()) { ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->x(), output); @@ -362,10 +381,12 @@ void grSim_RobotReplacement::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_RobotReplacement) } ::google::protobuf::uint8* grSim_RobotReplacement::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_RobotReplacement) // required double x = 1; if (has_x()) { target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->x(), target); @@ -395,6 +416,7 @@ ::google::protobuf::uint8* grSim_RobotReplacement::SerializeWithCachedSizesToArr target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_RobotReplacement) return target; } @@ -527,6 +549,7 @@ const int grSim_BallReplacement::kVyFieldNumber; grSim_BallReplacement::grSim_BallReplacement() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_BallReplacement) } void grSim_BallReplacement::InitAsDefaultInstance() { @@ -536,6 +559,7 @@ grSim_BallReplacement::grSim_BallReplacement(const grSim_BallReplacement& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_BallReplacement) } void grSim_BallReplacement::SharedCtor() { @@ -548,6 +572,7 @@ void grSim_BallReplacement::SharedCtor() { } grSim_BallReplacement::~grSim_BallReplacement() { + // @@protoc_insertion_point(destructor:grSim_BallReplacement) SharedDtor(); } @@ -578,32 +603,44 @@ grSim_BallReplacement* grSim_BallReplacement::New() const { } void grSim_BallReplacement::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - x_ = 0; - y_ = 0; - vx_ = 0; - vy_ = 0; - } +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(x_, vy_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool grSim_BallReplacement::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_BallReplacement) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required double x = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(17)) goto parse_y; break; @@ -611,15 +648,14 @@ bool grSim_BallReplacement::MergePartialFromCodedStream( // required double y = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 17) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(25)) goto parse_vx; break; @@ -627,15 +663,14 @@ bool grSim_BallReplacement::MergePartialFromCodedStream( // required double vx = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 25) { parse_vx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &vx_))); set_has_vx(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(33)) goto parse_vy; break; @@ -643,25 +678,25 @@ bool grSim_BallReplacement::MergePartialFromCodedStream( // required double vy = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 33) { parse_vy: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &vy_))); set_has_vy(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -669,12 +704,18 @@ bool grSim_BallReplacement::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_BallReplacement) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_BallReplacement) + return false; #undef DO_ } void grSim_BallReplacement::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_BallReplacement) // required double x = 1; if (has_x()) { ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->x(), output); @@ -699,10 +740,12 @@ void grSim_BallReplacement::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_BallReplacement) } ::google::protobuf::uint8* grSim_BallReplacement::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_BallReplacement) // required double x = 1; if (has_x()) { target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->x(), target); @@ -727,6 +770,7 @@ ::google::protobuf::uint8* grSim_BallReplacement::SerializeWithCachedSizesToArra target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_BallReplacement) return target; } @@ -846,6 +890,7 @@ const int grSim_Replacement::kRobotsFieldNumber; grSim_Replacement::grSim_Replacement() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:grSim_Replacement) } void grSim_Replacement::InitAsDefaultInstance() { @@ -856,6 +901,7 @@ grSim_Replacement::grSim_Replacement(const grSim_Replacement& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grSim_Replacement) } void grSim_Replacement::SharedCtor() { @@ -865,6 +911,7 @@ void grSim_Replacement::SharedCtor() { } grSim_Replacement::~grSim_Replacement() { + // @@protoc_insertion_point(destructor:grSim_Replacement) SharedDtor(); } @@ -896,10 +943,8 @@ grSim_Replacement* grSim_Replacement::New() const { } void grSim_Replacement::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (has_ball()) { - if (ball_ != NULL) ball_->::grSim_BallReplacement::Clear(); - } + if (has_ball()) { + if (ball_ != NULL) ball_->::grSim_BallReplacement::Clear(); } robots_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -908,18 +953,21 @@ void grSim_Replacement::Clear() { bool grSim_Replacement::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:grSim_Replacement) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .grSim_BallReplacement ball = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_ball())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_robots; break; @@ -927,24 +975,24 @@ bool grSim_Replacement::MergePartialFromCodedStream( // repeated .grSim_RobotReplacement robots = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_robots: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_robots())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_robots; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -952,12 +1000,18 @@ bool grSim_Replacement::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:grSim_Replacement) return true; +failure: + // @@protoc_insertion_point(parse_failure:grSim_Replacement) + return false; #undef DO_ } void grSim_Replacement::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grSim_Replacement) // optional .grSim_BallReplacement ball = 1; if (has_ball()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -974,10 +1028,12 @@ void grSim_Replacement::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:grSim_Replacement) } ::google::protobuf::uint8* grSim_Replacement::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grSim_Replacement) // optional .grSim_BallReplacement ball = 1; if (has_ball()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -996,6 +1052,7 @@ ::google::protobuf::uint8* grSim_Replacement::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:grSim_Replacement) return target; } @@ -1070,9 +1127,7 @@ bool grSim_Replacement::IsInitialized() const { if (has_ball()) { if (!this->ball().IsInitialized()) return false; } - for (int i = 0; i < robots_size(); i++) { - if (!this->robots(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->robots())) return false; return true; } diff --git a/src/proto/grSim_Replacement.pb.h b/src/proto/grSim_Replacement.pb.h index 65a219d..f9ed138 100644 --- a/src/proto/grSim_Replacement.pb.h +++ b/src/proto/grSim_Replacement.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class grSim_RobotReplacement : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -141,15 +140,13 @@ class grSim_RobotReplacement : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; double x_; double y_; double dir_; ::google::protobuf::uint32 id_; bool yellowteam_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fReplacement_2eproto(); friend void protobuf_AssignDesc_grSim_5fReplacement_2eproto(); friend void protobuf_ShutdownFile_grSim_5fReplacement_2eproto(); @@ -206,7 +203,6 @@ class grSim_BallReplacement : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -254,14 +250,12 @@ class grSim_BallReplacement : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; double x_; double y_; double vx_; double vy_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fReplacement_2eproto(); friend void protobuf_AssignDesc_grSim_5fReplacement_2eproto(); friend void protobuf_ShutdownFile_grSim_5fReplacement_2eproto(); @@ -318,7 +312,6 @@ class grSim_Replacement : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -353,12 +346,10 @@ class grSim_Replacement : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::grSim_BallReplacement* ball_; ::google::protobuf::RepeatedPtrField< ::grSim_RobotReplacement > robots_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_grSim_5fReplacement_2eproto(); friend void protobuf_AssignDesc_grSim_5fReplacement_2eproto(); friend void protobuf_ShutdownFile_grSim_5fReplacement_2eproto(); @@ -388,11 +379,13 @@ inline void grSim_RobotReplacement::clear_x() { clear_has_x(); } inline double grSim_RobotReplacement::x() const { + // @@protoc_insertion_point(field_get:grSim_RobotReplacement.x) return x_; } inline void grSim_RobotReplacement::set_x(double value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:grSim_RobotReplacement.x) } // required double y = 2; @@ -410,11 +403,13 @@ inline void grSim_RobotReplacement::clear_y() { clear_has_y(); } inline double grSim_RobotReplacement::y() const { + // @@protoc_insertion_point(field_get:grSim_RobotReplacement.y) return y_; } inline void grSim_RobotReplacement::set_y(double value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:grSim_RobotReplacement.y) } // required double dir = 3; @@ -432,11 +427,13 @@ inline void grSim_RobotReplacement::clear_dir() { clear_has_dir(); } inline double grSim_RobotReplacement::dir() const { + // @@protoc_insertion_point(field_get:grSim_RobotReplacement.dir) return dir_; } inline void grSim_RobotReplacement::set_dir(double value) { set_has_dir(); dir_ = value; + // @@protoc_insertion_point(field_set:grSim_RobotReplacement.dir) } // required uint32 id = 4; @@ -454,11 +451,13 @@ inline void grSim_RobotReplacement::clear_id() { clear_has_id(); } inline ::google::protobuf::uint32 grSim_RobotReplacement::id() const { + // @@protoc_insertion_point(field_get:grSim_RobotReplacement.id) return id_; } inline void grSim_RobotReplacement::set_id(::google::protobuf::uint32 value) { set_has_id(); id_ = value; + // @@protoc_insertion_point(field_set:grSim_RobotReplacement.id) } // required bool yellowteam = 5; @@ -476,11 +475,13 @@ inline void grSim_RobotReplacement::clear_yellowteam() { clear_has_yellowteam(); } inline bool grSim_RobotReplacement::yellowteam() const { + // @@protoc_insertion_point(field_get:grSim_RobotReplacement.yellowteam) return yellowteam_; } inline void grSim_RobotReplacement::set_yellowteam(bool value) { set_has_yellowteam(); yellowteam_ = value; + // @@protoc_insertion_point(field_set:grSim_RobotReplacement.yellowteam) } // ------------------------------------------------------------------- @@ -502,11 +503,13 @@ inline void grSim_BallReplacement::clear_x() { clear_has_x(); } inline double grSim_BallReplacement::x() const { + // @@protoc_insertion_point(field_get:grSim_BallReplacement.x) return x_; } inline void grSim_BallReplacement::set_x(double value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:grSim_BallReplacement.x) } // required double y = 2; @@ -524,11 +527,13 @@ inline void grSim_BallReplacement::clear_y() { clear_has_y(); } inline double grSim_BallReplacement::y() const { + // @@protoc_insertion_point(field_get:grSim_BallReplacement.y) return y_; } inline void grSim_BallReplacement::set_y(double value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:grSim_BallReplacement.y) } // required double vx = 3; @@ -546,11 +551,13 @@ inline void grSim_BallReplacement::clear_vx() { clear_has_vx(); } inline double grSim_BallReplacement::vx() const { + // @@protoc_insertion_point(field_get:grSim_BallReplacement.vx) return vx_; } inline void grSim_BallReplacement::set_vx(double value) { set_has_vx(); vx_ = value; + // @@protoc_insertion_point(field_set:grSim_BallReplacement.vx) } // required double vy = 4; @@ -568,11 +575,13 @@ inline void grSim_BallReplacement::clear_vy() { clear_has_vy(); } inline double grSim_BallReplacement::vy() const { + // @@protoc_insertion_point(field_get:grSim_BallReplacement.vy) return vy_; } inline void grSim_BallReplacement::set_vy(double value) { set_has_vy(); vy_ = value; + // @@protoc_insertion_point(field_set:grSim_BallReplacement.vy) } // ------------------------------------------------------------------- @@ -594,11 +603,13 @@ inline void grSim_Replacement::clear_ball() { clear_has_ball(); } inline const ::grSim_BallReplacement& grSim_Replacement::ball() const { + // @@protoc_insertion_point(field_get:grSim_Replacement.ball) return ball_ != NULL ? *ball_ : *default_instance_->ball_; } inline ::grSim_BallReplacement* grSim_Replacement::mutable_ball() { set_has_ball(); if (ball_ == NULL) ball_ = new ::grSim_BallReplacement; + // @@protoc_insertion_point(field_mutable:grSim_Replacement.ball) return ball_; } inline ::grSim_BallReplacement* grSim_Replacement::release_ball() { @@ -615,6 +626,7 @@ inline void grSim_Replacement::set_allocated_ball(::grSim_BallReplacement* ball) } else { clear_has_ball(); } + // @@protoc_insertion_point(field_set_allocated:grSim_Replacement.ball) } // repeated .grSim_RobotReplacement robots = 2; @@ -625,20 +637,25 @@ inline void grSim_Replacement::clear_robots() { robots_.Clear(); } inline const ::grSim_RobotReplacement& grSim_Replacement::robots(int index) const { + // @@protoc_insertion_point(field_get:grSim_Replacement.robots) return robots_.Get(index); } inline ::grSim_RobotReplacement* grSim_Replacement::mutable_robots(int index) { + // @@protoc_insertion_point(field_mutable:grSim_Replacement.robots) return robots_.Mutable(index); } inline ::grSim_RobotReplacement* grSim_Replacement::add_robots() { + // @@protoc_insertion_point(field_add:grSim_Replacement.robots) return robots_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::grSim_RobotReplacement >& grSim_Replacement::robots() const { + // @@protoc_insertion_point(field_list:grSim_Replacement.robots) return robots_; } inline ::google::protobuf::RepeatedPtrField< ::grSim_RobotReplacement >* grSim_Replacement::mutable_robots() { + // @@protoc_insertion_point(field_mutable_list:grSim_Replacement.robots) return &robots_; } diff --git a/src/proto/log.pb.cc b/src/proto/log.pb.cc index 37fa1f8..e711886 100644 --- a/src/proto/log.pb.cc +++ b/src/proto/log.pb.cc @@ -110,6 +110,7 @@ const int logRecord::kRefereeFieldNumber; logRecord::logRecord() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:logRecord) } void logRecord::InitAsDefaultInstance() { @@ -122,6 +123,7 @@ logRecord::logRecord(const logRecord& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:logRecord) } void logRecord::SharedCtor() { @@ -133,6 +135,7 @@ void logRecord::SharedCtor() { } logRecord::~logRecord() { + // @@protoc_insertion_point(destructor:logRecord) SharedDtor(); } @@ -166,7 +169,7 @@ logRecord* logRecord::New() const { } void logRecord::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 7) { if (has_ai()) { if (ai_ != NULL) ai_->::SSL_log::Clear(); } @@ -183,18 +186,21 @@ void logRecord::Clear() { bool logRecord::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:logRecord) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .SSL_log ai = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_ai())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_vision; break; @@ -202,13 +208,12 @@ bool logRecord::MergePartialFromCodedStream( // optional .Vision_log vision = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_vision: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_vision())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_referee; break; @@ -216,23 +221,23 @@ bool logRecord::MergePartialFromCodedStream( // optional .Ref_log referee = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_referee: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_referee())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -240,12 +245,18 @@ bool logRecord::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:logRecord) return true; +failure: + // @@protoc_insertion_point(parse_failure:logRecord) + return false; #undef DO_ } void logRecord::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:logRecord) // optional .SSL_log ai = 1; if (has_ai()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -268,10 +279,12 @@ void logRecord::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:logRecord) } ::google::protobuf::uint8* logRecord::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:logRecord) // optional .SSL_log ai = 1; if (has_ai()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -297,6 +310,7 @@ ::google::protobuf::uint8* logRecord::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:logRecord) return target; } diff --git a/src/proto/log.pb.h b/src/proto/log.pb.h index b86219c..f2bf5ce 100644 --- a/src/proto/log.pb.h +++ b/src/proto/log.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -85,7 +85,6 @@ class logRecord : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -130,13 +129,11 @@ class logRecord : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::SSL_log* ai_; ::Vision_log* vision_; ::Ref_log* referee_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_log_2eproto(); friend void protobuf_AssignDesc_log_2eproto(); friend void protobuf_ShutdownFile_log_2eproto(); @@ -166,11 +163,13 @@ inline void logRecord::clear_ai() { clear_has_ai(); } inline const ::SSL_log& logRecord::ai() const { + // @@protoc_insertion_point(field_get:logRecord.ai) return ai_ != NULL ? *ai_ : *default_instance_->ai_; } inline ::SSL_log* logRecord::mutable_ai() { set_has_ai(); if (ai_ == NULL) ai_ = new ::SSL_log; + // @@protoc_insertion_point(field_mutable:logRecord.ai) return ai_; } inline ::SSL_log* logRecord::release_ai() { @@ -187,6 +186,7 @@ inline void logRecord::set_allocated_ai(::SSL_log* ai) { } else { clear_has_ai(); } + // @@protoc_insertion_point(field_set_allocated:logRecord.ai) } // optional .Vision_log vision = 2; @@ -204,11 +204,13 @@ inline void logRecord::clear_vision() { clear_has_vision(); } inline const ::Vision_log& logRecord::vision() const { + // @@protoc_insertion_point(field_get:logRecord.vision) return vision_ != NULL ? *vision_ : *default_instance_->vision_; } inline ::Vision_log* logRecord::mutable_vision() { set_has_vision(); if (vision_ == NULL) vision_ = new ::Vision_log; + // @@protoc_insertion_point(field_mutable:logRecord.vision) return vision_; } inline ::Vision_log* logRecord::release_vision() { @@ -225,6 +227,7 @@ inline void logRecord::set_allocated_vision(::Vision_log* vision) { } else { clear_has_vision(); } + // @@protoc_insertion_point(field_set_allocated:logRecord.vision) } // optional .Ref_log referee = 3; @@ -242,11 +245,13 @@ inline void logRecord::clear_referee() { clear_has_referee(); } inline const ::Ref_log& logRecord::referee() const { + // @@protoc_insertion_point(field_get:logRecord.referee) return referee_ != NULL ? *referee_ : *default_instance_->referee_; } inline ::Ref_log* logRecord::mutable_referee() { set_has_referee(); if (referee_ == NULL) referee_ = new ::Ref_log; + // @@protoc_insertion_point(field_mutable:logRecord.referee) return referee_; } inline ::Ref_log* logRecord::release_referee() { @@ -263,6 +268,7 @@ inline void logRecord::set_allocated_referee(::Ref_log* referee) { } else { clear_has_referee(); } + // @@protoc_insertion_point(field_set_allocated:logRecord.referee) } diff --git a/src/proto/messages_robocup_ssl_detection.pb.cc b/src/proto/messages_robocup_ssl_detection.pb.cc index 2ba469e..e4cf106 100644 --- a/src/proto/messages_robocup_ssl_detection.pb.cc +++ b/src/proto/messages_robocup_ssl_detection.pb.cc @@ -186,6 +186,7 @@ const int SSL_DetectionBall::kPixelYFieldNumber; SSL_DetectionBall::SSL_DetectionBall() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_DetectionBall) } void SSL_DetectionBall::InitAsDefaultInstance() { @@ -195,6 +196,7 @@ SSL_DetectionBall::SSL_DetectionBall(const SSL_DetectionBall& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_DetectionBall) } void SSL_DetectionBall::SharedCtor() { @@ -210,6 +212,7 @@ void SSL_DetectionBall::SharedCtor() { } SSL_DetectionBall::~SSL_DetectionBall() { + // @@protoc_insertion_point(destructor:SSL_DetectionBall) SharedDtor(); } @@ -240,35 +243,46 @@ SSL_DetectionBall* SSL_DetectionBall::New() const { } void SSL_DetectionBall::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - confidence_ = 0; - area_ = 0u; - x_ = 0; - y_ = 0; - z_ = 0; - pixel_x_ = 0; - pixel_y_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 127) { + ZR_(confidence_, pixel_y_); } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_DetectionBall::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_DetectionBall) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required float confidence = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 13) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &confidence_))); set_has_confidence(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_area; break; @@ -276,15 +290,14 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // optional uint32 area = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_area: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &area_))); set_has_area(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_x; break; @@ -292,15 +305,14 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // required float x = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_x: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_y; break; @@ -308,15 +320,14 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // required float y = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_z; break; @@ -324,15 +335,14 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // optional float z = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_z: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &z_))); set_has_z(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(53)) goto parse_pixel_x; break; @@ -340,15 +350,14 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // required float pixel_x = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 53) { parse_pixel_x: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &pixel_x_))); set_has_pixel_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(61)) goto parse_pixel_y; break; @@ -356,25 +365,25 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( // required float pixel_y = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 61) { parse_pixel_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &pixel_y_))); set_has_pixel_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -382,12 +391,18 @@ bool SSL_DetectionBall::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_DetectionBall) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_DetectionBall) + return false; #undef DO_ } void SSL_DetectionBall::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_DetectionBall) // required float confidence = 1; if (has_confidence()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->confidence(), output); @@ -427,10 +442,12 @@ void SSL_DetectionBall::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_DetectionBall) } ::google::protobuf::uint8* SSL_DetectionBall::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_DetectionBall) // required float confidence = 1; if (has_confidence()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->confidence(), target); @@ -470,6 +487,7 @@ ::google::protobuf::uint8* SSL_DetectionBall::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_DetectionBall) return target; } @@ -624,6 +642,7 @@ const int SSL_DetectionRobot::kHeightFieldNumber; SSL_DetectionRobot::SSL_DetectionRobot() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_DetectionRobot) } void SSL_DetectionRobot::InitAsDefaultInstance() { @@ -633,6 +652,7 @@ SSL_DetectionRobot::SSL_DetectionRobot(const SSL_DetectionRobot& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_DetectionRobot) } void SSL_DetectionRobot::SharedCtor() { @@ -649,6 +669,7 @@ void SSL_DetectionRobot::SharedCtor() { } SSL_DetectionRobot::~SSL_DetectionRobot() { + // @@protoc_insertion_point(destructor:SSL_DetectionRobot) SharedDtor(); } @@ -679,36 +700,46 @@ SSL_DetectionRobot* SSL_DetectionRobot::New() const { } void SSL_DetectionRobot::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - confidence_ = 0; - robot_id_ = 0u; - x_ = 0; - y_ = 0; - orientation_ = 0; - pixel_x_ = 0; - pixel_y_ = 0; - height_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(confidence_, height_); } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_DetectionRobot::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_DetectionRobot) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required float confidence = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 13) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &confidence_))); set_has_confidence(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_robot_id; break; @@ -716,15 +747,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // optional uint32 robot_id = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_robot_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &robot_id_))); set_has_robot_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_x; break; @@ -732,15 +762,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // required float x = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_x: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_y; break; @@ -748,15 +777,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // required float y = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_orientation; break; @@ -764,15 +792,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // optional float orientation = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_orientation: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &orientation_))); set_has_orientation(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(53)) goto parse_pixel_x; break; @@ -780,15 +807,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // required float pixel_x = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 53) { parse_pixel_x: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &pixel_x_))); set_has_pixel_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(61)) goto parse_pixel_y; break; @@ -796,15 +822,14 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // required float pixel_y = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 61) { parse_pixel_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &pixel_y_))); set_has_pixel_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(69)) goto parse_height; break; @@ -812,25 +837,25 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( // optional float height = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 69) { parse_height: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &height_))); set_has_height(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -838,12 +863,18 @@ bool SSL_DetectionRobot::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_DetectionRobot) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_DetectionRobot) + return false; #undef DO_ } void SSL_DetectionRobot::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_DetectionRobot) // required float confidence = 1; if (has_confidence()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->confidence(), output); @@ -888,10 +919,12 @@ void SSL_DetectionRobot::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_DetectionRobot) } ::google::protobuf::uint8* SSL_DetectionRobot::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_DetectionRobot) // required float confidence = 1; if (has_confidence()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->confidence(), target); @@ -936,6 +969,7 @@ ::google::protobuf::uint8* SSL_DetectionRobot::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_DetectionRobot) return target; } @@ -1098,6 +1132,7 @@ const int SSL_DetectionFrame::kRobotsBlueFieldNumber; SSL_DetectionFrame::SSL_DetectionFrame() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_DetectionFrame) } void SSL_DetectionFrame::InitAsDefaultInstance() { @@ -1107,6 +1142,7 @@ SSL_DetectionFrame::SSL_DetectionFrame(const SSL_DetectionFrame& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_DetectionFrame) } void SSL_DetectionFrame::SharedCtor() { @@ -1119,6 +1155,7 @@ void SSL_DetectionFrame::SharedCtor() { } SSL_DetectionFrame::~SSL_DetectionFrame() { + // @@protoc_insertion_point(destructor:SSL_DetectionFrame) SharedDtor(); } @@ -1149,12 +1186,21 @@ SSL_DetectionFrame* SSL_DetectionFrame::New() const { } void SSL_DetectionFrame::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - frame_number_ = 0u; - t_capture_ = 0; - t_sent_ = 0; - camera_id_ = 0u; - } +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(t_capture_, t_sent_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + balls_.Clear(); robots_yellow_.Clear(); robots_blue_.Clear(); @@ -1164,20 +1210,23 @@ void SSL_DetectionFrame::Clear() { bool SSL_DetectionFrame::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_DetectionFrame) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint32 frame_number = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &frame_number_))); set_has_frame_number(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(17)) goto parse_t_capture; break; @@ -1185,15 +1234,14 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // required double t_capture = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 17) { parse_t_capture: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &t_capture_))); set_has_t_capture(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(25)) goto parse_t_sent; break; @@ -1201,15 +1249,14 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // required double t_sent = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { + if (tag == 25) { parse_t_sent: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( input, &t_sent_))); set_has_t_sent(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_camera_id; break; @@ -1217,15 +1264,14 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // required uint32 camera_id = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_camera_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &camera_id_))); set_has_camera_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(42)) goto parse_balls; break; @@ -1233,13 +1279,12 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // repeated .SSL_DetectionBall balls = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 42) { parse_balls: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_balls())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(42)) goto parse_balls; if (input->ExpectTag(50)) goto parse_robots_yellow; @@ -1248,13 +1293,12 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // repeated .SSL_DetectionRobot robots_yellow = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 50) { parse_robots_yellow: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_robots_yellow())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(50)) goto parse_robots_yellow; if (input->ExpectTag(58)) goto parse_robots_blue; @@ -1263,24 +1307,24 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( // repeated .SSL_DetectionRobot robots_blue = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 58) { parse_robots_blue: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_robots_blue())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(58)) goto parse_robots_blue; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -1288,12 +1332,18 @@ bool SSL_DetectionFrame::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_DetectionFrame) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_DetectionFrame) + return false; #undef DO_ } void SSL_DetectionFrame::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_DetectionFrame) // required uint32 frame_number = 1; if (has_frame_number()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->frame_number(), output); @@ -1336,10 +1386,12 @@ void SSL_DetectionFrame::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_DetectionFrame) } ::google::protobuf::uint8* SSL_DetectionFrame::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_DetectionFrame) // required uint32 frame_number = 1; if (has_frame_number()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->frame_number(), target); @@ -1385,6 +1437,7 @@ ::google::protobuf::uint8* SSL_DetectionFrame::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_DetectionFrame) return target; } @@ -1501,15 +1554,9 @@ void SSL_DetectionFrame::CopyFrom(const SSL_DetectionFrame& from) { bool SSL_DetectionFrame::IsInitialized() const { if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; - for (int i = 0; i < balls_size(); i++) { - if (!this->balls(i).IsInitialized()) return false; - } - for (int i = 0; i < robots_yellow_size(); i++) { - if (!this->robots_yellow(i).IsInitialized()) return false; - } - for (int i = 0; i < robots_blue_size(); i++) { - if (!this->robots_blue(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->balls())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->robots_yellow())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->robots_blue())) return false; return true; } diff --git a/src/proto/messages_robocup_ssl_detection.pb.h b/src/proto/messages_robocup_ssl_detection.pb.h index 7e0cc0f..512c9c1 100644 --- a/src/proto/messages_robocup_ssl_detection.pb.h +++ b/src/proto/messages_robocup_ssl_detection.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class SSL_DetectionBall : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -159,6 +158,8 @@ class SSL_DetectionBall : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; float confidence_; ::google::protobuf::uint32 area_; float x_; @@ -166,10 +167,6 @@ class SSL_DetectionBall : public ::google::protobuf::Message { float z_; float pixel_x_; float pixel_y_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fdetection_2eproto(); @@ -226,7 +223,6 @@ class SSL_DetectionRobot : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -310,6 +306,8 @@ class SSL_DetectionRobot : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; float confidence_; ::google::protobuf::uint32 robot_id_; float x_; @@ -318,10 +316,6 @@ class SSL_DetectionRobot : public ::google::protobuf::Message { float pixel_x_; float pixel_y_; float height_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fdetection_2eproto(); @@ -378,7 +372,6 @@ class SSL_DetectionFrame : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -462,6 +455,8 @@ class SSL_DetectionFrame : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; double t_capture_; ::google::protobuf::uint32 frame_number_; ::google::protobuf::uint32 camera_id_; @@ -469,10 +464,6 @@ class SSL_DetectionFrame : public ::google::protobuf::Message { ::google::protobuf::RepeatedPtrField< ::SSL_DetectionBall > balls_; ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot > robots_yellow_; ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot > robots_blue_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fdetection_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fdetection_2eproto(); @@ -502,11 +493,13 @@ inline void SSL_DetectionBall::clear_confidence() { clear_has_confidence(); } inline float SSL_DetectionBall::confidence() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.confidence) return confidence_; } inline void SSL_DetectionBall::set_confidence(float value) { set_has_confidence(); confidence_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.confidence) } // optional uint32 area = 2; @@ -524,11 +517,13 @@ inline void SSL_DetectionBall::clear_area() { clear_has_area(); } inline ::google::protobuf::uint32 SSL_DetectionBall::area() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.area) return area_; } inline void SSL_DetectionBall::set_area(::google::protobuf::uint32 value) { set_has_area(); area_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.area) } // required float x = 3; @@ -546,11 +541,13 @@ inline void SSL_DetectionBall::clear_x() { clear_has_x(); } inline float SSL_DetectionBall::x() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.x) return x_; } inline void SSL_DetectionBall::set_x(float value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.x) } // required float y = 4; @@ -568,11 +565,13 @@ inline void SSL_DetectionBall::clear_y() { clear_has_y(); } inline float SSL_DetectionBall::y() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.y) return y_; } inline void SSL_DetectionBall::set_y(float value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.y) } // optional float z = 5; @@ -590,11 +589,13 @@ inline void SSL_DetectionBall::clear_z() { clear_has_z(); } inline float SSL_DetectionBall::z() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.z) return z_; } inline void SSL_DetectionBall::set_z(float value) { set_has_z(); z_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.z) } // required float pixel_x = 6; @@ -612,11 +613,13 @@ inline void SSL_DetectionBall::clear_pixel_x() { clear_has_pixel_x(); } inline float SSL_DetectionBall::pixel_x() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.pixel_x) return pixel_x_; } inline void SSL_DetectionBall::set_pixel_x(float value) { set_has_pixel_x(); pixel_x_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.pixel_x) } // required float pixel_y = 7; @@ -634,11 +637,13 @@ inline void SSL_DetectionBall::clear_pixel_y() { clear_has_pixel_y(); } inline float SSL_DetectionBall::pixel_y() const { + // @@protoc_insertion_point(field_get:SSL_DetectionBall.pixel_y) return pixel_y_; } inline void SSL_DetectionBall::set_pixel_y(float value) { set_has_pixel_y(); pixel_y_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionBall.pixel_y) } // ------------------------------------------------------------------- @@ -660,11 +665,13 @@ inline void SSL_DetectionRobot::clear_confidence() { clear_has_confidence(); } inline float SSL_DetectionRobot::confidence() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.confidence) return confidence_; } inline void SSL_DetectionRobot::set_confidence(float value) { set_has_confidence(); confidence_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.confidence) } // optional uint32 robot_id = 2; @@ -682,11 +689,13 @@ inline void SSL_DetectionRobot::clear_robot_id() { clear_has_robot_id(); } inline ::google::protobuf::uint32 SSL_DetectionRobot::robot_id() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.robot_id) return robot_id_; } inline void SSL_DetectionRobot::set_robot_id(::google::protobuf::uint32 value) { set_has_robot_id(); robot_id_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.robot_id) } // required float x = 3; @@ -704,11 +713,13 @@ inline void SSL_DetectionRobot::clear_x() { clear_has_x(); } inline float SSL_DetectionRobot::x() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.x) return x_; } inline void SSL_DetectionRobot::set_x(float value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.x) } // required float y = 4; @@ -726,11 +737,13 @@ inline void SSL_DetectionRobot::clear_y() { clear_has_y(); } inline float SSL_DetectionRobot::y() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.y) return y_; } inline void SSL_DetectionRobot::set_y(float value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.y) } // optional float orientation = 5; @@ -748,11 +761,13 @@ inline void SSL_DetectionRobot::clear_orientation() { clear_has_orientation(); } inline float SSL_DetectionRobot::orientation() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.orientation) return orientation_; } inline void SSL_DetectionRobot::set_orientation(float value) { set_has_orientation(); orientation_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.orientation) } // required float pixel_x = 6; @@ -770,11 +785,13 @@ inline void SSL_DetectionRobot::clear_pixel_x() { clear_has_pixel_x(); } inline float SSL_DetectionRobot::pixel_x() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.pixel_x) return pixel_x_; } inline void SSL_DetectionRobot::set_pixel_x(float value) { set_has_pixel_x(); pixel_x_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.pixel_x) } // required float pixel_y = 7; @@ -792,11 +809,13 @@ inline void SSL_DetectionRobot::clear_pixel_y() { clear_has_pixel_y(); } inline float SSL_DetectionRobot::pixel_y() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.pixel_y) return pixel_y_; } inline void SSL_DetectionRobot::set_pixel_y(float value) { set_has_pixel_y(); pixel_y_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.pixel_y) } // optional float height = 8; @@ -814,11 +833,13 @@ inline void SSL_DetectionRobot::clear_height() { clear_has_height(); } inline float SSL_DetectionRobot::height() const { + // @@protoc_insertion_point(field_get:SSL_DetectionRobot.height) return height_; } inline void SSL_DetectionRobot::set_height(float value) { set_has_height(); height_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionRobot.height) } // ------------------------------------------------------------------- @@ -840,11 +861,13 @@ inline void SSL_DetectionFrame::clear_frame_number() { clear_has_frame_number(); } inline ::google::protobuf::uint32 SSL_DetectionFrame::frame_number() const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.frame_number) return frame_number_; } inline void SSL_DetectionFrame::set_frame_number(::google::protobuf::uint32 value) { set_has_frame_number(); frame_number_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionFrame.frame_number) } // required double t_capture = 2; @@ -862,11 +885,13 @@ inline void SSL_DetectionFrame::clear_t_capture() { clear_has_t_capture(); } inline double SSL_DetectionFrame::t_capture() const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.t_capture) return t_capture_; } inline void SSL_DetectionFrame::set_t_capture(double value) { set_has_t_capture(); t_capture_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionFrame.t_capture) } // required double t_sent = 3; @@ -884,11 +909,13 @@ inline void SSL_DetectionFrame::clear_t_sent() { clear_has_t_sent(); } inline double SSL_DetectionFrame::t_sent() const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.t_sent) return t_sent_; } inline void SSL_DetectionFrame::set_t_sent(double value) { set_has_t_sent(); t_sent_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionFrame.t_sent) } // required uint32 camera_id = 4; @@ -906,11 +933,13 @@ inline void SSL_DetectionFrame::clear_camera_id() { clear_has_camera_id(); } inline ::google::protobuf::uint32 SSL_DetectionFrame::camera_id() const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.camera_id) return camera_id_; } inline void SSL_DetectionFrame::set_camera_id(::google::protobuf::uint32 value) { set_has_camera_id(); camera_id_ = value; + // @@protoc_insertion_point(field_set:SSL_DetectionFrame.camera_id) } // repeated .SSL_DetectionBall balls = 5; @@ -921,20 +950,25 @@ inline void SSL_DetectionFrame::clear_balls() { balls_.Clear(); } inline const ::SSL_DetectionBall& SSL_DetectionFrame::balls(int index) const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.balls) return balls_.Get(index); } inline ::SSL_DetectionBall* SSL_DetectionFrame::mutable_balls(int index) { + // @@protoc_insertion_point(field_mutable:SSL_DetectionFrame.balls) return balls_.Mutable(index); } inline ::SSL_DetectionBall* SSL_DetectionFrame::add_balls() { + // @@protoc_insertion_point(field_add:SSL_DetectionFrame.balls) return balls_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_DetectionBall >& SSL_DetectionFrame::balls() const { + // @@protoc_insertion_point(field_list:SSL_DetectionFrame.balls) return balls_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_DetectionBall >* SSL_DetectionFrame::mutable_balls() { + // @@protoc_insertion_point(field_mutable_list:SSL_DetectionFrame.balls) return &balls_; } @@ -946,20 +980,25 @@ inline void SSL_DetectionFrame::clear_robots_yellow() { robots_yellow_.Clear(); } inline const ::SSL_DetectionRobot& SSL_DetectionFrame::robots_yellow(int index) const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.robots_yellow) return robots_yellow_.Get(index); } inline ::SSL_DetectionRobot* SSL_DetectionFrame::mutable_robots_yellow(int index) { + // @@protoc_insertion_point(field_mutable:SSL_DetectionFrame.robots_yellow) return robots_yellow_.Mutable(index); } inline ::SSL_DetectionRobot* SSL_DetectionFrame::add_robots_yellow() { + // @@protoc_insertion_point(field_add:SSL_DetectionFrame.robots_yellow) return robots_yellow_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot >& SSL_DetectionFrame::robots_yellow() const { + // @@protoc_insertion_point(field_list:SSL_DetectionFrame.robots_yellow) return robots_yellow_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot >* SSL_DetectionFrame::mutable_robots_yellow() { + // @@protoc_insertion_point(field_mutable_list:SSL_DetectionFrame.robots_yellow) return &robots_yellow_; } @@ -971,20 +1010,25 @@ inline void SSL_DetectionFrame::clear_robots_blue() { robots_blue_.Clear(); } inline const ::SSL_DetectionRobot& SSL_DetectionFrame::robots_blue(int index) const { + // @@protoc_insertion_point(field_get:SSL_DetectionFrame.robots_blue) return robots_blue_.Get(index); } inline ::SSL_DetectionRobot* SSL_DetectionFrame::mutable_robots_blue(int index) { + // @@protoc_insertion_point(field_mutable:SSL_DetectionFrame.robots_blue) return robots_blue_.Mutable(index); } inline ::SSL_DetectionRobot* SSL_DetectionFrame::add_robots_blue() { + // @@protoc_insertion_point(field_add:SSL_DetectionFrame.robots_blue) return robots_blue_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot >& SSL_DetectionFrame::robots_blue() const { + // @@protoc_insertion_point(field_list:SSL_DetectionFrame.robots_blue) return robots_blue_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_DetectionRobot >* SSL_DetectionFrame::mutable_robots_blue() { + // @@protoc_insertion_point(field_mutable_list:SSL_DetectionFrame.robots_blue) return &robots_blue_; } diff --git a/src/proto/messages_robocup_ssl_geometry.pb.cc b/src/proto/messages_robocup_ssl_geometry.pb.cc index aa1ff0b..9358301 100644 --- a/src/proto/messages_robocup_ssl_geometry.pb.cc +++ b/src/proto/messages_robocup_ssl_geometry.pb.cc @@ -274,6 +274,7 @@ const int Vector2f::kYFieldNumber; Vector2f::Vector2f() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Vector2f) } void Vector2f::InitAsDefaultInstance() { @@ -283,6 +284,7 @@ Vector2f::Vector2f(const Vector2f& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Vector2f) } void Vector2f::SharedCtor() { @@ -293,6 +295,7 @@ void Vector2f::SharedCtor() { } Vector2f::~Vector2f() { + // @@protoc_insertion_point(destructor:Vector2f) SharedDtor(); } @@ -323,30 +326,44 @@ Vector2f* Vector2f::New() const { } void Vector2f::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - x_ = 0; - y_ = 0; - } +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(x_, y_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool Vector2f::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Vector2f) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required float x = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 13) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(21)) goto parse_y; break; @@ -354,25 +371,25 @@ bool Vector2f::MergePartialFromCodedStream( // required float y = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 21) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -380,12 +397,18 @@ bool Vector2f::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Vector2f) return true; +failure: + // @@protoc_insertion_point(parse_failure:Vector2f) + return false; #undef DO_ } void Vector2f::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Vector2f) // required float x = 1; if (has_x()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->x(), output); @@ -400,10 +423,12 @@ void Vector2f::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Vector2f) } ::google::protobuf::uint8* Vector2f::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Vector2f) // required float x = 1; if (has_x()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->x(), target); @@ -418,6 +443,7 @@ ::google::protobuf::uint8* Vector2f::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Vector2f) return target; } @@ -521,6 +547,7 @@ const int SSL_FieldLineSegment::kThicknessFieldNumber; SSL_FieldLineSegment::SSL_FieldLineSegment() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_FieldLineSegment) } void SSL_FieldLineSegment::InitAsDefaultInstance() { @@ -532,11 +559,13 @@ SSL_FieldLineSegment::SSL_FieldLineSegment(const SSL_FieldLineSegment& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_FieldLineSegment) } void SSL_FieldLineSegment::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); p1_ = NULL; p2_ = NULL; thickness_ = 0; @@ -544,11 +573,12 @@ void SSL_FieldLineSegment::SharedCtor() { } SSL_FieldLineSegment::~SSL_FieldLineSegment() { + // @@protoc_insertion_point(destructor:SSL_FieldLineSegment) SharedDtor(); } void SSL_FieldLineSegment::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (this != default_instance_) { @@ -579,9 +609,9 @@ SSL_FieldLineSegment* SSL_FieldLineSegment::New() const { } void SSL_FieldLineSegment::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 15) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } } @@ -599,21 +629,25 @@ void SSL_FieldLineSegment::Clear() { bool SSL_FieldLineSegment::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_FieldLineSegment) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::PARSE); + ::google::protobuf::internal::WireFormat::PARSE, + "name"); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_p1; break; @@ -621,13 +655,12 @@ bool SSL_FieldLineSegment::MergePartialFromCodedStream( // required .Vector2f p1 = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_p1: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_p1())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_p2; break; @@ -635,13 +668,12 @@ bool SSL_FieldLineSegment::MergePartialFromCodedStream( // required .Vector2f p2 = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_p2: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_p2())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_thickness; break; @@ -649,25 +681,25 @@ bool SSL_FieldLineSegment::MergePartialFromCodedStream( // required float thickness = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_thickness: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &thickness_))); set_has_thickness(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -675,18 +707,25 @@ bool SSL_FieldLineSegment::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_FieldLineSegment) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_FieldLineSegment) + return false; #undef DO_ } void SSL_FieldLineSegment::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_FieldLineSegment) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } @@ -711,15 +750,18 @@ void SSL_FieldLineSegment::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_FieldLineSegment) } ::google::protobuf::uint8* SSL_FieldLineSegment::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_FieldLineSegment) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); @@ -748,6 +790,7 @@ ::google::protobuf::uint8* SSL_FieldLineSegment::SerializeWithCachedSizesToArray target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_FieldLineSegment) return target; } @@ -883,6 +926,7 @@ const int SSL_FieldCicularArc::kThicknessFieldNumber; SSL_FieldCicularArc::SSL_FieldCicularArc() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_FieldCicularArc) } void SSL_FieldCicularArc::InitAsDefaultInstance() { @@ -893,11 +937,13 @@ SSL_FieldCicularArc::SSL_FieldCicularArc(const SSL_FieldCicularArc& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_FieldCicularArc) } void SSL_FieldCicularArc::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); center_ = NULL; radius_ = 0; a1_ = 0; @@ -907,11 +953,12 @@ void SSL_FieldCicularArc::SharedCtor() { } SSL_FieldCicularArc::~SSL_FieldCicularArc() { + // @@protoc_insertion_point(destructor:SSL_FieldCicularArc) SharedDtor(); } void SSL_FieldCicularArc::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (this != default_instance_) { @@ -941,41 +988,56 @@ SSL_FieldCicularArc* SSL_FieldCicularArc::New() const { } void SSL_FieldCicularArc::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 63) { + ZR_(radius_, thickness_); if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } } if (has_center()) { if (center_ != NULL) center_->::Vector2f::Clear(); } - radius_ = 0; - a1_ = 0; - a2_ = 0; - thickness_ = 0; } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_FieldCicularArc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_FieldCicularArc) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::PARSE); + ::google::protobuf::internal::WireFormat::PARSE, + "name"); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_center; break; @@ -983,13 +1045,12 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( // required .Vector2f center = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_center: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_center())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_radius; break; @@ -997,15 +1058,14 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( // required float radius = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_radius: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &radius_))); set_has_radius(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_a1; break; @@ -1013,15 +1073,14 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( // required float a1 = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_a1: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &a1_))); set_has_a1(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_a2; break; @@ -1029,15 +1088,14 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( // required float a2 = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_a2: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &a2_))); set_has_a2(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(53)) goto parse_thickness; break; @@ -1045,25 +1103,25 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( // required float thickness = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 53) { parse_thickness: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &thickness_))); set_has_thickness(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -1071,18 +1129,25 @@ bool SSL_FieldCicularArc::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_FieldCicularArc) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_FieldCicularArc) + return false; #undef DO_ } void SSL_FieldCicularArc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_FieldCicularArc) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } @@ -1116,15 +1181,18 @@ void SSL_FieldCicularArc::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_FieldCicularArc) } ::google::protobuf::uint8* SSL_FieldCicularArc::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_FieldCicularArc) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); @@ -1161,6 +1229,7 @@ ::google::protobuf::uint8* SSL_FieldCicularArc::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_FieldCicularArc) return target; } @@ -1310,6 +1379,7 @@ const int SSL_GeometryFieldSize::kFieldArcsFieldNumber; SSL_GeometryFieldSize::SSL_GeometryFieldSize() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_GeometryFieldSize) } void SSL_GeometryFieldSize::InitAsDefaultInstance() { @@ -1319,6 +1389,7 @@ SSL_GeometryFieldSize::SSL_GeometryFieldSize(const SSL_GeometryFieldSize& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_GeometryFieldSize) } void SSL_GeometryFieldSize::SharedCtor() { @@ -1332,6 +1403,7 @@ void SSL_GeometryFieldSize::SharedCtor() { } SSL_GeometryFieldSize::~SSL_GeometryFieldSize() { + // @@protoc_insertion_point(destructor:SSL_GeometryFieldSize) SharedDtor(); } @@ -1362,13 +1434,24 @@ SSL_GeometryFieldSize* SSL_GeometryFieldSize::New() const { } void SSL_GeometryFieldSize::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - field_length_ = 0; - field_width_ = 0; - goal_width_ = 0; - goal_depth_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 31) { + ZR_(field_length_, goal_depth_); boundary_width_ = 0; } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + field_lines_.Clear(); field_arcs_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -1377,20 +1460,23 @@ void SSL_GeometryFieldSize::Clear() { bool SSL_GeometryFieldSize::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_GeometryFieldSize) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 field_length = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &field_length_))); set_has_field_length(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_field_width; break; @@ -1398,15 +1484,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 field_width = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_field_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &field_width_))); set_has_field_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(24)) goto parse_goal_width; break; @@ -1414,15 +1499,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 goal_width = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 24) { parse_goal_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &goal_width_))); set_has_goal_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_goal_depth; break; @@ -1430,15 +1514,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 goal_depth = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_goal_depth: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &goal_depth_))); set_has_goal_depth(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_boundary_width; break; @@ -1446,15 +1529,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 boundary_width = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_boundary_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &boundary_width_))); set_has_boundary_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(50)) goto parse_field_lines; break; @@ -1462,13 +1544,12 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // repeated .SSL_FieldLineSegment field_lines = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 50) { parse_field_lines: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_field_lines())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(50)) goto parse_field_lines; if (input->ExpectTag(58)) goto parse_field_arcs; @@ -1477,24 +1558,24 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // repeated .SSL_FieldCicularArc field_arcs = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 58) { parse_field_arcs: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_field_arcs())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(58)) goto parse_field_arcs; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -1502,12 +1583,18 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_GeometryFieldSize) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_GeometryFieldSize) + return false; #undef DO_ } void SSL_GeometryFieldSize::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_GeometryFieldSize) // required int32 field_length = 1; if (has_field_length()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->field_length(), output); @@ -1549,10 +1636,12 @@ void SSL_GeometryFieldSize::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_GeometryFieldSize) } ::google::protobuf::uint8* SSL_GeometryFieldSize::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_GeometryFieldSize) // required int32 field_length = 1; if (has_field_length()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->field_length(), target); @@ -1596,6 +1685,7 @@ ::google::protobuf::uint8* SSL_GeometryFieldSize::SerializeWithCachedSizesToArra target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_GeometryFieldSize) return target; } @@ -1717,12 +1807,8 @@ void SSL_GeometryFieldSize::CopyFrom(const SSL_GeometryFieldSize& from) { bool SSL_GeometryFieldSize::IsInitialized() const { if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false; - for (int i = 0; i < field_lines_size(); i++) { - if (!this->field_lines(i).IsInitialized()) return false; - } - for (int i = 0; i < field_arcs_size(); i++) { - if (!this->field_arcs(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->field_lines())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->field_arcs())) return false; return true; } @@ -1773,6 +1859,7 @@ const int SSL_GeometryCameraCalibration::kDerivedCameraWorldTzFieldNumber; SSL_GeometryCameraCalibration::SSL_GeometryCameraCalibration() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_GeometryCameraCalibration) } void SSL_GeometryCameraCalibration::InitAsDefaultInstance() { @@ -1782,6 +1869,7 @@ SSL_GeometryCameraCalibration::SSL_GeometryCameraCalibration(const SSL_GeometryC : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_GeometryCameraCalibration) } void SSL_GeometryCameraCalibration::SharedCtor() { @@ -1805,6 +1893,7 @@ void SSL_GeometryCameraCalibration::SharedCtor() { } SSL_GeometryCameraCalibration::~SSL_GeometryCameraCalibration() { + // @@protoc_insertion_point(destructor:SSL_GeometryCameraCalibration) SharedDtor(); } @@ -1835,45 +1924,49 @@ SSL_GeometryCameraCalibration* SSL_GeometryCameraCalibration::New() const { } void SSL_GeometryCameraCalibration::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - camera_id_ = 0u; - focal_length_ = 0; - principal_point_x_ = 0; - principal_point_y_ = 0; - distortion_ = 0; - q0_ = 0; - q1_ = 0; - q2_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(camera_id_, q2_); } - if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { - q3_ = 0; - tx_ = 0; - ty_ = 0; - tz_ = 0; - derived_camera_world_tx_ = 0; - derived_camera_world_ty_ = 0; - derived_camera_world_tz_ = 0; + if (_has_bits_[8 / 32] & 32512) { + ZR_(q3_, derived_camera_world_tz_); } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_GeometryCameraCalibration) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint32 camera_id = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &camera_id_))); set_has_camera_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(21)) goto parse_focal_length; break; @@ -1881,15 +1974,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float focal_length = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 21) { parse_focal_length: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &focal_length_))); set_has_focal_length(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_principal_point_x; break; @@ -1897,15 +1989,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float principal_point_x = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_principal_point_x: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &principal_point_x_))); set_has_principal_point_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(37)) goto parse_principal_point_y; break; @@ -1913,15 +2004,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float principal_point_y = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 37) { parse_principal_point_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &principal_point_y_))); set_has_principal_point_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(45)) goto parse_distortion; break; @@ -1929,15 +2019,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float distortion = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 45) { parse_distortion: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &distortion_))); set_has_distortion(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(53)) goto parse_q0; break; @@ -1945,15 +2034,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float q0 = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 53) { parse_q0: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &q0_))); set_has_q0(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(61)) goto parse_q1; break; @@ -1961,15 +2049,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float q1 = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 61) { parse_q1: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &q1_))); set_has_q1(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(69)) goto parse_q2; break; @@ -1977,15 +2064,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float q2 = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 69) { parse_q2: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &q2_))); set_has_q2(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(77)) goto parse_q3; break; @@ -1993,15 +2079,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float q3 = 9; case 9: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 77) { parse_q3: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &q3_))); set_has_q3(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(85)) goto parse_tx; break; @@ -2009,15 +2094,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float tx = 10; case 10: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 85) { parse_tx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &tx_))); set_has_tx(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(93)) goto parse_ty; break; @@ -2025,15 +2109,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float ty = 11; case 11: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 93) { parse_ty: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &ty_))); set_has_ty(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(101)) goto parse_tz; break; @@ -2041,15 +2124,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // required float tz = 12; case 12: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 101) { parse_tz: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &tz_))); set_has_tz(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(109)) goto parse_derived_camera_world_tx; break; @@ -2057,15 +2139,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // optional float derived_camera_world_tx = 13; case 13: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 109) { parse_derived_camera_world_tx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &derived_camera_world_tx_))); set_has_derived_camera_world_tx(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(117)) goto parse_derived_camera_world_ty; break; @@ -2073,15 +2154,14 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // optional float derived_camera_world_ty = 14; case 14: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 117) { parse_derived_camera_world_ty: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &derived_camera_world_ty_))); set_has_derived_camera_world_ty(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(125)) goto parse_derived_camera_world_tz; break; @@ -2089,25 +2169,25 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( // optional float derived_camera_world_tz = 15; case 15: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 125) { parse_derived_camera_world_tz: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &derived_camera_world_tz_))); set_has_derived_camera_world_tz(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -2115,12 +2195,18 @@ bool SSL_GeometryCameraCalibration::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_GeometryCameraCalibration) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_GeometryCameraCalibration) + return false; #undef DO_ } void SSL_GeometryCameraCalibration::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_GeometryCameraCalibration) // required uint32 camera_id = 1; if (has_camera_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->camera_id(), output); @@ -2200,10 +2286,12 @@ void SSL_GeometryCameraCalibration::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_GeometryCameraCalibration) } ::google::protobuf::uint8* SSL_GeometryCameraCalibration::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_GeometryCameraCalibration) // required uint32 camera_id = 1; if (has_camera_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->camera_id(), target); @@ -2283,6 +2371,7 @@ ::google::protobuf::uint8* SSL_GeometryCameraCalibration::SerializeWithCachedSiz target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_GeometryCameraCalibration) return target; } @@ -2507,6 +2596,7 @@ const int SSL_GeometryData::kCalibFieldNumber; SSL_GeometryData::SSL_GeometryData() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_GeometryData) } void SSL_GeometryData::InitAsDefaultInstance() { @@ -2517,6 +2607,7 @@ SSL_GeometryData::SSL_GeometryData(const SSL_GeometryData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_GeometryData) } void SSL_GeometryData::SharedCtor() { @@ -2526,6 +2617,7 @@ void SSL_GeometryData::SharedCtor() { } SSL_GeometryData::~SSL_GeometryData() { + // @@protoc_insertion_point(destructor:SSL_GeometryData) SharedDtor(); } @@ -2557,10 +2649,8 @@ SSL_GeometryData* SSL_GeometryData::New() const { } void SSL_GeometryData::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (has_field()) { - if (field_ != NULL) field_->::SSL_GeometryFieldSize::Clear(); - } + if (has_field()) { + if (field_ != NULL) field_->::SSL_GeometryFieldSize::Clear(); } calib_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -2569,18 +2659,21 @@ void SSL_GeometryData::Clear() { bool SSL_GeometryData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_GeometryData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required .SSL_GeometryFieldSize field = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_field())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_calib; break; @@ -2588,24 +2681,24 @@ bool SSL_GeometryData::MergePartialFromCodedStream( // repeated .SSL_GeometryCameraCalibration calib = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_calib: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_calib())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_calib; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -2613,12 +2706,18 @@ bool SSL_GeometryData::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_GeometryData) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_GeometryData) + return false; #undef DO_ } void SSL_GeometryData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_GeometryData) // required .SSL_GeometryFieldSize field = 1; if (has_field()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -2635,10 +2734,12 @@ void SSL_GeometryData::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_GeometryData) } ::google::protobuf::uint8* SSL_GeometryData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_GeometryData) // required .SSL_GeometryFieldSize field = 1; if (has_field()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -2657,6 +2758,7 @@ ::google::protobuf::uint8* SSL_GeometryData::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_GeometryData) return target; } @@ -2732,9 +2834,7 @@ bool SSL_GeometryData::IsInitialized() const { if (has_field()) { if (!this->field().IsInitialized()) return false; } - for (int i = 0; i < calib_size(); i++) { - if (!this->calib(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->calib())) return false; return true; } diff --git a/src/proto/messages_robocup_ssl_geometry.pb.h b/src/proto/messages_robocup_ssl_geometry.pb.h index 7d28f3a..6ddd357 100644 --- a/src/proto/messages_robocup_ssl_geometry.pb.h +++ b/src/proto/messages_robocup_ssl_geometry.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -87,7 +87,6 @@ class Vector2f : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -117,12 +116,10 @@ class Vector2f : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; float x_; float y_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -179,7 +176,6 @@ class SSL_FieldLineSegment : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -236,14 +232,12 @@ class SSL_FieldLineSegment : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::std::string* name_; ::Vector2f* p1_; ::Vector2f* p2_; float thickness_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -300,7 +294,6 @@ class SSL_FieldCicularArc : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -373,16 +366,14 @@ class SSL_FieldCicularArc : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::std::string* name_; ::Vector2f* center_; float radius_; float a1_; float a2_; float thickness_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -439,7 +430,6 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -520,6 +510,8 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int32 field_length_; ::google::protobuf::int32 field_width_; ::google::protobuf::int32 goal_width_; @@ -527,10 +519,6 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { ::google::protobuf::RepeatedPtrField< ::SSL_FieldLineSegment > field_lines_; ::google::protobuf::RepeatedPtrField< ::SSL_FieldCicularArc > field_arcs_; ::google::protobuf::int32 boundary_width_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -587,7 +575,6 @@ class SSL_GeometryCameraCalibration : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -734,6 +721,8 @@ class SSL_GeometryCameraCalibration : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::uint32 camera_id_; float focal_length_; float principal_point_x_; @@ -749,10 +738,6 @@ class SSL_GeometryCameraCalibration : public ::google::protobuf::Message { float derived_camera_world_tx_; float derived_camera_world_ty_; float derived_camera_world_tz_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(15 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -809,7 +794,6 @@ class SSL_GeometryData : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -844,12 +828,10 @@ class SSL_GeometryData : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::SSL_GeometryFieldSize* field_; ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration > calib_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_2eproto(); @@ -879,11 +861,13 @@ inline void Vector2f::clear_x() { clear_has_x(); } inline float Vector2f::x() const { + // @@protoc_insertion_point(field_get:Vector2f.x) return x_; } inline void Vector2f::set_x(float value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:Vector2f.x) } // required float y = 2; @@ -901,11 +885,13 @@ inline void Vector2f::clear_y() { clear_has_y(); } inline float Vector2f::y() const { + // @@protoc_insertion_point(field_get:Vector2f.y) return y_; } inline void Vector2f::set_y(float value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:Vector2f.y) } // ------------------------------------------------------------------- @@ -923,54 +909,59 @@ inline void SSL_FieldLineSegment::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void SSL_FieldLineSegment::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } clear_has_name(); } inline const ::std::string& SSL_FieldLineSegment::name() const { + // @@protoc_insertion_point(field_get:SSL_FieldLineSegment.name) return *name_; } inline void SSL_FieldLineSegment::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set:SSL_FieldLineSegment.name) } inline void SSL_FieldLineSegment::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set_char:SSL_FieldLineSegment.name) } inline void SSL_FieldLineSegment::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SSL_FieldLineSegment.name) } inline ::std::string* SSL_FieldLineSegment::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } + // @@protoc_insertion_point(field_mutable:SSL_FieldLineSegment.name) return name_; } inline ::std::string* SSL_FieldLineSegment::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void SSL_FieldLineSegment::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (name) { @@ -978,8 +969,9 @@ inline void SSL_FieldLineSegment::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } + // @@protoc_insertion_point(field_set_allocated:SSL_FieldLineSegment.name) } // required .Vector2f p1 = 2; @@ -997,11 +989,13 @@ inline void SSL_FieldLineSegment::clear_p1() { clear_has_p1(); } inline const ::Vector2f& SSL_FieldLineSegment::p1() const { + // @@protoc_insertion_point(field_get:SSL_FieldLineSegment.p1) return p1_ != NULL ? *p1_ : *default_instance_->p1_; } inline ::Vector2f* SSL_FieldLineSegment::mutable_p1() { set_has_p1(); if (p1_ == NULL) p1_ = new ::Vector2f; + // @@protoc_insertion_point(field_mutable:SSL_FieldLineSegment.p1) return p1_; } inline ::Vector2f* SSL_FieldLineSegment::release_p1() { @@ -1018,6 +1012,7 @@ inline void SSL_FieldLineSegment::set_allocated_p1(::Vector2f* p1) { } else { clear_has_p1(); } + // @@protoc_insertion_point(field_set_allocated:SSL_FieldLineSegment.p1) } // required .Vector2f p2 = 3; @@ -1035,11 +1030,13 @@ inline void SSL_FieldLineSegment::clear_p2() { clear_has_p2(); } inline const ::Vector2f& SSL_FieldLineSegment::p2() const { + // @@protoc_insertion_point(field_get:SSL_FieldLineSegment.p2) return p2_ != NULL ? *p2_ : *default_instance_->p2_; } inline ::Vector2f* SSL_FieldLineSegment::mutable_p2() { set_has_p2(); if (p2_ == NULL) p2_ = new ::Vector2f; + // @@protoc_insertion_point(field_mutable:SSL_FieldLineSegment.p2) return p2_; } inline ::Vector2f* SSL_FieldLineSegment::release_p2() { @@ -1056,6 +1053,7 @@ inline void SSL_FieldLineSegment::set_allocated_p2(::Vector2f* p2) { } else { clear_has_p2(); } + // @@protoc_insertion_point(field_set_allocated:SSL_FieldLineSegment.p2) } // required float thickness = 4; @@ -1073,11 +1071,13 @@ inline void SSL_FieldLineSegment::clear_thickness() { clear_has_thickness(); } inline float SSL_FieldLineSegment::thickness() const { + // @@protoc_insertion_point(field_get:SSL_FieldLineSegment.thickness) return thickness_; } inline void SSL_FieldLineSegment::set_thickness(float value) { set_has_thickness(); thickness_ = value; + // @@protoc_insertion_point(field_set:SSL_FieldLineSegment.thickness) } // ------------------------------------------------------------------- @@ -1095,54 +1095,59 @@ inline void SSL_FieldCicularArc::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void SSL_FieldCicularArc::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } clear_has_name(); } inline const ::std::string& SSL_FieldCicularArc::name() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.name) return *name_; } inline void SSL_FieldCicularArc::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set:SSL_FieldCicularArc.name) } inline void SSL_FieldCicularArc::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set_char:SSL_FieldCicularArc.name) } inline void SSL_FieldCicularArc::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SSL_FieldCicularArc.name) } inline ::std::string* SSL_FieldCicularArc::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } + // @@protoc_insertion_point(field_mutable:SSL_FieldCicularArc.name) return name_; } inline ::std::string* SSL_FieldCicularArc::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void SSL_FieldCicularArc::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (name) { @@ -1150,8 +1155,9 @@ inline void SSL_FieldCicularArc::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } + // @@protoc_insertion_point(field_set_allocated:SSL_FieldCicularArc.name) } // required .Vector2f center = 2; @@ -1169,11 +1175,13 @@ inline void SSL_FieldCicularArc::clear_center() { clear_has_center(); } inline const ::Vector2f& SSL_FieldCicularArc::center() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.center) return center_ != NULL ? *center_ : *default_instance_->center_; } inline ::Vector2f* SSL_FieldCicularArc::mutable_center() { set_has_center(); if (center_ == NULL) center_ = new ::Vector2f; + // @@protoc_insertion_point(field_mutable:SSL_FieldCicularArc.center) return center_; } inline ::Vector2f* SSL_FieldCicularArc::release_center() { @@ -1190,6 +1198,7 @@ inline void SSL_FieldCicularArc::set_allocated_center(::Vector2f* center) { } else { clear_has_center(); } + // @@protoc_insertion_point(field_set_allocated:SSL_FieldCicularArc.center) } // required float radius = 3; @@ -1207,11 +1216,13 @@ inline void SSL_FieldCicularArc::clear_radius() { clear_has_radius(); } inline float SSL_FieldCicularArc::radius() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.radius) return radius_; } inline void SSL_FieldCicularArc::set_radius(float value) { set_has_radius(); radius_ = value; + // @@protoc_insertion_point(field_set:SSL_FieldCicularArc.radius) } // required float a1 = 4; @@ -1229,11 +1240,13 @@ inline void SSL_FieldCicularArc::clear_a1() { clear_has_a1(); } inline float SSL_FieldCicularArc::a1() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.a1) return a1_; } inline void SSL_FieldCicularArc::set_a1(float value) { set_has_a1(); a1_ = value; + // @@protoc_insertion_point(field_set:SSL_FieldCicularArc.a1) } // required float a2 = 5; @@ -1251,11 +1264,13 @@ inline void SSL_FieldCicularArc::clear_a2() { clear_has_a2(); } inline float SSL_FieldCicularArc::a2() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.a2) return a2_; } inline void SSL_FieldCicularArc::set_a2(float value) { set_has_a2(); a2_ = value; + // @@protoc_insertion_point(field_set:SSL_FieldCicularArc.a2) } // required float thickness = 6; @@ -1273,11 +1288,13 @@ inline void SSL_FieldCicularArc::clear_thickness() { clear_has_thickness(); } inline float SSL_FieldCicularArc::thickness() const { + // @@protoc_insertion_point(field_get:SSL_FieldCicularArc.thickness) return thickness_; } inline void SSL_FieldCicularArc::set_thickness(float value) { set_has_thickness(); thickness_ = value; + // @@protoc_insertion_point(field_set:SSL_FieldCicularArc.thickness) } // ------------------------------------------------------------------- @@ -1299,11 +1316,13 @@ inline void SSL_GeometryFieldSize::clear_field_length() { clear_has_field_length(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::field_length() const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.field_length) return field_length_; } inline void SSL_GeometryFieldSize::set_field_length(::google::protobuf::int32 value) { set_has_field_length(); field_length_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryFieldSize.field_length) } // required int32 field_width = 2; @@ -1321,11 +1340,13 @@ inline void SSL_GeometryFieldSize::clear_field_width() { clear_has_field_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::field_width() const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.field_width) return field_width_; } inline void SSL_GeometryFieldSize::set_field_width(::google::protobuf::int32 value) { set_has_field_width(); field_width_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryFieldSize.field_width) } // required int32 goal_width = 3; @@ -1343,11 +1364,13 @@ inline void SSL_GeometryFieldSize::clear_goal_width() { clear_has_goal_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::goal_width() const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.goal_width) return goal_width_; } inline void SSL_GeometryFieldSize::set_goal_width(::google::protobuf::int32 value) { set_has_goal_width(); goal_width_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryFieldSize.goal_width) } // required int32 goal_depth = 4; @@ -1365,11 +1388,13 @@ inline void SSL_GeometryFieldSize::clear_goal_depth() { clear_has_goal_depth(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::goal_depth() const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.goal_depth) return goal_depth_; } inline void SSL_GeometryFieldSize::set_goal_depth(::google::protobuf::int32 value) { set_has_goal_depth(); goal_depth_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryFieldSize.goal_depth) } // required int32 boundary_width = 5; @@ -1387,11 +1412,13 @@ inline void SSL_GeometryFieldSize::clear_boundary_width() { clear_has_boundary_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::boundary_width() const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.boundary_width) return boundary_width_; } inline void SSL_GeometryFieldSize::set_boundary_width(::google::protobuf::int32 value) { set_has_boundary_width(); boundary_width_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryFieldSize.boundary_width) } // repeated .SSL_FieldLineSegment field_lines = 6; @@ -1402,20 +1429,25 @@ inline void SSL_GeometryFieldSize::clear_field_lines() { field_lines_.Clear(); } inline const ::SSL_FieldLineSegment& SSL_GeometryFieldSize::field_lines(int index) const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.field_lines) return field_lines_.Get(index); } inline ::SSL_FieldLineSegment* SSL_GeometryFieldSize::mutable_field_lines(int index) { + // @@protoc_insertion_point(field_mutable:SSL_GeometryFieldSize.field_lines) return field_lines_.Mutable(index); } inline ::SSL_FieldLineSegment* SSL_GeometryFieldSize::add_field_lines() { + // @@protoc_insertion_point(field_add:SSL_GeometryFieldSize.field_lines) return field_lines_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_FieldLineSegment >& SSL_GeometryFieldSize::field_lines() const { + // @@protoc_insertion_point(field_list:SSL_GeometryFieldSize.field_lines) return field_lines_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_FieldLineSegment >* SSL_GeometryFieldSize::mutable_field_lines() { + // @@protoc_insertion_point(field_mutable_list:SSL_GeometryFieldSize.field_lines) return &field_lines_; } @@ -1427,20 +1459,25 @@ inline void SSL_GeometryFieldSize::clear_field_arcs() { field_arcs_.Clear(); } inline const ::SSL_FieldCicularArc& SSL_GeometryFieldSize::field_arcs(int index) const { + // @@protoc_insertion_point(field_get:SSL_GeometryFieldSize.field_arcs) return field_arcs_.Get(index); } inline ::SSL_FieldCicularArc* SSL_GeometryFieldSize::mutable_field_arcs(int index) { + // @@protoc_insertion_point(field_mutable:SSL_GeometryFieldSize.field_arcs) return field_arcs_.Mutable(index); } inline ::SSL_FieldCicularArc* SSL_GeometryFieldSize::add_field_arcs() { + // @@protoc_insertion_point(field_add:SSL_GeometryFieldSize.field_arcs) return field_arcs_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_FieldCicularArc >& SSL_GeometryFieldSize::field_arcs() const { + // @@protoc_insertion_point(field_list:SSL_GeometryFieldSize.field_arcs) return field_arcs_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_FieldCicularArc >* SSL_GeometryFieldSize::mutable_field_arcs() { + // @@protoc_insertion_point(field_mutable_list:SSL_GeometryFieldSize.field_arcs) return &field_arcs_; } @@ -1463,11 +1500,13 @@ inline void SSL_GeometryCameraCalibration::clear_camera_id() { clear_has_camera_id(); } inline ::google::protobuf::uint32 SSL_GeometryCameraCalibration::camera_id() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.camera_id) return camera_id_; } inline void SSL_GeometryCameraCalibration::set_camera_id(::google::protobuf::uint32 value) { set_has_camera_id(); camera_id_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.camera_id) } // required float focal_length = 2; @@ -1485,11 +1524,13 @@ inline void SSL_GeometryCameraCalibration::clear_focal_length() { clear_has_focal_length(); } inline float SSL_GeometryCameraCalibration::focal_length() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.focal_length) return focal_length_; } inline void SSL_GeometryCameraCalibration::set_focal_length(float value) { set_has_focal_length(); focal_length_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.focal_length) } // required float principal_point_x = 3; @@ -1507,11 +1548,13 @@ inline void SSL_GeometryCameraCalibration::clear_principal_point_x() { clear_has_principal_point_x(); } inline float SSL_GeometryCameraCalibration::principal_point_x() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.principal_point_x) return principal_point_x_; } inline void SSL_GeometryCameraCalibration::set_principal_point_x(float value) { set_has_principal_point_x(); principal_point_x_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.principal_point_x) } // required float principal_point_y = 4; @@ -1529,11 +1572,13 @@ inline void SSL_GeometryCameraCalibration::clear_principal_point_y() { clear_has_principal_point_y(); } inline float SSL_GeometryCameraCalibration::principal_point_y() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.principal_point_y) return principal_point_y_; } inline void SSL_GeometryCameraCalibration::set_principal_point_y(float value) { set_has_principal_point_y(); principal_point_y_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.principal_point_y) } // required float distortion = 5; @@ -1551,11 +1596,13 @@ inline void SSL_GeometryCameraCalibration::clear_distortion() { clear_has_distortion(); } inline float SSL_GeometryCameraCalibration::distortion() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.distortion) return distortion_; } inline void SSL_GeometryCameraCalibration::set_distortion(float value) { set_has_distortion(); distortion_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.distortion) } // required float q0 = 6; @@ -1573,11 +1620,13 @@ inline void SSL_GeometryCameraCalibration::clear_q0() { clear_has_q0(); } inline float SSL_GeometryCameraCalibration::q0() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.q0) return q0_; } inline void SSL_GeometryCameraCalibration::set_q0(float value) { set_has_q0(); q0_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.q0) } // required float q1 = 7; @@ -1595,11 +1644,13 @@ inline void SSL_GeometryCameraCalibration::clear_q1() { clear_has_q1(); } inline float SSL_GeometryCameraCalibration::q1() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.q1) return q1_; } inline void SSL_GeometryCameraCalibration::set_q1(float value) { set_has_q1(); q1_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.q1) } // required float q2 = 8; @@ -1617,11 +1668,13 @@ inline void SSL_GeometryCameraCalibration::clear_q2() { clear_has_q2(); } inline float SSL_GeometryCameraCalibration::q2() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.q2) return q2_; } inline void SSL_GeometryCameraCalibration::set_q2(float value) { set_has_q2(); q2_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.q2) } // required float q3 = 9; @@ -1639,11 +1692,13 @@ inline void SSL_GeometryCameraCalibration::clear_q3() { clear_has_q3(); } inline float SSL_GeometryCameraCalibration::q3() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.q3) return q3_; } inline void SSL_GeometryCameraCalibration::set_q3(float value) { set_has_q3(); q3_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.q3) } // required float tx = 10; @@ -1661,11 +1716,13 @@ inline void SSL_GeometryCameraCalibration::clear_tx() { clear_has_tx(); } inline float SSL_GeometryCameraCalibration::tx() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.tx) return tx_; } inline void SSL_GeometryCameraCalibration::set_tx(float value) { set_has_tx(); tx_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.tx) } // required float ty = 11; @@ -1683,11 +1740,13 @@ inline void SSL_GeometryCameraCalibration::clear_ty() { clear_has_ty(); } inline float SSL_GeometryCameraCalibration::ty() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.ty) return ty_; } inline void SSL_GeometryCameraCalibration::set_ty(float value) { set_has_ty(); ty_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.ty) } // required float tz = 12; @@ -1705,11 +1764,13 @@ inline void SSL_GeometryCameraCalibration::clear_tz() { clear_has_tz(); } inline float SSL_GeometryCameraCalibration::tz() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.tz) return tz_; } inline void SSL_GeometryCameraCalibration::set_tz(float value) { set_has_tz(); tz_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.tz) } // optional float derived_camera_world_tx = 13; @@ -1727,11 +1788,13 @@ inline void SSL_GeometryCameraCalibration::clear_derived_camera_world_tx() { clear_has_derived_camera_world_tx(); } inline float SSL_GeometryCameraCalibration::derived_camera_world_tx() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.derived_camera_world_tx) return derived_camera_world_tx_; } inline void SSL_GeometryCameraCalibration::set_derived_camera_world_tx(float value) { set_has_derived_camera_world_tx(); derived_camera_world_tx_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.derived_camera_world_tx) } // optional float derived_camera_world_ty = 14; @@ -1749,11 +1812,13 @@ inline void SSL_GeometryCameraCalibration::clear_derived_camera_world_ty() { clear_has_derived_camera_world_ty(); } inline float SSL_GeometryCameraCalibration::derived_camera_world_ty() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.derived_camera_world_ty) return derived_camera_world_ty_; } inline void SSL_GeometryCameraCalibration::set_derived_camera_world_ty(float value) { set_has_derived_camera_world_ty(); derived_camera_world_ty_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.derived_camera_world_ty) } // optional float derived_camera_world_tz = 15; @@ -1771,11 +1836,13 @@ inline void SSL_GeometryCameraCalibration::clear_derived_camera_world_tz() { clear_has_derived_camera_world_tz(); } inline float SSL_GeometryCameraCalibration::derived_camera_world_tz() const { + // @@protoc_insertion_point(field_get:SSL_GeometryCameraCalibration.derived_camera_world_tz) return derived_camera_world_tz_; } inline void SSL_GeometryCameraCalibration::set_derived_camera_world_tz(float value) { set_has_derived_camera_world_tz(); derived_camera_world_tz_ = value; + // @@protoc_insertion_point(field_set:SSL_GeometryCameraCalibration.derived_camera_world_tz) } // ------------------------------------------------------------------- @@ -1797,11 +1864,13 @@ inline void SSL_GeometryData::clear_field() { clear_has_field(); } inline const ::SSL_GeometryFieldSize& SSL_GeometryData::field() const { + // @@protoc_insertion_point(field_get:SSL_GeometryData.field) return field_ != NULL ? *field_ : *default_instance_->field_; } inline ::SSL_GeometryFieldSize* SSL_GeometryData::mutable_field() { set_has_field(); if (field_ == NULL) field_ = new ::SSL_GeometryFieldSize; + // @@protoc_insertion_point(field_mutable:SSL_GeometryData.field) return field_; } inline ::SSL_GeometryFieldSize* SSL_GeometryData::release_field() { @@ -1818,6 +1887,7 @@ inline void SSL_GeometryData::set_allocated_field(::SSL_GeometryFieldSize* field } else { clear_has_field(); } + // @@protoc_insertion_point(field_set_allocated:SSL_GeometryData.field) } // repeated .SSL_GeometryCameraCalibration calib = 2; @@ -1828,20 +1898,25 @@ inline void SSL_GeometryData::clear_calib() { calib_.Clear(); } inline const ::SSL_GeometryCameraCalibration& SSL_GeometryData::calib(int index) const { + // @@protoc_insertion_point(field_get:SSL_GeometryData.calib) return calib_.Get(index); } inline ::SSL_GeometryCameraCalibration* SSL_GeometryData::mutable_calib(int index) { + // @@protoc_insertion_point(field_mutable:SSL_GeometryData.calib) return calib_.Mutable(index); } inline ::SSL_GeometryCameraCalibration* SSL_GeometryData::add_calib() { + // @@protoc_insertion_point(field_add:SSL_GeometryData.calib) return calib_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration >& SSL_GeometryData::calib() const { + // @@protoc_insertion_point(field_list:SSL_GeometryData.calib) return calib_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration >* SSL_GeometryData::mutable_calib() { + // @@protoc_insertion_point(field_mutable_list:SSL_GeometryData.calib) return &calib_; } diff --git a/src/proto/messages_robocup_ssl_geometry_legacy.pb.cc b/src/proto/messages_robocup_ssl_geometry_legacy.pb.cc index b5569a2..6a3d7f8 100644 --- a/src/proto/messages_robocup_ssl_geometry_legacy.pb.cc +++ b/src/proto/messages_robocup_ssl_geometry_legacy.pb.cc @@ -170,6 +170,7 @@ const int SSL_GeometryFieldSize::kPenaltyLineFromSpotDistFieldNumber; SSL_GeometryFieldSize::SSL_GeometryFieldSize() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) } void SSL_GeometryFieldSize::InitAsDefaultInstance() { @@ -179,6 +180,7 @@ SSL_GeometryFieldSize::SSL_GeometryFieldSize(const SSL_GeometryFieldSize& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) } void SSL_GeometryFieldSize::SharedCtor() { @@ -201,6 +203,7 @@ void SSL_GeometryFieldSize::SharedCtor() { } SSL_GeometryFieldSize::~SSL_GeometryFieldSize() { + // @@protoc_insertion_point(destructor:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) SharedDtor(); } @@ -231,44 +234,49 @@ SSL_GeometryFieldSize* SSL_GeometryFieldSize::New() const { } void SSL_GeometryFieldSize::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - line_width_ = 0; - field_length_ = 0; - field_width_ = 0; - boundary_width_ = 0; - referee_width_ = 0; - goal_width_ = 0; - goal_depth_ = 0; - goal_wall_width_ = 0; +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(line_width_, goal_wall_width_); } - if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { - center_circle_radius_ = 0; - defense_radius_ = 0; - defense_stretch_ = 0; - free_kick_from_defense_dist_ = 0; - penalty_spot_from_field_line_dist_ = 0; - penalty_line_from_spot_dist_ = 0; + if (_has_bits_[8 / 32] & 16128) { + ZR_(center_circle_radius_, penalty_line_from_spot_dist_); } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_GeometryFieldSize::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 line_width = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &line_width_))); set_has_line_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_field_length; break; @@ -276,15 +284,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 field_length = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_field_length: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &field_length_))); set_has_field_length(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(24)) goto parse_field_width; break; @@ -292,15 +299,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 field_width = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 24) { parse_field_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &field_width_))); set_has_field_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_boundary_width; break; @@ -308,15 +314,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 boundary_width = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_boundary_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &boundary_width_))); set_has_boundary_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_referee_width; break; @@ -324,15 +329,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 referee_width = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_referee_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &referee_width_))); set_has_referee_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(48)) goto parse_goal_width; break; @@ -340,15 +344,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 goal_width = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 48) { parse_goal_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &goal_width_))); set_has_goal_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(56)) goto parse_goal_depth; break; @@ -356,15 +359,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 goal_depth = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 56) { parse_goal_depth: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &goal_depth_))); set_has_goal_depth(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(64)) goto parse_goal_wall_width; break; @@ -372,15 +374,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 goal_wall_width = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 64) { parse_goal_wall_width: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &goal_wall_width_))); set_has_goal_wall_width(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(72)) goto parse_center_circle_radius; break; @@ -388,15 +389,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 center_circle_radius = 9; case 9: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 72) { parse_center_circle_radius: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, ¢er_circle_radius_))); set_has_center_circle_radius(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(80)) goto parse_defense_radius; break; @@ -404,15 +404,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 defense_radius = 10; case 10: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 80) { parse_defense_radius: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &defense_radius_))); set_has_defense_radius(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(88)) goto parse_defense_stretch; break; @@ -420,15 +419,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 defense_stretch = 11; case 11: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 88) { parse_defense_stretch: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &defense_stretch_))); set_has_defense_stretch(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(96)) goto parse_free_kick_from_defense_dist; break; @@ -436,15 +434,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 free_kick_from_defense_dist = 12; case 12: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 96) { parse_free_kick_from_defense_dist: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &free_kick_from_defense_dist_))); set_has_free_kick_from_defense_dist(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(104)) goto parse_penalty_spot_from_field_line_dist; break; @@ -452,15 +449,14 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 penalty_spot_from_field_line_dist = 13; case 13: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 104) { parse_penalty_spot_from_field_line_dist: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &penalty_spot_from_field_line_dist_))); set_has_penalty_spot_from_field_line_dist(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(112)) goto parse_penalty_line_from_spot_dist; break; @@ -468,25 +464,25 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( // required int32 penalty_line_from_spot_dist = 14; case 14: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 112) { parse_penalty_line_from_spot_dist: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &penalty_line_from_spot_dist_))); set_has_penalty_line_from_spot_dist(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -494,12 +490,18 @@ bool SSL_GeometryFieldSize::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) return true; +failure: + // @@protoc_insertion_point(parse_failure:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) + return false; #undef DO_ } void SSL_GeometryFieldSize::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) // required int32 line_width = 1; if (has_line_width()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->line_width(), output); @@ -574,10 +576,12 @@ void SSL_GeometryFieldSize::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) } ::google::protobuf::uint8* SSL_GeometryFieldSize::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) // required int32 line_width = 1; if (has_line_width()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->line_width(), target); @@ -652,6 +656,7 @@ ::google::protobuf::uint8* SSL_GeometryFieldSize::SerializeWithCachedSizesToArra target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize) return target; } @@ -893,6 +898,7 @@ const int SSL_GeometryData::kCalibFieldNumber; SSL_GeometryData::SSL_GeometryData() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:RoboCup2014Legacy.Geometry.SSL_GeometryData) } void SSL_GeometryData::InitAsDefaultInstance() { @@ -903,6 +909,7 @@ SSL_GeometryData::SSL_GeometryData(const SSL_GeometryData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:RoboCup2014Legacy.Geometry.SSL_GeometryData) } void SSL_GeometryData::SharedCtor() { @@ -912,6 +919,7 @@ void SSL_GeometryData::SharedCtor() { } SSL_GeometryData::~SSL_GeometryData() { + // @@protoc_insertion_point(destructor:RoboCup2014Legacy.Geometry.SSL_GeometryData) SharedDtor(); } @@ -943,10 +951,8 @@ SSL_GeometryData* SSL_GeometryData::New() const { } void SSL_GeometryData::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - if (has_field()) { - if (field_ != NULL) field_->::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize::Clear(); - } + if (has_field()) { + if (field_ != NULL) field_->::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize::Clear(); } calib_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -955,18 +961,21 @@ void SSL_GeometryData::Clear() { bool SSL_GeometryData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:RoboCup2014Legacy.Geometry.SSL_GeometryData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required .RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize field = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_field())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_calib; break; @@ -974,24 +983,24 @@ bool SSL_GeometryData::MergePartialFromCodedStream( // repeated .SSL_GeometryCameraCalibration calib = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_calib: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_calib())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_calib; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -999,12 +1008,18 @@ bool SSL_GeometryData::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:RoboCup2014Legacy.Geometry.SSL_GeometryData) return true; +failure: + // @@protoc_insertion_point(parse_failure:RoboCup2014Legacy.Geometry.SSL_GeometryData) + return false; #undef DO_ } void SSL_GeometryData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:RoboCup2014Legacy.Geometry.SSL_GeometryData) // required .RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize field = 1; if (has_field()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -1021,10 +1036,12 @@ void SSL_GeometryData::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:RoboCup2014Legacy.Geometry.SSL_GeometryData) } ::google::protobuf::uint8* SSL_GeometryData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:RoboCup2014Legacy.Geometry.SSL_GeometryData) // required .RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize field = 1; if (has_field()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -1043,6 +1060,7 @@ ::google::protobuf::uint8* SSL_GeometryData::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:RoboCup2014Legacy.Geometry.SSL_GeometryData) return target; } @@ -1118,9 +1136,7 @@ bool SSL_GeometryData::IsInitialized() const { if (has_field()) { if (!this->field().IsInitialized()) return false; } - for (int i = 0; i < calib_size(); i++) { - if (!this->calib(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->calib())) return false; return true; } diff --git a/src/proto/messages_robocup_ssl_geometry_legacy.pb.h b/src/proto/messages_robocup_ssl_geometry_legacy.pb.h index 410a8d1..4ee1422 100644 --- a/src/proto/messages_robocup_ssl_geometry_legacy.pb.h +++ b/src/proto/messages_robocup_ssl_geometry_legacy.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -87,7 +87,6 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -225,6 +224,8 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int32 line_width_; ::google::protobuf::int32 field_length_; ::google::protobuf::int32 field_width_; @@ -239,10 +240,6 @@ class SSL_GeometryFieldSize : public ::google::protobuf::Message { ::google::protobuf::int32 free_kick_from_defense_dist_; ::google::protobuf::int32 penalty_spot_from_field_line_dist_; ::google::protobuf::int32 penalty_line_from_spot_dist_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(14 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); @@ -299,7 +296,6 @@ class SSL_GeometryData : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -334,12 +330,10 @@ class SSL_GeometryData : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize* field_; ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration > calib_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fgeometry_5flegacy_2eproto(); @@ -369,11 +363,13 @@ inline void SSL_GeometryFieldSize::clear_line_width() { clear_has_line_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::line_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.line_width) return line_width_; } inline void SSL_GeometryFieldSize::set_line_width(::google::protobuf::int32 value) { set_has_line_width(); line_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.line_width) } // required int32 field_length = 2; @@ -391,11 +387,13 @@ inline void SSL_GeometryFieldSize::clear_field_length() { clear_has_field_length(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::field_length() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.field_length) return field_length_; } inline void SSL_GeometryFieldSize::set_field_length(::google::protobuf::int32 value) { set_has_field_length(); field_length_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.field_length) } // required int32 field_width = 3; @@ -413,11 +411,13 @@ inline void SSL_GeometryFieldSize::clear_field_width() { clear_has_field_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::field_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.field_width) return field_width_; } inline void SSL_GeometryFieldSize::set_field_width(::google::protobuf::int32 value) { set_has_field_width(); field_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.field_width) } // required int32 boundary_width = 4; @@ -435,11 +435,13 @@ inline void SSL_GeometryFieldSize::clear_boundary_width() { clear_has_boundary_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::boundary_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.boundary_width) return boundary_width_; } inline void SSL_GeometryFieldSize::set_boundary_width(::google::protobuf::int32 value) { set_has_boundary_width(); boundary_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.boundary_width) } // required int32 referee_width = 5; @@ -457,11 +459,13 @@ inline void SSL_GeometryFieldSize::clear_referee_width() { clear_has_referee_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::referee_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.referee_width) return referee_width_; } inline void SSL_GeometryFieldSize::set_referee_width(::google::protobuf::int32 value) { set_has_referee_width(); referee_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.referee_width) } // required int32 goal_width = 6; @@ -479,11 +483,13 @@ inline void SSL_GeometryFieldSize::clear_goal_width() { clear_has_goal_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::goal_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_width) return goal_width_; } inline void SSL_GeometryFieldSize::set_goal_width(::google::protobuf::int32 value) { set_has_goal_width(); goal_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_width) } // required int32 goal_depth = 7; @@ -501,11 +507,13 @@ inline void SSL_GeometryFieldSize::clear_goal_depth() { clear_has_goal_depth(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::goal_depth() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_depth) return goal_depth_; } inline void SSL_GeometryFieldSize::set_goal_depth(::google::protobuf::int32 value) { set_has_goal_depth(); goal_depth_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_depth) } // required int32 goal_wall_width = 8; @@ -523,11 +531,13 @@ inline void SSL_GeometryFieldSize::clear_goal_wall_width() { clear_has_goal_wall_width(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::goal_wall_width() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_wall_width) return goal_wall_width_; } inline void SSL_GeometryFieldSize::set_goal_wall_width(::google::protobuf::int32 value) { set_has_goal_wall_width(); goal_wall_width_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.goal_wall_width) } // required int32 center_circle_radius = 9; @@ -545,11 +555,13 @@ inline void SSL_GeometryFieldSize::clear_center_circle_radius() { clear_has_center_circle_radius(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::center_circle_radius() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.center_circle_radius) return center_circle_radius_; } inline void SSL_GeometryFieldSize::set_center_circle_radius(::google::protobuf::int32 value) { set_has_center_circle_radius(); center_circle_radius_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.center_circle_radius) } // required int32 defense_radius = 10; @@ -567,11 +579,13 @@ inline void SSL_GeometryFieldSize::clear_defense_radius() { clear_has_defense_radius(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::defense_radius() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.defense_radius) return defense_radius_; } inline void SSL_GeometryFieldSize::set_defense_radius(::google::protobuf::int32 value) { set_has_defense_radius(); defense_radius_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.defense_radius) } // required int32 defense_stretch = 11; @@ -589,11 +603,13 @@ inline void SSL_GeometryFieldSize::clear_defense_stretch() { clear_has_defense_stretch(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::defense_stretch() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.defense_stretch) return defense_stretch_; } inline void SSL_GeometryFieldSize::set_defense_stretch(::google::protobuf::int32 value) { set_has_defense_stretch(); defense_stretch_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.defense_stretch) } // required int32 free_kick_from_defense_dist = 12; @@ -611,11 +627,13 @@ inline void SSL_GeometryFieldSize::clear_free_kick_from_defense_dist() { clear_has_free_kick_from_defense_dist(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::free_kick_from_defense_dist() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.free_kick_from_defense_dist) return free_kick_from_defense_dist_; } inline void SSL_GeometryFieldSize::set_free_kick_from_defense_dist(::google::protobuf::int32 value) { set_has_free_kick_from_defense_dist(); free_kick_from_defense_dist_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.free_kick_from_defense_dist) } // required int32 penalty_spot_from_field_line_dist = 13; @@ -633,11 +651,13 @@ inline void SSL_GeometryFieldSize::clear_penalty_spot_from_field_line_dist() { clear_has_penalty_spot_from_field_line_dist(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::penalty_spot_from_field_line_dist() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.penalty_spot_from_field_line_dist) return penalty_spot_from_field_line_dist_; } inline void SSL_GeometryFieldSize::set_penalty_spot_from_field_line_dist(::google::protobuf::int32 value) { set_has_penalty_spot_from_field_line_dist(); penalty_spot_from_field_line_dist_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.penalty_spot_from_field_line_dist) } // required int32 penalty_line_from_spot_dist = 14; @@ -655,11 +675,13 @@ inline void SSL_GeometryFieldSize::clear_penalty_line_from_spot_dist() { clear_has_penalty_line_from_spot_dist(); } inline ::google::protobuf::int32 SSL_GeometryFieldSize::penalty_line_from_spot_dist() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.penalty_line_from_spot_dist) return penalty_line_from_spot_dist_; } inline void SSL_GeometryFieldSize::set_penalty_line_from_spot_dist(::google::protobuf::int32 value) { set_has_penalty_line_from_spot_dist(); penalty_line_from_spot_dist_ = value; + // @@protoc_insertion_point(field_set:RoboCup2014Legacy.Geometry.SSL_GeometryFieldSize.penalty_line_from_spot_dist) } // ------------------------------------------------------------------- @@ -681,11 +703,13 @@ inline void SSL_GeometryData::clear_field() { clear_has_field(); } inline const ::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize& SSL_GeometryData::field() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryData.field) return field_ != NULL ? *field_ : *default_instance_->field_; } inline ::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize* SSL_GeometryData::mutable_field() { set_has_field(); if (field_ == NULL) field_ = new ::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize; + // @@protoc_insertion_point(field_mutable:RoboCup2014Legacy.Geometry.SSL_GeometryData.field) return field_; } inline ::RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize* SSL_GeometryData::release_field() { @@ -702,6 +726,7 @@ inline void SSL_GeometryData::set_allocated_field(::RoboCup2014Legacy::Geometry: } else { clear_has_field(); } + // @@protoc_insertion_point(field_set_allocated:RoboCup2014Legacy.Geometry.SSL_GeometryData.field) } // repeated .SSL_GeometryCameraCalibration calib = 2; @@ -712,20 +737,25 @@ inline void SSL_GeometryData::clear_calib() { calib_.Clear(); } inline const ::SSL_GeometryCameraCalibration& SSL_GeometryData::calib(int index) const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Geometry.SSL_GeometryData.calib) return calib_.Get(index); } inline ::SSL_GeometryCameraCalibration* SSL_GeometryData::mutable_calib(int index) { + // @@protoc_insertion_point(field_mutable:RoboCup2014Legacy.Geometry.SSL_GeometryData.calib) return calib_.Mutable(index); } inline ::SSL_GeometryCameraCalibration* SSL_GeometryData::add_calib() { + // @@protoc_insertion_point(field_add:RoboCup2014Legacy.Geometry.SSL_GeometryData.calib) return calib_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration >& SSL_GeometryData::calib() const { + // @@protoc_insertion_point(field_list:RoboCup2014Legacy.Geometry.SSL_GeometryData.calib) return calib_; } inline ::google::protobuf::RepeatedPtrField< ::SSL_GeometryCameraCalibration >* SSL_GeometryData::mutable_calib() { + // @@protoc_insertion_point(field_mutable_list:RoboCup2014Legacy.Geometry.SSL_GeometryData.calib) return &calib_; } diff --git a/src/proto/messages_robocup_ssl_refbox_log.pb.cc b/src/proto/messages_robocup_ssl_refbox_log.pb.cc index f0d3c38..d8238e0 100644 --- a/src/proto/messages_robocup_ssl_refbox_log.pb.cc +++ b/src/proto/messages_robocup_ssl_refbox_log.pb.cc @@ -131,6 +131,7 @@ const int Log_Frame::kRefboxCmdFieldNumber; Log_Frame::Log_Frame() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Log_Frame) } void Log_Frame::InitAsDefaultInstance() { @@ -141,21 +142,24 @@ Log_Frame::Log_Frame(const Log_Frame& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Log_Frame) } void Log_Frame::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; frame_ = NULL; - refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } Log_Frame::~Log_Frame() { + // @@protoc_insertion_point(destructor:Log_Frame) SharedDtor(); } void Log_Frame::SharedDtor() { - if (refbox_cmd_ != &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete refbox_cmd_; } if (this != default_instance_) { @@ -185,12 +189,12 @@ Log_Frame* Log_Frame::New() const { } void Log_Frame::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { if (has_frame()) { if (frame_ != NULL) frame_->::SSL_DetectionFrame::Clear(); } if (has_refbox_cmd()) { - if (refbox_cmd_ != &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_->clear(); } } @@ -201,18 +205,21 @@ void Log_Frame::Clear() { bool Log_Frame::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Log_Frame) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required .SSL_DetectionFrame frame = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_frame())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_refbox_cmd; break; @@ -220,26 +227,27 @@ bool Log_Frame::MergePartialFromCodedStream( // required string refbox_cmd = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_refbox_cmd: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_refbox_cmd())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->refbox_cmd().data(), this->refbox_cmd().length(), - ::google::protobuf::internal::WireFormat::PARSE); + ::google::protobuf::internal::WireFormat::PARSE, + "refbox_cmd"); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -247,12 +255,18 @@ bool Log_Frame::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Log_Frame) return true; +failure: + // @@protoc_insertion_point(parse_failure:Log_Frame) + return false; #undef DO_ } void Log_Frame::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Log_Frame) // required .SSL_DetectionFrame frame = 1; if (has_frame()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -261,10 +275,11 @@ void Log_Frame::SerializeWithCachedSizes( // required string refbox_cmd = 2; if (has_refbox_cmd()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->refbox_cmd().data(), this->refbox_cmd().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( + ::google::protobuf::internal::WireFormat::SERIALIZE, + "refbox_cmd"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->refbox_cmd(), output); } @@ -272,10 +287,12 @@ void Log_Frame::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Log_Frame) } ::google::protobuf::uint8* Log_Frame::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Log_Frame) // required .SSL_DetectionFrame frame = 1; if (has_frame()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -285,9 +302,10 @@ ::google::protobuf::uint8* Log_Frame::SerializeWithCachedSizesToArray( // required string refbox_cmd = 2; if (has_refbox_cmd()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->refbox_cmd().data(), this->refbox_cmd().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormat::SERIALIZE, + "refbox_cmd"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->refbox_cmd(), target); @@ -297,6 +315,7 @@ ::google::protobuf::uint8* Log_Frame::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Log_Frame) return target; } @@ -404,6 +423,7 @@ const int Refbox_Log::kLogFieldNumber; Refbox_Log::Refbox_Log() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Refbox_Log) } void Refbox_Log::InitAsDefaultInstance() { @@ -413,6 +433,7 @@ Refbox_Log::Refbox_Log(const Refbox_Log& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Refbox_Log) } void Refbox_Log::SharedCtor() { @@ -421,6 +442,7 @@ void Refbox_Log::SharedCtor() { } Refbox_Log::~Refbox_Log() { + // @@protoc_insertion_point(destructor:Refbox_Log) SharedDtor(); } @@ -458,30 +480,34 @@ void Refbox_Log::Clear() { bool Refbox_Log::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Refbox_Log) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .Log_Frame log = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { parse_log: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_log())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(10)) goto parse_log; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -489,12 +515,18 @@ bool Refbox_Log::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Refbox_Log) return true; +failure: + // @@protoc_insertion_point(parse_failure:Refbox_Log) + return false; #undef DO_ } void Refbox_Log::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Refbox_Log) // repeated .Log_Frame log = 1; for (int i = 0; i < this->log_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -505,10 +537,12 @@ void Refbox_Log::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Refbox_Log) } ::google::protobuf::uint8* Refbox_Log::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Refbox_Log) // repeated .Log_Frame log = 1; for (int i = 0; i < this->log_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: @@ -520,6 +554,7 @@ ::google::protobuf::uint8* Refbox_Log::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Refbox_Log) return target; } @@ -577,9 +612,7 @@ void Refbox_Log::CopyFrom(const Refbox_Log& from) { bool Refbox_Log::IsInitialized() const { - for (int i = 0; i < log_size(); i++) { - if (!this->log(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->log())) return false; return true; } diff --git a/src/proto/messages_robocup_ssl_refbox_log.pb.h b/src/proto/messages_robocup_ssl_refbox_log.pb.h index 1f2ba5c..20367a8 100644 --- a/src/proto/messages_robocup_ssl_refbox_log.pb.h +++ b/src/proto/messages_robocup_ssl_refbox_log.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class Log_Frame : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -121,12 +120,10 @@ class Log_Frame : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::SSL_DetectionFrame* frame_; ::std::string* refbox_cmd_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); @@ -183,7 +180,6 @@ class Refbox_Log : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -207,11 +203,9 @@ class Refbox_Log : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; - ::google::protobuf::RepeatedPtrField< ::Log_Frame > log_; - + ::google::protobuf::uint32 _has_bits_[1]; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; - + ::google::protobuf::RepeatedPtrField< ::Log_Frame > log_; friend void protobuf_AddDesc_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5frefbox_5flog_2eproto(); @@ -241,11 +235,13 @@ inline void Log_Frame::clear_frame() { clear_has_frame(); } inline const ::SSL_DetectionFrame& Log_Frame::frame() const { + // @@protoc_insertion_point(field_get:Log_Frame.frame) return frame_ != NULL ? *frame_ : *default_instance_->frame_; } inline ::SSL_DetectionFrame* Log_Frame::mutable_frame() { set_has_frame(); if (frame_ == NULL) frame_ = new ::SSL_DetectionFrame; + // @@protoc_insertion_point(field_mutable:Log_Frame.frame) return frame_; } inline ::SSL_DetectionFrame* Log_Frame::release_frame() { @@ -262,6 +258,7 @@ inline void Log_Frame::set_allocated_frame(::SSL_DetectionFrame* frame) { } else { clear_has_frame(); } + // @@protoc_insertion_point(field_set_allocated:Log_Frame.frame) } // required string refbox_cmd = 2; @@ -275,54 +272,59 @@ inline void Log_Frame::clear_has_refbox_cmd() { _has_bits_[0] &= ~0x00000002u; } inline void Log_Frame::clear_refbox_cmd() { - if (refbox_cmd_ != &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_->clear(); } clear_has_refbox_cmd(); } inline const ::std::string& Log_Frame::refbox_cmd() const { + // @@protoc_insertion_point(field_get:Log_Frame.refbox_cmd) return *refbox_cmd_; } inline void Log_Frame::set_refbox_cmd(const ::std::string& value) { set_has_refbox_cmd(); - if (refbox_cmd_ == &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_ = new ::std::string; } refbox_cmd_->assign(value); + // @@protoc_insertion_point(field_set:Log_Frame.refbox_cmd) } inline void Log_Frame::set_refbox_cmd(const char* value) { set_has_refbox_cmd(); - if (refbox_cmd_ == &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_ = new ::std::string; } refbox_cmd_->assign(value); + // @@protoc_insertion_point(field_set_char:Log_Frame.refbox_cmd) } inline void Log_Frame::set_refbox_cmd(const char* value, size_t size) { set_has_refbox_cmd(); - if (refbox_cmd_ == &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_ = new ::std::string; } refbox_cmd_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:Log_Frame.refbox_cmd) } inline ::std::string* Log_Frame::mutable_refbox_cmd() { set_has_refbox_cmd(); - if (refbox_cmd_ == &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { refbox_cmd_ = new ::std::string; } + // @@protoc_insertion_point(field_mutable:Log_Frame.refbox_cmd) return refbox_cmd_; } inline ::std::string* Log_Frame::release_refbox_cmd() { clear_has_refbox_cmd(); - if (refbox_cmd_ == &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = refbox_cmd_; - refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void Log_Frame::set_allocated_refbox_cmd(::std::string* refbox_cmd) { - if (refbox_cmd_ != &::google::protobuf::internal::kEmptyString) { + if (refbox_cmd_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete refbox_cmd_; } if (refbox_cmd) { @@ -330,8 +332,9 @@ inline void Log_Frame::set_allocated_refbox_cmd(::std::string* refbox_cmd) { refbox_cmd_ = refbox_cmd; } else { clear_has_refbox_cmd(); - refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + refbox_cmd_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } + // @@protoc_insertion_point(field_set_allocated:Log_Frame.refbox_cmd) } // ------------------------------------------------------------------- @@ -346,20 +349,25 @@ inline void Refbox_Log::clear_log() { log_.Clear(); } inline const ::Log_Frame& Refbox_Log::log(int index) const { + // @@protoc_insertion_point(field_get:Refbox_Log.log) return log_.Get(index); } inline ::Log_Frame* Refbox_Log::mutable_log(int index) { + // @@protoc_insertion_point(field_mutable:Refbox_Log.log) return log_.Mutable(index); } inline ::Log_Frame* Refbox_Log::add_log() { + // @@protoc_insertion_point(field_add:Refbox_Log.log) return log_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::Log_Frame >& Refbox_Log::log() const { + // @@protoc_insertion_point(field_list:Refbox_Log.log) return log_; } inline ::google::protobuf::RepeatedPtrField< ::Log_Frame >* Refbox_Log::mutable_log() { + // @@protoc_insertion_point(field_mutable_list:Refbox_Log.log) return &log_; } diff --git a/src/proto/messages_robocup_ssl_wrapper.pb.cc b/src/proto/messages_robocup_ssl_wrapper.pb.cc index 88e52a4..b633495 100644 --- a/src/proto/messages_robocup_ssl_wrapper.pb.cc +++ b/src/proto/messages_robocup_ssl_wrapper.pb.cc @@ -109,6 +109,7 @@ const int SSL_WrapperPacket::kGeometryFieldNumber; SSL_WrapperPacket::SSL_WrapperPacket() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_WrapperPacket) } void SSL_WrapperPacket::InitAsDefaultInstance() { @@ -120,6 +121,7 @@ SSL_WrapperPacket::SSL_WrapperPacket(const SSL_WrapperPacket& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_WrapperPacket) } void SSL_WrapperPacket::SharedCtor() { @@ -130,6 +132,7 @@ void SSL_WrapperPacket::SharedCtor() { } SSL_WrapperPacket::~SSL_WrapperPacket() { + // @@protoc_insertion_point(destructor:SSL_WrapperPacket) SharedDtor(); } @@ -162,7 +165,7 @@ SSL_WrapperPacket* SSL_WrapperPacket::New() const { } void SSL_WrapperPacket::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { if (has_detection()) { if (detection_ != NULL) detection_->::SSL_DetectionFrame::Clear(); } @@ -176,18 +179,21 @@ void SSL_WrapperPacket::Clear() { bool SSL_WrapperPacket::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_WrapperPacket) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .SSL_DetectionFrame detection = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_detection())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_geometry; break; @@ -195,23 +201,23 @@ bool SSL_WrapperPacket::MergePartialFromCodedStream( // optional .SSL_GeometryData geometry = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_geometry: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_geometry())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -219,12 +225,18 @@ bool SSL_WrapperPacket::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_WrapperPacket) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_WrapperPacket) + return false; #undef DO_ } void SSL_WrapperPacket::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_WrapperPacket) // optional .SSL_DetectionFrame detection = 1; if (has_detection()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -241,10 +253,12 @@ void SSL_WrapperPacket::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_WrapperPacket) } ::google::protobuf::uint8* SSL_WrapperPacket::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_WrapperPacket) // optional .SSL_DetectionFrame detection = 1; if (has_detection()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -263,6 +277,7 @@ ::google::protobuf::uint8* SSL_WrapperPacket::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_WrapperPacket) return target; } diff --git a/src/proto/messages_robocup_ssl_wrapper.pb.h b/src/proto/messages_robocup_ssl_wrapper.pb.h index 7e9ffd9..3c8dd40 100644 --- a/src/proto/messages_robocup_ssl_wrapper.pb.h +++ b/src/proto/messages_robocup_ssl_wrapper.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class SSL_WrapperPacket : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -118,12 +117,10 @@ class SSL_WrapperPacket : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::SSL_DetectionFrame* detection_; ::SSL_GeometryData* geometry_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fwrapper_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fwrapper_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fwrapper_2eproto(); @@ -153,11 +150,13 @@ inline void SSL_WrapperPacket::clear_detection() { clear_has_detection(); } inline const ::SSL_DetectionFrame& SSL_WrapperPacket::detection() const { + // @@protoc_insertion_point(field_get:SSL_WrapperPacket.detection) return detection_ != NULL ? *detection_ : *default_instance_->detection_; } inline ::SSL_DetectionFrame* SSL_WrapperPacket::mutable_detection() { set_has_detection(); if (detection_ == NULL) detection_ = new ::SSL_DetectionFrame; + // @@protoc_insertion_point(field_mutable:SSL_WrapperPacket.detection) return detection_; } inline ::SSL_DetectionFrame* SSL_WrapperPacket::release_detection() { @@ -174,6 +173,7 @@ inline void SSL_WrapperPacket::set_allocated_detection(::SSL_DetectionFrame* det } else { clear_has_detection(); } + // @@protoc_insertion_point(field_set_allocated:SSL_WrapperPacket.detection) } // optional .SSL_GeometryData geometry = 2; @@ -191,11 +191,13 @@ inline void SSL_WrapperPacket::clear_geometry() { clear_has_geometry(); } inline const ::SSL_GeometryData& SSL_WrapperPacket::geometry() const { + // @@protoc_insertion_point(field_get:SSL_WrapperPacket.geometry) return geometry_ != NULL ? *geometry_ : *default_instance_->geometry_; } inline ::SSL_GeometryData* SSL_WrapperPacket::mutable_geometry() { set_has_geometry(); if (geometry_ == NULL) geometry_ = new ::SSL_GeometryData; + // @@protoc_insertion_point(field_mutable:SSL_WrapperPacket.geometry) return geometry_; } inline ::SSL_GeometryData* SSL_WrapperPacket::release_geometry() { @@ -212,6 +214,7 @@ inline void SSL_WrapperPacket::set_allocated_geometry(::SSL_GeometryData* geomet } else { clear_has_geometry(); } + // @@protoc_insertion_point(field_set_allocated:SSL_WrapperPacket.geometry) } diff --git a/src/proto/messages_robocup_ssl_wrapper_legacy.pb.cc b/src/proto/messages_robocup_ssl_wrapper_legacy.pb.cc index 5f93bf8..96af786 100644 --- a/src/proto/messages_robocup_ssl_wrapper_legacy.pb.cc +++ b/src/proto/messages_robocup_ssl_wrapper_legacy.pb.cc @@ -113,6 +113,7 @@ const int SSL_WrapperPacket::kGeometryFieldNumber; SSL_WrapperPacket::SSL_WrapperPacket() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) } void SSL_WrapperPacket::InitAsDefaultInstance() { @@ -124,6 +125,7 @@ SSL_WrapperPacket::SSL_WrapperPacket(const SSL_WrapperPacket& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) } void SSL_WrapperPacket::SharedCtor() { @@ -134,6 +136,7 @@ void SSL_WrapperPacket::SharedCtor() { } SSL_WrapperPacket::~SSL_WrapperPacket() { + // @@protoc_insertion_point(destructor:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) SharedDtor(); } @@ -166,7 +169,7 @@ SSL_WrapperPacket* SSL_WrapperPacket::New() const { } void SSL_WrapperPacket::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { if (has_detection()) { if (detection_ != NULL) detection_->::SSL_DetectionFrame::Clear(); } @@ -180,18 +183,21 @@ void SSL_WrapperPacket::Clear() { bool SSL_WrapperPacket::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .SSL_DetectionFrame detection = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_detection())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_geometry; break; @@ -199,23 +205,23 @@ bool SSL_WrapperPacket::MergePartialFromCodedStream( // optional .RoboCup2014Legacy.Geometry.SSL_GeometryData geometry = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_geometry: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_geometry())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -223,12 +229,18 @@ bool SSL_WrapperPacket::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) return true; +failure: + // @@protoc_insertion_point(parse_failure:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) + return false; #undef DO_ } void SSL_WrapperPacket::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) // optional .SSL_DetectionFrame detection = 1; if (has_detection()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( @@ -245,10 +257,12 @@ void SSL_WrapperPacket::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) } ::google::protobuf::uint8* SSL_WrapperPacket::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) // optional .SSL_DetectionFrame detection = 1; if (has_detection()) { target = ::google::protobuf::internal::WireFormatLite:: @@ -267,6 +281,7 @@ ::google::protobuf::uint8* SSL_WrapperPacket::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket) return target; } diff --git a/src/proto/messages_robocup_ssl_wrapper_legacy.pb.h b/src/proto/messages_robocup_ssl_wrapper_legacy.pb.h index 2e711ed..d6c7d67 100644 --- a/src/proto/messages_robocup_ssl_wrapper_legacy.pb.h +++ b/src/proto/messages_robocup_ssl_wrapper_legacy.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -87,7 +87,6 @@ class SSL_WrapperPacket : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -121,12 +120,10 @@ class SSL_WrapperPacket : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::SSL_DetectionFrame* detection_; ::RoboCup2014Legacy::Geometry::SSL_GeometryData* geometry_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_messages_5frobocup_5fssl_5fwrapper_5flegacy_2eproto(); friend void protobuf_AssignDesc_messages_5frobocup_5fssl_5fwrapper_5flegacy_2eproto(); friend void protobuf_ShutdownFile_messages_5frobocup_5fssl_5fwrapper_5flegacy_2eproto(); @@ -156,11 +153,13 @@ inline void SSL_WrapperPacket::clear_detection() { clear_has_detection(); } inline const ::SSL_DetectionFrame& SSL_WrapperPacket::detection() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.detection) return detection_ != NULL ? *detection_ : *default_instance_->detection_; } inline ::SSL_DetectionFrame* SSL_WrapperPacket::mutable_detection() { set_has_detection(); if (detection_ == NULL) detection_ = new ::SSL_DetectionFrame; + // @@protoc_insertion_point(field_mutable:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.detection) return detection_; } inline ::SSL_DetectionFrame* SSL_WrapperPacket::release_detection() { @@ -177,6 +176,7 @@ inline void SSL_WrapperPacket::set_allocated_detection(::SSL_DetectionFrame* det } else { clear_has_detection(); } + // @@protoc_insertion_point(field_set_allocated:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.detection) } // optional .RoboCup2014Legacy.Geometry.SSL_GeometryData geometry = 2; @@ -194,11 +194,13 @@ inline void SSL_WrapperPacket::clear_geometry() { clear_has_geometry(); } inline const ::RoboCup2014Legacy::Geometry::SSL_GeometryData& SSL_WrapperPacket::geometry() const { + // @@protoc_insertion_point(field_get:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.geometry) return geometry_ != NULL ? *geometry_ : *default_instance_->geometry_; } inline ::RoboCup2014Legacy::Geometry::SSL_GeometryData* SSL_WrapperPacket::mutable_geometry() { set_has_geometry(); if (geometry_ == NULL) geometry_ = new ::RoboCup2014Legacy::Geometry::SSL_GeometryData; + // @@protoc_insertion_point(field_mutable:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.geometry) return geometry_; } inline ::RoboCup2014Legacy::Geometry::SSL_GeometryData* SSL_WrapperPacket::release_geometry() { @@ -215,6 +217,7 @@ inline void SSL_WrapperPacket::set_allocated_geometry(::RoboCup2014Legacy::Geome } else { clear_has_geometry(); } + // @@protoc_insertion_point(field_set_allocated:RoboCup2014Legacy.Wrapper.SSL_WrapperPacket.geometry) } diff --git a/src/proto/position_message.pb.cc b/src/proto/position_message.pb.cc index 288b27d..517395a 100644 --- a/src/proto/position_message.pb.cc +++ b/src/proto/position_message.pb.cc @@ -105,6 +105,7 @@ const int position_message::kDirFieldNumber; position_message::position_message() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:position_message) } void position_message::InitAsDefaultInstance() { @@ -114,6 +115,7 @@ position_message::position_message(const position_message& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:position_message) } void position_message::SharedCtor() { @@ -125,6 +127,7 @@ void position_message::SharedCtor() { } position_message::~position_message() { + // @@protoc_insertion_point(destructor:position_message) SharedDtor(); } @@ -155,31 +158,44 @@ position_message* position_message::New() const { } void position_message::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - x_ = 0; - y_ = 0; - dir_ = 0; - } +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(x_, dir_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool position_message::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:position_message) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required float x = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 13) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &x_))); set_has_x(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(21)) goto parse_y; break; @@ -187,15 +203,14 @@ bool position_message::MergePartialFromCodedStream( // required float y = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 21) { parse_y: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &y_))); set_has_y(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(29)) goto parse_dir; break; @@ -203,25 +218,25 @@ bool position_message::MergePartialFromCodedStream( // required float dir = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) { + if (tag == 29) { parse_dir: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &dir_))); set_has_dir(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -229,12 +244,18 @@ bool position_message::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:position_message) return true; +failure: + // @@protoc_insertion_point(parse_failure:position_message) + return false; #undef DO_ } void position_message::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:position_message) // required float x = 1; if (has_x()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->x(), output); @@ -254,10 +275,12 @@ void position_message::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:position_message) } ::google::protobuf::uint8* position_message::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:position_message) // required float x = 1; if (has_x()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->x(), target); @@ -277,6 +300,7 @@ ::google::protobuf::uint8* position_message::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:position_message) return target; } diff --git a/src/proto/position_message.pb.h b/src/proto/position_message.pb.h index 200f362..9563f6a 100644 --- a/src/proto/position_message.pb.h +++ b/src/proto/position_message.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -82,7 +82,6 @@ class position_message : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -121,13 +120,11 @@ class position_message : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; float x_; float y_; float dir_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_position_5fmessage_2eproto(); friend void protobuf_AssignDesc_position_5fmessage_2eproto(); friend void protobuf_ShutdownFile_position_5fmessage_2eproto(); @@ -157,11 +154,13 @@ inline void position_message::clear_x() { clear_has_x(); } inline float position_message::x() const { + // @@protoc_insertion_point(field_get:position_message.x) return x_; } inline void position_message::set_x(float value) { set_has_x(); x_ = value; + // @@protoc_insertion_point(field_set:position_message.x) } // required float y = 2; @@ -179,11 +178,13 @@ inline void position_message::clear_y() { clear_has_y(); } inline float position_message::y() const { + // @@protoc_insertion_point(field_get:position_message.y) return y_; } inline void position_message::set_y(float value) { set_has_y(); y_ = value; + // @@protoc_insertion_point(field_set:position_message.y) } // required float dir = 3; @@ -201,11 +202,13 @@ inline void position_message::clear_dir() { clear_has_dir(); } inline float position_message::dir() const { + // @@protoc_insertion_point(field_get:position_message.dir) return dir_; } inline void position_message::set_dir(float value) { set_has_dir(); dir_ = value; + // @@protoc_insertion_point(field_set:position_message.dir) } diff --git a/src/proto/ref_log.pb.cc b/src/proto/ref_log.pb.cc index e4f5586..6048786 100644 --- a/src/proto/ref_log.pb.cc +++ b/src/proto/ref_log.pb.cc @@ -134,6 +134,7 @@ const int Ref_chunk::kPacketFieldNumber; Ref_chunk::Ref_chunk() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Ref_chunk) } void Ref_chunk::InitAsDefaultInstance() { @@ -144,6 +145,7 @@ Ref_chunk::Ref_chunk(const Ref_chunk& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Ref_chunk) } void Ref_chunk::SharedCtor() { @@ -155,6 +157,7 @@ void Ref_chunk::SharedCtor() { } Ref_chunk::~Ref_chunk() { + // @@protoc_insertion_point(destructor:Ref_chunk) SharedDtor(); } @@ -186,33 +189,49 @@ Ref_chunk* Ref_chunk::New() const { } void Ref_chunk::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - time_elapsed_ = GOOGLE_LONGLONG(0); - id_ = GOOGLE_LONGLONG(0); +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(time_elapsed_, id_); if (has_packet()) { if (packet_ != NULL) packet_->::SSL_Referee::Clear(); } } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool Ref_chunk::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Ref_chunk) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int64 time_elapsed = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &time_elapsed_))); set_has_time_elapsed(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_id; break; @@ -220,15 +239,14 @@ bool Ref_chunk::MergePartialFromCodedStream( // optional int64 id = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &id_))); set_has_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_packet; break; @@ -236,23 +254,23 @@ bool Ref_chunk::MergePartialFromCodedStream( // required .SSL_Referee packet = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_packet: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_packet())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -260,12 +278,18 @@ bool Ref_chunk::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Ref_chunk) return true; +failure: + // @@protoc_insertion_point(parse_failure:Ref_chunk) + return false; #undef DO_ } void Ref_chunk::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Ref_chunk) // required int64 time_elapsed = 1; if (has_time_elapsed()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->time_elapsed(), output); @@ -286,10 +310,12 @@ void Ref_chunk::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Ref_chunk) } ::google::protobuf::uint8* Ref_chunk::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Ref_chunk) // required int64 time_elapsed = 1; if (has_time_elapsed()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->time_elapsed(), target); @@ -311,6 +337,7 @@ ::google::protobuf::uint8* Ref_chunk::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Ref_chunk) return target; } @@ -430,6 +457,7 @@ const int Ref_log::kChunksFieldNumber; Ref_log::Ref_log() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Ref_log) } void Ref_log::InitAsDefaultInstance() { @@ -439,6 +467,7 @@ Ref_log::Ref_log(const Ref_log& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Ref_log) } void Ref_log::SharedCtor() { @@ -448,6 +477,7 @@ void Ref_log::SharedCtor() { } Ref_log::~Ref_log() { + // @@protoc_insertion_point(destructor:Ref_log) SharedDtor(); } @@ -478,9 +508,7 @@ Ref_log* Ref_log::New() const { } void Ref_log::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - number_ = GOOGLE_LONGLONG(0); - } + number_ = GOOGLE_LONGLONG(0); chunks_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -488,20 +516,23 @@ void Ref_log::Clear() { bool Ref_log::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Ref_log) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int64 number = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &number_))); set_has_number(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_chunks; break; @@ -509,24 +540,24 @@ bool Ref_log::MergePartialFromCodedStream( // repeated .Ref_chunk chunks = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_chunks: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_chunks())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_chunks; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -534,12 +565,18 @@ bool Ref_log::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Ref_log) return true; +failure: + // @@protoc_insertion_point(parse_failure:Ref_log) + return false; #undef DO_ } void Ref_log::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Ref_log) // optional int64 number = 1; if (has_number()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->number(), output); @@ -555,10 +592,12 @@ void Ref_log::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Ref_log) } ::google::protobuf::uint8* Ref_log::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Ref_log) // optional int64 number = 1; if (has_number()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->number(), target); @@ -575,6 +614,7 @@ ::google::protobuf::uint8* Ref_log::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Ref_log) return target; } @@ -646,9 +686,7 @@ void Ref_log::CopyFrom(const Ref_log& from) { bool Ref_log::IsInitialized() const { - for (int i = 0; i < chunks_size(); i++) { - if (!this->chunks(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->chunks())) return false; return true; } diff --git a/src/proto/ref_log.pb.h b/src/proto/ref_log.pb.h index 8fa76ad..ccd27bd 100644 --- a/src/proto/ref_log.pb.h +++ b/src/proto/ref_log.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -84,7 +84,6 @@ class Ref_chunk : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -125,13 +124,11 @@ class Ref_chunk : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 time_elapsed_; ::google::protobuf::int64 id_; ::SSL_Referee* packet_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_ref_5flog_2eproto(); friend void protobuf_AssignDesc_ref_5flog_2eproto(); friend void protobuf_ShutdownFile_ref_5flog_2eproto(); @@ -188,7 +185,6 @@ class Ref_log : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -221,12 +217,10 @@ class Ref_log : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 number_; ::google::protobuf::RepeatedPtrField< ::Ref_chunk > chunks_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_ref_5flog_2eproto(); friend void protobuf_AssignDesc_ref_5flog_2eproto(); friend void protobuf_ShutdownFile_ref_5flog_2eproto(); @@ -256,11 +250,13 @@ inline void Ref_chunk::clear_time_elapsed() { clear_has_time_elapsed(); } inline ::google::protobuf::int64 Ref_chunk::time_elapsed() const { + // @@protoc_insertion_point(field_get:Ref_chunk.time_elapsed) return time_elapsed_; } inline void Ref_chunk::set_time_elapsed(::google::protobuf::int64 value) { set_has_time_elapsed(); time_elapsed_ = value; + // @@protoc_insertion_point(field_set:Ref_chunk.time_elapsed) } // optional int64 id = 2; @@ -278,11 +274,13 @@ inline void Ref_chunk::clear_id() { clear_has_id(); } inline ::google::protobuf::int64 Ref_chunk::id() const { + // @@protoc_insertion_point(field_get:Ref_chunk.id) return id_; } inline void Ref_chunk::set_id(::google::protobuf::int64 value) { set_has_id(); id_ = value; + // @@protoc_insertion_point(field_set:Ref_chunk.id) } // required .SSL_Referee packet = 3; @@ -300,11 +298,13 @@ inline void Ref_chunk::clear_packet() { clear_has_packet(); } inline const ::SSL_Referee& Ref_chunk::packet() const { + // @@protoc_insertion_point(field_get:Ref_chunk.packet) return packet_ != NULL ? *packet_ : *default_instance_->packet_; } inline ::SSL_Referee* Ref_chunk::mutable_packet() { set_has_packet(); if (packet_ == NULL) packet_ = new ::SSL_Referee; + // @@protoc_insertion_point(field_mutable:Ref_chunk.packet) return packet_; } inline ::SSL_Referee* Ref_chunk::release_packet() { @@ -321,6 +321,7 @@ inline void Ref_chunk::set_allocated_packet(::SSL_Referee* packet) { } else { clear_has_packet(); } + // @@protoc_insertion_point(field_set_allocated:Ref_chunk.packet) } // ------------------------------------------------------------------- @@ -342,11 +343,13 @@ inline void Ref_log::clear_number() { clear_has_number(); } inline ::google::protobuf::int64 Ref_log::number() const { + // @@protoc_insertion_point(field_get:Ref_log.number) return number_; } inline void Ref_log::set_number(::google::protobuf::int64 value) { set_has_number(); number_ = value; + // @@protoc_insertion_point(field_set:Ref_log.number) } // repeated .Ref_chunk chunks = 2; @@ -357,20 +360,25 @@ inline void Ref_log::clear_chunks() { chunks_.Clear(); } inline const ::Ref_chunk& Ref_log::chunks(int index) const { + // @@protoc_insertion_point(field_get:Ref_log.chunks) return chunks_.Get(index); } inline ::Ref_chunk* Ref_log::mutable_chunks(int index) { + // @@protoc_insertion_point(field_mutable:Ref_log.chunks) return chunks_.Mutable(index); } inline ::Ref_chunk* Ref_log::add_chunks() { + // @@protoc_insertion_point(field_add:Ref_log.chunks) return chunks_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::Ref_chunk >& Ref_log::chunks() const { + // @@protoc_insertion_point(field_list:Ref_log.chunks) return chunks_; } inline ::google::protobuf::RepeatedPtrField< ::Ref_chunk >* Ref_log::mutable_chunks() { + // @@protoc_insertion_point(field_mutable_list:Ref_log.chunks) return &chunks_; } diff --git a/src/proto/referee.pb.cc b/src/proto/referee.pb.cc index b640090..cea9ee9 100644 --- a/src/proto/referee.pb.cc +++ b/src/proto/referee.pb.cc @@ -271,6 +271,7 @@ const int SSL_Referee_TeamInfo::kGoalieFieldNumber; SSL_Referee_TeamInfo::SSL_Referee_TeamInfo() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_Referee.TeamInfo) } void SSL_Referee_TeamInfo::InitAsDefaultInstance() { @@ -280,11 +281,13 @@ SSL_Referee_TeamInfo::SSL_Referee_TeamInfo(const SSL_Referee_TeamInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_Referee.TeamInfo) } void SSL_Referee_TeamInfo::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); score_ = 0u; red_cards_ = 0u; yellow_cards_ = 0u; @@ -295,11 +298,12 @@ void SSL_Referee_TeamInfo::SharedCtor() { } SSL_Referee_TeamInfo::~SSL_Referee_TeamInfo() { + // @@protoc_insertion_point(destructor:SSL_Referee.TeamInfo) SharedDtor(); } void SSL_Referee_TeamInfo::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (this != default_instance_) { @@ -328,19 +332,29 @@ SSL_Referee_TeamInfo* SSL_Referee_TeamInfo::New() const { } void SSL_Referee_TeamInfo::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 247) { + ZR_(score_, red_cards_); + ZR_(yellow_cards_, goalie_); if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } } - score_ = 0u; - red_cards_ = 0u; - yellow_cards_ = 0u; - timeouts_ = 0u; - timeout_time_ = 0u; - goalie_ = 0u; } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + yellow_card_times_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -348,21 +362,25 @@ void SSL_Referee_TeamInfo::Clear() { bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_Referee.TeamInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::PARSE); + ::google::protobuf::internal::WireFormat::PARSE, + "name"); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_score; break; @@ -370,15 +388,14 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 score = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_score: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &score_))); set_has_score(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(24)) goto parse_red_cards; break; @@ -386,15 +403,14 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 red_cards = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 24) { parse_red_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &red_cards_))); set_has_red_cards(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(34)) goto parse_yellow_card_times; break; @@ -402,20 +418,17 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // repeated uint32 yellow_card_times = 4 [packed = true]; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 34) { parse_yellow_card_times: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_yellow_card_times()))); - } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) - == ::google::protobuf::internal::WireFormatLite:: - WIRETYPE_VARINT) { + } else if (tag == 32) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 34, input, this->mutable_yellow_card_times()))); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_yellow_cards; break; @@ -423,15 +436,14 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 yellow_cards = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_yellow_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &yellow_cards_))); set_has_yellow_cards(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(48)) goto parse_timeouts; break; @@ -439,15 +451,14 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 timeouts = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 48) { parse_timeouts: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &timeouts_))); set_has_timeouts(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(56)) goto parse_timeout_time; break; @@ -455,15 +466,14 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 timeout_time = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 56) { parse_timeout_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &timeout_time_))); set_has_timeout_time(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(64)) goto parse_goalie; break; @@ -471,25 +481,25 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( // required uint32 goalie = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 64) { parse_goalie: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &goalie_))); set_has_goalie(); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -497,18 +507,25 @@ bool SSL_Referee_TeamInfo::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_Referee.TeamInfo) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_Referee.TeamInfo) + return false; #undef DO_ } void SSL_Referee_TeamInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_Referee.TeamInfo) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } @@ -556,15 +573,18 @@ void SSL_Referee_TeamInfo::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_Referee.TeamInfo) } ::google::protobuf::uint8* SSL_Referee_TeamInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_Referee.TeamInfo) // required string name = 1; if (has_name()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); @@ -618,6 +638,7 @@ ::google::protobuf::uint8* SSL_Referee_TeamInfo::SerializeWithCachedSizesToArray target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_Referee.TeamInfo) return target; } @@ -803,6 +824,7 @@ const int SSL_Referee::kBlueFieldNumber; SSL_Referee::SSL_Referee() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_Referee) } void SSL_Referee::InitAsDefaultInstance() { @@ -814,6 +836,7 @@ SSL_Referee::SSL_Referee(const SSL_Referee& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_Referee) } void SSL_Referee::SharedCtor() { @@ -830,6 +853,7 @@ void SSL_Referee::SharedCtor() { } SSL_Referee::~SSL_Referee() { + // @@protoc_insertion_point(destructor:SSL_Referee) SharedDtor(); } @@ -862,13 +886,18 @@ SSL_Referee* SSL_Referee::New() const { } void SSL_Referee::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - packet_timestamp_ = GOOGLE_ULONGLONG(0); - stage_ = 0; - stage_time_left_ = 0; - command_ = 0; - command_counter_ = 0u; - command_timestamp_ = GOOGLE_ULONGLONG(0); +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(packet_timestamp_, command_timestamp_); if (has_yellow()) { if (yellow_ != NULL) yellow_->::SSL_Referee_TeamInfo::Clear(); } @@ -876,26 +905,33 @@ void SSL_Referee::Clear() { if (blue_ != NULL) blue_->::SSL_Referee_TeamInfo::Clear(); } } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SSL_Referee::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_Referee) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint64 packet_timestamp = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &packet_timestamp_))); set_has_packet_timestamp(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_stage; break; @@ -903,8 +939,7 @@ bool SSL_Referee::MergePartialFromCodedStream( // required .SSL_Referee.Stage stage = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_stage: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< @@ -916,7 +951,7 @@ bool SSL_Referee::MergePartialFromCodedStream( mutable_unknown_fields()->AddVarint(2, value); } } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(24)) goto parse_stage_time_left; break; @@ -924,15 +959,14 @@ bool SSL_Referee::MergePartialFromCodedStream( // optional sint32 stage_time_left = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 24) { parse_stage_time_left: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>( input, &stage_time_left_))); set_has_stage_time_left(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(32)) goto parse_command; break; @@ -940,8 +974,7 @@ bool SSL_Referee::MergePartialFromCodedStream( // required .SSL_Referee.Command command = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 32) { parse_command: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< @@ -953,7 +986,7 @@ bool SSL_Referee::MergePartialFromCodedStream( mutable_unknown_fields()->AddVarint(4, value); } } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(40)) goto parse_command_counter; break; @@ -961,15 +994,14 @@ bool SSL_Referee::MergePartialFromCodedStream( // required uint32 command_counter = 5; case 5: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 40) { parse_command_counter: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &command_counter_))); set_has_command_counter(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(48)) goto parse_command_timestamp; break; @@ -977,15 +1009,14 @@ bool SSL_Referee::MergePartialFromCodedStream( // required uint64 command_timestamp = 6; case 6: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 48) { parse_command_timestamp: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &command_timestamp_))); set_has_command_timestamp(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(58)) goto parse_yellow; break; @@ -993,13 +1024,12 @@ bool SSL_Referee::MergePartialFromCodedStream( // required .SSL_Referee.TeamInfo yellow = 7; case 7: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 58) { parse_yellow: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_yellow())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(66)) goto parse_blue; break; @@ -1007,23 +1037,23 @@ bool SSL_Referee::MergePartialFromCodedStream( // required .SSL_Referee.TeamInfo blue = 8; case 8: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 66) { parse_blue: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_blue())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -1031,12 +1061,18 @@ bool SSL_Referee::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_Referee) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_Referee) + return false; #undef DO_ } void SSL_Referee::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_Referee) // required uint64 packet_timestamp = 1; if (has_packet_timestamp()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->packet_timestamp(), output); @@ -1085,10 +1121,12 @@ void SSL_Referee::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_Referee) } ::google::protobuf::uint8* SSL_Referee::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_Referee) // required uint64 packet_timestamp = 1; if (has_packet_timestamp()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->packet_timestamp(), target); @@ -1139,6 +1177,7 @@ ::google::protobuf::uint8* SSL_Referee::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_Referee) return target; } diff --git a/src/proto/referee.pb.h b/src/proto/referee.pb.h index ce61106..dfc9f24 100644 --- a/src/proto/referee.pb.h +++ b/src/proto/referee.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -148,7 +148,6 @@ class SSL_Referee_TeamInfo : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -240,6 +239,8 @@ class SSL_Referee_TeamInfo : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::std::string* name_; ::google::protobuf::uint32 score_; ::google::protobuf::uint32 red_cards_; @@ -249,10 +250,6 @@ class SSL_Referee_TeamInfo : public ::google::protobuf::Message { ::google::protobuf::uint32 timeouts_; ::google::protobuf::uint32 timeout_time_; ::google::protobuf::uint32 goalie_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; - friend void protobuf_AddDesc_referee_2eproto(); friend void protobuf_AssignDesc_referee_2eproto(); friend void protobuf_ShutdownFile_referee_2eproto(); @@ -309,7 +306,6 @@ class SSL_Referee : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -473,6 +469,8 @@ class SSL_Referee : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::uint64 packet_timestamp_; int stage_; ::google::protobuf::int32 stage_time_left_; @@ -481,10 +479,6 @@ class SSL_Referee : public ::google::protobuf::Message { ::google::protobuf::uint64 command_timestamp_; ::SSL_Referee_TeamInfo* yellow_; ::SSL_Referee_TeamInfo* blue_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; - friend void protobuf_AddDesc_referee_2eproto(); friend void protobuf_AssignDesc_referee_2eproto(); friend void protobuf_ShutdownFile_referee_2eproto(); @@ -510,54 +504,59 @@ inline void SSL_Referee_TeamInfo::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void SSL_Referee_TeamInfo::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } clear_has_name(); } inline const ::std::string& SSL_Referee_TeamInfo::name() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.name) return *name_; } inline void SSL_Referee_TeamInfo::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.name) } inline void SSL_Referee_TeamInfo::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(value); + // @@protoc_insertion_point(field_set_char:SSL_Referee.TeamInfo.name) } inline void SSL_Referee_TeamInfo::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SSL_Referee.TeamInfo.name) } inline ::std::string* SSL_Referee_TeamInfo::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_ = new ::std::string; } + // @@protoc_insertion_point(field_mutable:SSL_Referee.TeamInfo.name) return name_; } inline ::std::string* SSL_Referee_TeamInfo::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); return temp; } } inline void SSL_Referee_TeamInfo::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (name) { @@ -565,8 +564,9 @@ inline void SSL_Referee_TeamInfo::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } + // @@protoc_insertion_point(field_set_allocated:SSL_Referee.TeamInfo.name) } // required uint32 score = 2; @@ -584,11 +584,13 @@ inline void SSL_Referee_TeamInfo::clear_score() { clear_has_score(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::score() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.score) return score_; } inline void SSL_Referee_TeamInfo::set_score(::google::protobuf::uint32 value) { set_has_score(); score_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.score) } // required uint32 red_cards = 3; @@ -606,11 +608,13 @@ inline void SSL_Referee_TeamInfo::clear_red_cards() { clear_has_red_cards(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::red_cards() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.red_cards) return red_cards_; } inline void SSL_Referee_TeamInfo::set_red_cards(::google::protobuf::uint32 value) { set_has_red_cards(); red_cards_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.red_cards) } // repeated uint32 yellow_card_times = 4 [packed = true]; @@ -621,20 +625,25 @@ inline void SSL_Referee_TeamInfo::clear_yellow_card_times() { yellow_card_times_.Clear(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::yellow_card_times(int index) const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.yellow_card_times) return yellow_card_times_.Get(index); } inline void SSL_Referee_TeamInfo::set_yellow_card_times(int index, ::google::protobuf::uint32 value) { yellow_card_times_.Set(index, value); + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.yellow_card_times) } inline void SSL_Referee_TeamInfo::add_yellow_card_times(::google::protobuf::uint32 value) { yellow_card_times_.Add(value); + // @@protoc_insertion_point(field_add:SSL_Referee.TeamInfo.yellow_card_times) } inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& SSL_Referee_TeamInfo::yellow_card_times() const { + // @@protoc_insertion_point(field_list:SSL_Referee.TeamInfo.yellow_card_times) return yellow_card_times_; } inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* SSL_Referee_TeamInfo::mutable_yellow_card_times() { + // @@protoc_insertion_point(field_mutable_list:SSL_Referee.TeamInfo.yellow_card_times) return &yellow_card_times_; } @@ -653,11 +662,13 @@ inline void SSL_Referee_TeamInfo::clear_yellow_cards() { clear_has_yellow_cards(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::yellow_cards() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.yellow_cards) return yellow_cards_; } inline void SSL_Referee_TeamInfo::set_yellow_cards(::google::protobuf::uint32 value) { set_has_yellow_cards(); yellow_cards_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.yellow_cards) } // required uint32 timeouts = 6; @@ -675,11 +686,13 @@ inline void SSL_Referee_TeamInfo::clear_timeouts() { clear_has_timeouts(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::timeouts() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.timeouts) return timeouts_; } inline void SSL_Referee_TeamInfo::set_timeouts(::google::protobuf::uint32 value) { set_has_timeouts(); timeouts_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.timeouts) } // required uint32 timeout_time = 7; @@ -697,11 +710,13 @@ inline void SSL_Referee_TeamInfo::clear_timeout_time() { clear_has_timeout_time(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::timeout_time() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.timeout_time) return timeout_time_; } inline void SSL_Referee_TeamInfo::set_timeout_time(::google::protobuf::uint32 value) { set_has_timeout_time(); timeout_time_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.timeout_time) } // required uint32 goalie = 8; @@ -719,11 +734,13 @@ inline void SSL_Referee_TeamInfo::clear_goalie() { clear_has_goalie(); } inline ::google::protobuf::uint32 SSL_Referee_TeamInfo::goalie() const { + // @@protoc_insertion_point(field_get:SSL_Referee.TeamInfo.goalie) return goalie_; } inline void SSL_Referee_TeamInfo::set_goalie(::google::protobuf::uint32 value) { set_has_goalie(); goalie_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.TeamInfo.goalie) } // ------------------------------------------------------------------- @@ -745,11 +762,13 @@ inline void SSL_Referee::clear_packet_timestamp() { clear_has_packet_timestamp(); } inline ::google::protobuf::uint64 SSL_Referee::packet_timestamp() const { + // @@protoc_insertion_point(field_get:SSL_Referee.packet_timestamp) return packet_timestamp_; } inline void SSL_Referee::set_packet_timestamp(::google::protobuf::uint64 value) { set_has_packet_timestamp(); packet_timestamp_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.packet_timestamp) } // required .SSL_Referee.Stage stage = 2; @@ -767,12 +786,14 @@ inline void SSL_Referee::clear_stage() { clear_has_stage(); } inline ::SSL_Referee_Stage SSL_Referee::stage() const { + // @@protoc_insertion_point(field_get:SSL_Referee.stage) return static_cast< ::SSL_Referee_Stage >(stage_); } inline void SSL_Referee::set_stage(::SSL_Referee_Stage value) { assert(::SSL_Referee_Stage_IsValid(value)); set_has_stage(); stage_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.stage) } // optional sint32 stage_time_left = 3; @@ -790,11 +811,13 @@ inline void SSL_Referee::clear_stage_time_left() { clear_has_stage_time_left(); } inline ::google::protobuf::int32 SSL_Referee::stage_time_left() const { + // @@protoc_insertion_point(field_get:SSL_Referee.stage_time_left) return stage_time_left_; } inline void SSL_Referee::set_stage_time_left(::google::protobuf::int32 value) { set_has_stage_time_left(); stage_time_left_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.stage_time_left) } // required .SSL_Referee.Command command = 4; @@ -812,12 +835,14 @@ inline void SSL_Referee::clear_command() { clear_has_command(); } inline ::SSL_Referee_Command SSL_Referee::command() const { + // @@protoc_insertion_point(field_get:SSL_Referee.command) return static_cast< ::SSL_Referee_Command >(command_); } inline void SSL_Referee::set_command(::SSL_Referee_Command value) { assert(::SSL_Referee_Command_IsValid(value)); set_has_command(); command_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.command) } // required uint32 command_counter = 5; @@ -835,11 +860,13 @@ inline void SSL_Referee::clear_command_counter() { clear_has_command_counter(); } inline ::google::protobuf::uint32 SSL_Referee::command_counter() const { + // @@protoc_insertion_point(field_get:SSL_Referee.command_counter) return command_counter_; } inline void SSL_Referee::set_command_counter(::google::protobuf::uint32 value) { set_has_command_counter(); command_counter_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.command_counter) } // required uint64 command_timestamp = 6; @@ -857,11 +884,13 @@ inline void SSL_Referee::clear_command_timestamp() { clear_has_command_timestamp(); } inline ::google::protobuf::uint64 SSL_Referee::command_timestamp() const { + // @@protoc_insertion_point(field_get:SSL_Referee.command_timestamp) return command_timestamp_; } inline void SSL_Referee::set_command_timestamp(::google::protobuf::uint64 value) { set_has_command_timestamp(); command_timestamp_ = value; + // @@protoc_insertion_point(field_set:SSL_Referee.command_timestamp) } // required .SSL_Referee.TeamInfo yellow = 7; @@ -879,11 +908,13 @@ inline void SSL_Referee::clear_yellow() { clear_has_yellow(); } inline const ::SSL_Referee_TeamInfo& SSL_Referee::yellow() const { + // @@protoc_insertion_point(field_get:SSL_Referee.yellow) return yellow_ != NULL ? *yellow_ : *default_instance_->yellow_; } inline ::SSL_Referee_TeamInfo* SSL_Referee::mutable_yellow() { set_has_yellow(); if (yellow_ == NULL) yellow_ = new ::SSL_Referee_TeamInfo; + // @@protoc_insertion_point(field_mutable:SSL_Referee.yellow) return yellow_; } inline ::SSL_Referee_TeamInfo* SSL_Referee::release_yellow() { @@ -900,6 +931,7 @@ inline void SSL_Referee::set_allocated_yellow(::SSL_Referee_TeamInfo* yellow) { } else { clear_has_yellow(); } + // @@protoc_insertion_point(field_set_allocated:SSL_Referee.yellow) } // required .SSL_Referee.TeamInfo blue = 8; @@ -917,11 +949,13 @@ inline void SSL_Referee::clear_blue() { clear_has_blue(); } inline const ::SSL_Referee_TeamInfo& SSL_Referee::blue() const { + // @@protoc_insertion_point(field_get:SSL_Referee.blue) return blue_ != NULL ? *blue_ : *default_instance_->blue_; } inline ::SSL_Referee_TeamInfo* SSL_Referee::mutable_blue() { set_has_blue(); if (blue_ == NULL) blue_ = new ::SSL_Referee_TeamInfo; + // @@protoc_insertion_point(field_mutable:SSL_Referee.blue) return blue_; } inline ::SSL_Referee_TeamInfo* SSL_Referee::release_blue() { @@ -938,6 +972,7 @@ inline void SSL_Referee::set_allocated_blue(::SSL_Referee_TeamInfo* blue) { } else { clear_has_blue(); } + // @@protoc_insertion_point(field_set_allocated:SSL_Referee.blue) } @@ -947,10 +982,12 @@ inline void SSL_Referee::set_allocated_blue(::SSL_Referee_TeamInfo* blue) { namespace google { namespace protobuf { +template <> struct is_proto_enum< ::SSL_Referee_Stage> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::SSL_Referee_Stage>() { return ::SSL_Referee_Stage_descriptor(); } +template <> struct is_proto_enum< ::SSL_Referee_Command> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::SSL_Referee_Command>() { return ::SSL_Referee_Command_descriptor(); diff --git a/src/proto/ssl_log.pb.cc b/src/proto/ssl_log.pb.cc index b8230c0..5c2fdce 100644 --- a/src/proto/ssl_log.pb.cc +++ b/src/proto/ssl_log.pb.cc @@ -140,6 +140,7 @@ const int log_chunk::kOppsFieldNumber; log_chunk::log_chunk() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:log_chunk) } void log_chunk::InitAsDefaultInstance() { @@ -150,6 +151,7 @@ log_chunk::log_chunk(const log_chunk& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:log_chunk) } void log_chunk::SharedCtor() { @@ -160,6 +162,7 @@ void log_chunk::SharedCtor() { } log_chunk::~log_chunk() { + // @@protoc_insertion_point(destructor:log_chunk) SharedDtor(); } @@ -191,7 +194,7 @@ log_chunk* log_chunk::New() const { } void log_chunk::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bits_[0 / 32] & 3) { chunk_number_ = GOOGLE_LONGLONG(0); if (has_ball()) { if (ball_ != NULL) ball_->::Ball_message::Clear(); @@ -205,20 +208,23 @@ void log_chunk::Clear() { bool log_chunk::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:log_chunk) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int64 chunk_number = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &chunk_number_))); set_has_chunk_number(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_ball; break; @@ -226,13 +232,12 @@ bool log_chunk::MergePartialFromCodedStream( // required .Ball_message ball = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_ball: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_ball())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_ours; break; @@ -240,13 +245,12 @@ bool log_chunk::MergePartialFromCodedStream( // repeated .Robot_message ours = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_ours: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_ours())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_ours; if (input->ExpectTag(34)) goto parse_opps; @@ -255,24 +259,24 @@ bool log_chunk::MergePartialFromCodedStream( // repeated .Robot_message opps = 4; case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 34) { parse_opps: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_opps())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(34)) goto parse_opps; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -280,12 +284,18 @@ bool log_chunk::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:log_chunk) return true; +failure: + // @@protoc_insertion_point(parse_failure:log_chunk) + return false; #undef DO_ } void log_chunk::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:log_chunk) // required int64 chunk_number = 1; if (has_chunk_number()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->chunk_number(), output); @@ -313,10 +323,12 @@ void log_chunk::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:log_chunk) } ::google::protobuf::uint8* log_chunk::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:log_chunk) // required int64 chunk_number = 1; if (has_chunk_number()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->chunk_number(), target); @@ -347,6 +359,7 @@ ::google::protobuf::uint8* log_chunk::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:log_chunk) return target; } @@ -441,12 +454,8 @@ bool log_chunk::IsInitialized() const { if (has_ball()) { if (!this->ball().IsInitialized()) return false; } - for (int i = 0; i < ours_size(); i++) { - if (!this->ours(i).IsInitialized()) return false; - } - for (int i = 0; i < opps_size(); i++) { - if (!this->opps(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->ours())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->opps())) return false; return true; } @@ -482,6 +491,7 @@ const int SSL_log::kChunksFieldNumber; SSL_log::SSL_log() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:SSL_log) } void SSL_log::InitAsDefaultInstance() { @@ -491,6 +501,7 @@ SSL_log::SSL_log(const SSL_log& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:SSL_log) } void SSL_log::SharedCtor() { @@ -501,6 +512,7 @@ void SSL_log::SharedCtor() { } SSL_log::~SSL_log() { + // @@protoc_insertion_point(destructor:SSL_log) SharedDtor(); } @@ -531,10 +543,21 @@ SSL_log* SSL_log::New() const { } void SSL_log::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - numberofchunks_ = GOOGLE_LONGLONG(0); - timerinterval_ = GOOGLE_LONGLONG(0); - } +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(numberofchunks_, timerinterval_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + chunks_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -542,20 +565,23 @@ void SSL_log::Clear() { bool SSL_log::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:SSL_log) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int64 numberOfChunks = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &numberofchunks_))); set_has_numberofchunks(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_timerInterval; break; @@ -563,15 +589,14 @@ bool SSL_log::MergePartialFromCodedStream( // required int64 timerInterval = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_timerInterval: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &timerinterval_))); set_has_timerinterval(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_chunks; break; @@ -579,24 +604,24 @@ bool SSL_log::MergePartialFromCodedStream( // repeated .log_chunk chunks = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_chunks: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_chunks())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_chunks; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -604,12 +629,18 @@ bool SSL_log::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:SSL_log) return true; +failure: + // @@protoc_insertion_point(parse_failure:SSL_log) + return false; #undef DO_ } void SSL_log::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:SSL_log) // required int64 numberOfChunks = 1; if (has_numberofchunks()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->numberofchunks(), output); @@ -630,10 +661,12 @@ void SSL_log::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:SSL_log) } ::google::protobuf::uint8* SSL_log::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:SSL_log) // required int64 numberOfChunks = 1; if (has_numberofchunks()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->numberofchunks(), target); @@ -655,6 +688,7 @@ ::google::protobuf::uint8* SSL_log::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:SSL_log) return target; } @@ -737,9 +771,7 @@ void SSL_log::CopyFrom(const SSL_log& from) { bool SSL_log::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; - for (int i = 0; i < chunks_size(); i++) { - if (!this->chunks(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->chunks())) return false; return true; } diff --git a/src/proto/ssl_log.pb.h b/src/proto/ssl_log.pb.h index c3b7eda..026b455 100644 --- a/src/proto/ssl_log.pb.h +++ b/src/proto/ssl_log.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -85,7 +85,6 @@ class log_chunk : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -141,14 +140,12 @@ class log_chunk : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 chunk_number_; ::Ball_message* ball_; ::google::protobuf::RepeatedPtrField< ::Robot_message > ours_; ::google::protobuf::RepeatedPtrField< ::Robot_message > opps_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; - friend void protobuf_AddDesc_ssl_5flog_2eproto(); friend void protobuf_AssignDesc_ssl_5flog_2eproto(); friend void protobuf_ShutdownFile_ssl_5flog_2eproto(); @@ -205,7 +202,6 @@ class SSL_log : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -247,13 +243,11 @@ class SSL_log : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 numberofchunks_; ::google::protobuf::int64 timerinterval_; ::google::protobuf::RepeatedPtrField< ::log_chunk > chunks_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_ssl_5flog_2eproto(); friend void protobuf_AssignDesc_ssl_5flog_2eproto(); friend void protobuf_ShutdownFile_ssl_5flog_2eproto(); @@ -283,11 +277,13 @@ inline void log_chunk::clear_chunk_number() { clear_has_chunk_number(); } inline ::google::protobuf::int64 log_chunk::chunk_number() const { + // @@protoc_insertion_point(field_get:log_chunk.chunk_number) return chunk_number_; } inline void log_chunk::set_chunk_number(::google::protobuf::int64 value) { set_has_chunk_number(); chunk_number_ = value; + // @@protoc_insertion_point(field_set:log_chunk.chunk_number) } // required .Ball_message ball = 2; @@ -305,11 +301,13 @@ inline void log_chunk::clear_ball() { clear_has_ball(); } inline const ::Ball_message& log_chunk::ball() const { + // @@protoc_insertion_point(field_get:log_chunk.ball) return ball_ != NULL ? *ball_ : *default_instance_->ball_; } inline ::Ball_message* log_chunk::mutable_ball() { set_has_ball(); if (ball_ == NULL) ball_ = new ::Ball_message; + // @@protoc_insertion_point(field_mutable:log_chunk.ball) return ball_; } inline ::Ball_message* log_chunk::release_ball() { @@ -326,6 +324,7 @@ inline void log_chunk::set_allocated_ball(::Ball_message* ball) { } else { clear_has_ball(); } + // @@protoc_insertion_point(field_set_allocated:log_chunk.ball) } // repeated .Robot_message ours = 3; @@ -336,20 +335,25 @@ inline void log_chunk::clear_ours() { ours_.Clear(); } inline const ::Robot_message& log_chunk::ours(int index) const { + // @@protoc_insertion_point(field_get:log_chunk.ours) return ours_.Get(index); } inline ::Robot_message* log_chunk::mutable_ours(int index) { + // @@protoc_insertion_point(field_mutable:log_chunk.ours) return ours_.Mutable(index); } inline ::Robot_message* log_chunk::add_ours() { + // @@protoc_insertion_point(field_add:log_chunk.ours) return ours_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::Robot_message >& log_chunk::ours() const { + // @@protoc_insertion_point(field_list:log_chunk.ours) return ours_; } inline ::google::protobuf::RepeatedPtrField< ::Robot_message >* log_chunk::mutable_ours() { + // @@protoc_insertion_point(field_mutable_list:log_chunk.ours) return &ours_; } @@ -361,20 +365,25 @@ inline void log_chunk::clear_opps() { opps_.Clear(); } inline const ::Robot_message& log_chunk::opps(int index) const { + // @@protoc_insertion_point(field_get:log_chunk.opps) return opps_.Get(index); } inline ::Robot_message* log_chunk::mutable_opps(int index) { + // @@protoc_insertion_point(field_mutable:log_chunk.opps) return opps_.Mutable(index); } inline ::Robot_message* log_chunk::add_opps() { + // @@protoc_insertion_point(field_add:log_chunk.opps) return opps_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::Robot_message >& log_chunk::opps() const { + // @@protoc_insertion_point(field_list:log_chunk.opps) return opps_; } inline ::google::protobuf::RepeatedPtrField< ::Robot_message >* log_chunk::mutable_opps() { + // @@protoc_insertion_point(field_mutable_list:log_chunk.opps) return &opps_; } @@ -397,11 +406,13 @@ inline void SSL_log::clear_numberofchunks() { clear_has_numberofchunks(); } inline ::google::protobuf::int64 SSL_log::numberofchunks() const { + // @@protoc_insertion_point(field_get:SSL_log.numberOfChunks) return numberofchunks_; } inline void SSL_log::set_numberofchunks(::google::protobuf::int64 value) { set_has_numberofchunks(); numberofchunks_ = value; + // @@protoc_insertion_point(field_set:SSL_log.numberOfChunks) } // required int64 timerInterval = 2; @@ -419,11 +430,13 @@ inline void SSL_log::clear_timerinterval() { clear_has_timerinterval(); } inline ::google::protobuf::int64 SSL_log::timerinterval() const { + // @@protoc_insertion_point(field_get:SSL_log.timerInterval) return timerinterval_; } inline void SSL_log::set_timerinterval(::google::protobuf::int64 value) { set_has_timerinterval(); timerinterval_ = value; + // @@protoc_insertion_point(field_set:SSL_log.timerInterval) } // repeated .log_chunk chunks = 3; @@ -434,20 +447,25 @@ inline void SSL_log::clear_chunks() { chunks_.Clear(); } inline const ::log_chunk& SSL_log::chunks(int index) const { + // @@protoc_insertion_point(field_get:SSL_log.chunks) return chunks_.Get(index); } inline ::log_chunk* SSL_log::mutable_chunks(int index) { + // @@protoc_insertion_point(field_mutable:SSL_log.chunks) return chunks_.Mutable(index); } inline ::log_chunk* SSL_log::add_chunks() { + // @@protoc_insertion_point(field_add:SSL_log.chunks) return chunks_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::log_chunk >& SSL_log::chunks() const { + // @@protoc_insertion_point(field_list:SSL_log.chunks) return chunks_; } inline ::google::protobuf::RepeatedPtrField< ::log_chunk >* SSL_log::mutable_chunks() { + // @@protoc_insertion_point(field_mutable_list:SSL_log.chunks) return &chunks_; } diff --git a/src/proto/vision_log.pb.cc b/src/proto/vision_log.pb.cc index ceb0525..763f214 100644 --- a/src/proto/vision_log.pb.cc +++ b/src/proto/vision_log.pb.cc @@ -137,6 +137,7 @@ const int Vision_chunk::kPacketFieldNumber; Vision_chunk::Vision_chunk() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Vision_chunk) } void Vision_chunk::InitAsDefaultInstance() { @@ -147,6 +148,7 @@ Vision_chunk::Vision_chunk(const Vision_chunk& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Vision_chunk) } void Vision_chunk::SharedCtor() { @@ -158,6 +160,7 @@ void Vision_chunk::SharedCtor() { } Vision_chunk::~Vision_chunk() { + // @@protoc_insertion_point(destructor:Vision_chunk) SharedDtor(); } @@ -189,33 +192,49 @@ Vision_chunk* Vision_chunk::New() const { } void Vision_chunk::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - time_elapsed_ = GOOGLE_LONGLONG(0); - id_ = GOOGLE_LONGLONG(0); +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(time_elapsed_, id_); if (has_packet()) { if (packet_ != NULL) packet_->::SSL_WrapperPacket::Clear(); } } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool Vision_chunk::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Vision_chunk) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int64 time_elapsed = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &time_elapsed_))); set_has_time_elapsed(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(16)) goto parse_id; break; @@ -223,15 +242,14 @@ bool Vision_chunk::MergePartialFromCodedStream( // optional int64 id = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 16) { parse_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &id_))); set_has_id(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(26)) goto parse_packet; break; @@ -239,23 +257,23 @@ bool Vision_chunk::MergePartialFromCodedStream( // required .SSL_WrapperPacket packet = 3; case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 26) { parse_packet: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_packet())); } else { - goto handle_uninterpreted; + goto handle_unusual; } - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -263,12 +281,18 @@ bool Vision_chunk::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Vision_chunk) return true; +failure: + // @@protoc_insertion_point(parse_failure:Vision_chunk) + return false; #undef DO_ } void Vision_chunk::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Vision_chunk) // required int64 time_elapsed = 1; if (has_time_elapsed()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->time_elapsed(), output); @@ -289,10 +313,12 @@ void Vision_chunk::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Vision_chunk) } ::google::protobuf::uint8* Vision_chunk::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Vision_chunk) // required int64 time_elapsed = 1; if (has_time_elapsed()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->time_elapsed(), target); @@ -314,6 +340,7 @@ ::google::protobuf::uint8* Vision_chunk::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Vision_chunk) return target; } @@ -433,6 +460,7 @@ const int Vision_log::kChunksFieldNumber; Vision_log::Vision_log() : ::google::protobuf::Message() { SharedCtor(); + // @@protoc_insertion_point(constructor:Vision_log) } void Vision_log::InitAsDefaultInstance() { @@ -442,6 +470,7 @@ Vision_log::Vision_log(const Vision_log& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:Vision_log) } void Vision_log::SharedCtor() { @@ -451,6 +480,7 @@ void Vision_log::SharedCtor() { } Vision_log::~Vision_log() { + // @@protoc_insertion_point(destructor:Vision_log) SharedDtor(); } @@ -481,9 +511,7 @@ Vision_log* Vision_log::New() const { } void Vision_log::Clear() { - if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - number_ = GOOGLE_LONGLONG(0); - } + number_ = GOOGLE_LONGLONG(0); chunks_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -491,20 +519,23 @@ void Vision_log::Clear() { bool Vision_log::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { + // @@protoc_insertion_point(parse_start:Vision_log) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int64 number = 1; case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &number_))); set_has_number(); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_chunks; break; @@ -512,24 +543,24 @@ bool Vision_log::MergePartialFromCodedStream( // repeated .Vision_chunk chunks = 2; case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + if (tag == 18) { parse_chunks: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_chunks())); } else { - goto handle_uninterpreted; + goto handle_unusual; } if (input->ExpectTag(18)) goto parse_chunks; - if (input->ExpectAtEnd()) return true; + if (input->ExpectAtEnd()) goto success; break; } default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; + goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); @@ -537,12 +568,18 @@ bool Vision_log::MergePartialFromCodedStream( } } } +success: + // @@protoc_insertion_point(parse_success:Vision_log) return true; +failure: + // @@protoc_insertion_point(parse_failure:Vision_log) + return false; #undef DO_ } void Vision_log::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Vision_log) // optional int64 number = 1; if (has_number()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->number(), output); @@ -558,10 +595,12 @@ void Vision_log::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:Vision_log) } ::google::protobuf::uint8* Vision_log::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Vision_log) // optional int64 number = 1; if (has_number()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->number(), target); @@ -578,6 +617,7 @@ ::google::protobuf::uint8* Vision_log::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } + // @@protoc_insertion_point(serialize_to_array_end:Vision_log) return target; } @@ -649,9 +689,7 @@ void Vision_log::CopyFrom(const Vision_log& from) { bool Vision_log::IsInitialized() const { - for (int i = 0; i < chunks_size(); i++) { - if (!this->chunks(i).IsInitialized()) return false; - } + if (!::google::protobuf::internal::AllAreInitialized(this->chunks())) return false; return true; } diff --git a/src/proto/vision_log.pb.h b/src/proto/vision_log.pb.h index 09b8641..71fc1dd 100644 --- a/src/proto/vision_log.pb.h +++ b/src/proto/vision_log.pb.h @@ -8,12 +8,12 @@ #include -#if GOOGLE_PROTOBUF_VERSION < 2005000 +#if GOOGLE_PROTOBUF_VERSION < 2006000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -85,7 +85,6 @@ class Vision_chunk : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -126,13 +125,11 @@ class Vision_chunk : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 time_elapsed_; ::google::protobuf::int64 id_; ::SSL_WrapperPacket* packet_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; - friend void protobuf_AddDesc_vision_5flog_2eproto(); friend void protobuf_AssignDesc_vision_5flog_2eproto(); friend void protobuf_ShutdownFile_vision_5flog_2eproto(); @@ -189,7 +186,6 @@ class Vision_log : public ::google::protobuf::Message { void SharedDtor(); void SetCachedSize(int size) const; public: - ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- @@ -222,12 +218,10 @@ class Vision_log : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; ::google::protobuf::int64 number_; ::google::protobuf::RepeatedPtrField< ::Vision_chunk > chunks_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; - friend void protobuf_AddDesc_vision_5flog_2eproto(); friend void protobuf_AssignDesc_vision_5flog_2eproto(); friend void protobuf_ShutdownFile_vision_5flog_2eproto(); @@ -257,11 +251,13 @@ inline void Vision_chunk::clear_time_elapsed() { clear_has_time_elapsed(); } inline ::google::protobuf::int64 Vision_chunk::time_elapsed() const { + // @@protoc_insertion_point(field_get:Vision_chunk.time_elapsed) return time_elapsed_; } inline void Vision_chunk::set_time_elapsed(::google::protobuf::int64 value) { set_has_time_elapsed(); time_elapsed_ = value; + // @@protoc_insertion_point(field_set:Vision_chunk.time_elapsed) } // optional int64 id = 2; @@ -279,11 +275,13 @@ inline void Vision_chunk::clear_id() { clear_has_id(); } inline ::google::protobuf::int64 Vision_chunk::id() const { + // @@protoc_insertion_point(field_get:Vision_chunk.id) return id_; } inline void Vision_chunk::set_id(::google::protobuf::int64 value) { set_has_id(); id_ = value; + // @@protoc_insertion_point(field_set:Vision_chunk.id) } // required .SSL_WrapperPacket packet = 3; @@ -301,11 +299,13 @@ inline void Vision_chunk::clear_packet() { clear_has_packet(); } inline const ::SSL_WrapperPacket& Vision_chunk::packet() const { + // @@protoc_insertion_point(field_get:Vision_chunk.packet) return packet_ != NULL ? *packet_ : *default_instance_->packet_; } inline ::SSL_WrapperPacket* Vision_chunk::mutable_packet() { set_has_packet(); if (packet_ == NULL) packet_ = new ::SSL_WrapperPacket; + // @@protoc_insertion_point(field_mutable:Vision_chunk.packet) return packet_; } inline ::SSL_WrapperPacket* Vision_chunk::release_packet() { @@ -322,6 +322,7 @@ inline void Vision_chunk::set_allocated_packet(::SSL_WrapperPacket* packet) { } else { clear_has_packet(); } + // @@protoc_insertion_point(field_set_allocated:Vision_chunk.packet) } // ------------------------------------------------------------------- @@ -343,11 +344,13 @@ inline void Vision_log::clear_number() { clear_has_number(); } inline ::google::protobuf::int64 Vision_log::number() const { + // @@protoc_insertion_point(field_get:Vision_log.number) return number_; } inline void Vision_log::set_number(::google::protobuf::int64 value) { set_has_number(); number_ = value; + // @@protoc_insertion_point(field_set:Vision_log.number) } // repeated .Vision_chunk chunks = 2; @@ -358,20 +361,25 @@ inline void Vision_log::clear_chunks() { chunks_.Clear(); } inline const ::Vision_chunk& Vision_log::chunks(int index) const { + // @@protoc_insertion_point(field_get:Vision_log.chunks) return chunks_.Get(index); } inline ::Vision_chunk* Vision_log::mutable_chunks(int index) { + // @@protoc_insertion_point(field_mutable:Vision_log.chunks) return chunks_.Mutable(index); } inline ::Vision_chunk* Vision_log::add_chunks() { + // @@protoc_insertion_point(field_add:Vision_log.chunks) return chunks_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::Vision_chunk >& Vision_log::chunks() const { + // @@protoc_insertion_point(field_list:Vision_log.chunks) return chunks_; } inline ::google::protobuf::RepeatedPtrField< ::Vision_chunk >* Vision_log::mutable_chunks() { + // @@protoc_insertion_point(field_mutable_list:Vision_log.chunks) return &chunks_; } diff --git a/src/ssl/mobileobject.cpp b/src/ssl/mobileobject.cpp old mode 100644 new mode 100755 diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 2abb11b..de46926 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -9,6 +9,7 @@ MainWindow::MainWindow(Soccer *soccer, QWidget *parent) : { ui->setupUi(this); //ui->txtLog->append(QSerialPort::); + //for rendering soccer area _render = new RenderArea(soccer); ui->gridRender->addWidget(_render); QStringList indexses; @@ -25,6 +26,8 @@ MainWindow::MainWindow(Soccer *soccer, QWidget *parent) : connect(&timer, SIGNAL(timeout()), this, SLOT(timer_timeout())); timer.start(100); + ui->debug_output_type->setCurrentIndex(1); + logTimer = new QTimer(); connect(logTimer, SIGNAL(timeout()), this, SLOT(logTimer_timeout())); diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index d0c4f03..13bd469 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -802,6 +802,9 @@ A* Nodes + + true + @@ -820,6 +823,9 @@ Debug Points + + true + From b3b25572f58a7be8f5b0f4e9adc5f76353a959eb Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Mon, 12 Dec 2016 20:34:42 +0330 Subject: [PATCH 02/15] save --- config/settings.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/settings.ini b/config/settings.ini index 9bc3f3c..613681a 100644 --- a/config/settings.ini +++ b/config/settings.ini @@ -1,14 +1,14 @@ ; KN2C SSL Configuration File [Game] -Mode=Real;Simulation; +Mode=Simulation;Real; [Team] -Color =Yellow;Blue; +Color =Blue;Yellow; Side =Left;Right; [Field] Size = Double;Single; [Transmitter] -SerialPort = /dev/ttyUSB1 +SerialPort = /dev/ttyUSB0 [VisionConfig] UsingCameras = 7;CAMERA_NONE = 0, CAMERA_0 = 1, CAMERA_1 = 2, CAMERA_2 = 3, CAMERA_3 = 4, CAMERA_BOTH_L = 5,CAMERA_BOTH_R = 6,CAMERA_ALL = 7 @@ -44,4 +44,3 @@ RefIP = 224.5.23.10 RefPort = 10010 RefPortNew = 10030 RefUseNew = 1 - From 425d295265a6d1d286e0d676a401b217d7e751f6 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Mon, 12 Dec 2016 22:25:55 +0330 Subject: [PATCH 03/15] save --- src/ai/agent.cpp | 43 +-- src/ai/agent.h | 2 +- src/ai/play/playtest.cpp | 2 +- src/ai/play/playtest2.cpp | 2 +- src/kn2cssl_new.pro.user | 2 +- src/output/controller.cpp | 571 ++++++++++++++++++++++----------- src/output/controller.h | 14 +- src/output/controller_struct.h | 1 - src/output/wpacket.cpp | 13 +- src/output/wpacket.h | 26 +- src/ssl/mobileobject.cpp | 9 +- 11 files changed, 428 insertions(+), 257 deletions(-) diff --git a/src/ai/agent.cpp b/src/ai/agent.cpp index da5ebc0..e49032a 100755 --- a/src/ai/agent.cpp +++ b/src/ai/agent.cpp @@ -6,8 +6,6 @@ Agent::Agent() : { wm = 0; id = -1; - - ctrl = new Controller(); } void Agent::setID(int id) @@ -31,33 +29,31 @@ void Agent::SendCommand(RobotCommand rc) { if(!wm->ourRobot[id].isValid) return; + if( id == 0 ) wm->debug_pos.clear(); ControllerInput ci = nav.calc(rc); - ControllerResult co = ctrl->calc(ci); - - if( !controllerResultIsValid(co) ) + if( id == 0 ) { - delete ctrl; - ctrl = new Controller(); + wm->debug_pos.append(ci.mid_pos.loc); + wm->debug_pos.append(ci.cur_pos.loc); } + ControllerResult co = ctrl.calc(ci); + // Real Game Packet RobotData reRD; - reRD.RID = id; - reRD.Vx_sp = co.rs.VX * 1000; - reRD.Vy_sp = co.rs.VY * 1000; - reRD.Wr_sp = co.rs.VW * 1000; - reRD.Vx = wm->ourRobot[id].vel.loc.x * 1000; - reRD.Vy = wm->ourRobot[id].vel.loc.y * 1000; - reRD.Wr = wm->ourRobot[id].vel.dir * 100; - reRD.alpha = wm->ourRobot[id].pos.dir * 1000; - reRD.KICK = (quint8) rc.kickspeedx; - reRD.CHIP = (quint8) rc.kickspeedz; - reRD.SPIN = 128;//for test + reRD.RID = id; + reRD.M0 = co.msR.M0; + reRD.M1 = co.msR.M1; + reRD.M2 = co.msR.M2; + reRD.M3 = co.msR.M3; + reRD.KCK = (quint8) rc.kickspeedx; + reRD.CHP = (quint8) rc.kickspeedz; + outputBuffer->wpck.AddRobot(reRD); + // grSim Packet grRobotData grRD; - grRD.rid = id; grRD.velx = co.rs.VX; grRD.vely = co.rs.VY; @@ -106,14 +102,7 @@ bool Agent::grSimPacketIsValid(grRobotData grRD) if( !isnan(grRD.velx) && !isnan(grRD.vely) && !isnan(grRD.velw) && !isnan(grRD.wheel1) && !isnan(grRD.wheel2) && !isnan(grRD.wheel3) && !isnan(grRD.wheel4) ) return true; - return false; -} -bool Agent::controllerResultIsValid(ControllerResult co) -{ - if( isnan(co.rs.VW) || isnan(co.rs.VX) || isnan(co.rs.VY) ) - return false; - - return true; } + diff --git a/src/ai/agent.h b/src/ai/agent.h index 264b772..1919a2b 100755 --- a/src/ai/agent.h +++ b/src/ai/agent.h @@ -81,7 +81,7 @@ class Agent : public Robot private: int id; - Controller *ctrl; + Controller ctrl; Navigation nav; OutputBuffer *outputBuffer; WorldModel *wm; diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 8d6abb8..06b8e23 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -8,7 +8,7 @@ PlayTest::PlayTest(WorldModel *worldmodel, QObject *parent) : int PlayTest::enterCondition() { - return 999999; + return 0; } void PlayTest::initRole() diff --git a/src/ai/play/playtest2.cpp b/src/ai/play/playtest2.cpp index cf3970b..281dc14 100644 --- a/src/ai/play/playtest2.cpp +++ b/src/ai/play/playtest2.cpp @@ -8,7 +8,7 @@ PlayTest2::PlayTest2(WorldModel *worldmodel, QObject *parent) : int PlayTest2::enterCondition() { - return 990; + return 0; } void PlayTest2::initRole() diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index e289cba..705279a 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/output/controller.cpp b/src/output/controller.cpp index f05fc3a..21b2f0a 100755 --- a/src/output/controller.cpp +++ b/src/output/controller.cpp @@ -1,6 +1,5 @@ #include "controller.h" #include "constants.h" -#include "math.h" #define ROBOTRADIUS 0.090 #define SpeedToRPMR 5000 @@ -14,12 +13,14 @@ Controller::Controller(QObject *parent) : timer.start(); + err0 = {0,0}; err1 = {0,0}; u1 = {0,0}; derived0 = {0,0}; derived1 = {0,0}; integral = {0,0}; + last_setpoint = {0,0}; wu1 = 0; wu1_last = 0; @@ -46,201 +47,405 @@ ControllerResult Controller::calc(ControllerInput &ci) //ctrlresult.rs = calcRobotSpeed_test(ci); //qDebug() << "id" << ci.id << "timer" << time; - // ctrlresult.msR = calcReal(ctrlresult.rs); - ctrlresult.msS = calcSimul(ctrlresult.rs,ci); + ctrlresult.msR = calcReal(ctrlresult.rs); + ctrlresult.msS = calcSimul(ctrlresult.rs); return ctrlresult; } RobotSpeed Controller::calcRobotSpeed_main(ControllerInput &ci) { - RobotSpeed setpoint; - Vector2D speed_sp; - - double werr; - Vector2D err; - - -// //! Test -// if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400,-2000)).r()) < 1000 ) -// //if(ci.cur_pos.loc.x > -1000) -// wu1=0; -// if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400, 2000)).r()) < 1000 ) -// //if(ci.cur_pos.loc.x < -3800) -// wu1=1; - - -// ci.mid_pos.loc.x = 2400; -// ci.mid_pos.dir = M_PI; - - -// if(wu1==0) -// ci.mid_pos.loc.y = 2860; -// //setpoint.VX = -2; -// else -// //setpoint.VX = 2; -// ci.mid_pos.loc.y = -2860; -// //! test - - - - err = (ci.mid_pos.loc - ci.cur_pos.loc); - if(fabs(err.r()) < 5 ) err = {0,0}; - if(fabs(err.r()) < 500 ) ci.fin_pos.dir = (ci.mid_pos.loc - ci.cur_pos.loc).dir().radian() + M_PI_2; - - werr = (ci.mid_pos.dir - ci.cur_pos.dir); - if(fabs(werr) > M_PI) werr = werr - sign(werr)*M_2PI; - if(fabs(werr) < 0.07 ) werr = 0; - - - - /** - * @brief PID controller based on pure err of distance - */ - ///////////////////////////////////////////////////////////////////////////////// - - double wkp=1.9,wki_pos=0.18,wki_neg=.2,wkd = 0.1,wki=.01; - double wa_max = 2; - //* finding useful vector of previous setpoint -/* if ( wi * werr < 0) -// { -// wi = 0; -// } -// //# - -// if((pow(ci.cur_vel.dir,2)/2/wa_max > fabs(werr) )&& (wi * werr > 0 )) -// { - -// wi= wi - wki_neg*sign(werr); -// if(fabs(wi) < 0 ) wi=0; - -// } -// else -// { -// wi = wi + wki_pos*sign(werr); -// int wmaxSpeed = 20; -// if(fabs(wi) > wmaxSpeed ) wi = fabs(wi)/wi*20; - -// } - -// wd = (ci.cur_vel.dir - ci.last_vel.dir - wd) *.1 + wd ; -// float wi_err = wi - ci.cur_vel.dir ; -// wkp = 1.2; -// wp = wi_err * wkp; -*/ - wp = werr * wkp; - if (fabs(wp) > 10) wp = sign(wp) * 10; - qDebug() < 1) wi = sign(wi) * 1; -// wd = (ci.cur_vel.dir - ci.last_vel.dir - wd) *.1 + wd ; -// if (fabs(wd) > 3) wd = sign(wd) * 3; - - setpoint.VW = wp + wi - wd * wkd ; -////qDebug() < 0) - { - i.setLength(i.length() * diff ); - i.setDir(atan2(err.y,err.x)*180/M_PI ); - } - else - { - i = i.setLength(0); - } - //# - - //* it keeps setpoint small till robot can't compensate its err -// if( 2 < (i-ci.cur_vel.loc).length()) -// { -// fault_counter ++ ; -// if(fault_counter > 20) -// { -// fault_counter = 0 ; -// i.setLength(2); -// qDebug() <<"aaa"; -// } - -// } - //# - err_angel = atan2(err.y,err.x); - i_angel =atan2(ci.cur_vel.loc.y,ci.cur_vel.loc.x); - diff = cos(err_angel - i_angel); - if( ( fabs( ci.cur_vel.loc.r2()/2/a_max )> fabs(err.r()) ) && (diff > 0)) - { - i= i - err.setLength(ki_neg); - if(fabs(i.length()) < 0 ) i=i.setLength(0); - - } - else - { -// ci.maxSpeed = 4 ; - if( fabs( i.r2()/2/a_max_c )< fabs(err.r()) ) - i = i + err.setLength(ki_pos); - if(fabs(i.length()) > ci.maxSpeed ) i=i.setLength(ci.maxSpeed); - - } - - - Vector2D i_err = i - ci.cur_vel.loc ; - - p = i_err * kp; - i_near = i_near + i_err * ki; - - err_angel = atan2(i.y,i.x); - i_angel =atan2(i_near.y,i_near.x); - diff = cos(err_angel - i_angel); - if ( diff > 0) - { - i_near.setLength(i_near.length() * diff ); - i_near.setDir(atan2(i.y,i.x)*180/M_PI ); - } - else - { - i_near = i_near.setLength(0); - } - - - speed_sp = p + i_near +i+ d * kd; - -// if(ci.id==7) -// qDebug() <<"aaaaaaaaaaaaaaa"< 30) +// { +//// qDebug() <<"L"< 1.5) + { + kp = fabs(err1.length()); + ki = 0.01; + kd = 3; + integral = integral + err1*AI_TIMER/1000.0 ; + } + else /*if(err > .04)*/ + { + integral.scale(0); + if(ci.fin_pos.loc == ci.mid_pos.loc) + { + kp = 5-2*fabs(ci.cur_vel.loc.length());fabs(err1.length())+2.9;////day2//f + if((ci.mid_pos.loc - last_setpoint ).length() > 30) + { + ki=.3; + } + last_setpoint = ci.mid_pos.loc; + } + else + { + kp = 4; + } + kd = 3; + + } + + + + + derived1 = (ci.cur_vel.loc - derived0)*0.1; + derived0 = ci.cur_vel.loc; + + + + LinearSpeed = err1*kp + integral*ki*err - derived1*kd; + + +// ////////////////////////////////////////day2 + double diff_angel = ci.cur_vel.dir - LinearSpeed.dir().radian(); + if (diff_angel > M_PI) diff_angel -= 2 * M_PI; + if (diff_angel < -M_PI) diff_angel += 2 * M_PI; + if(fabs(diff_angel) > M_PI*0.7) + { + LinearSpeed = LinearSpeed_past + (LinearSpeed - LinearSpeed_past)*0.01;//*50/(ci.mid_pos.loc - last_setpoint).length(); + + if(ci.id==8) + qDebug()<<"filter"<<(ci.mid_pos.loc - last_setpoint).length(); + } + LinearSpeed_past = LinearSpeed ; +// ////////////////////////////////////////day2 + + if(LinearSpeed.length()>ci.maxSpeed) + { + LinearSpeed.setLength(ci.maxSpeed); + } + + if(ci.id == 8) + qDebug()< M_PI) werr1 -= 2 * M_PI; + if (werr1 < -M_PI) werr1 += 2 * M_PI; + + double werr = fabs(werr1); + + + //wki=0.003*fabs(werr0); + //wintegral = wintegral + werr1*AI_TIMER; + + wkp=1*fabs(werr0);//0.3; + wkd=1; + if(werr<.3 + 10*fabs(ci.cur_vel.dir)) + { + wintegral=0; + //wintegral = wintegral - 3*werr1*AI_TIMER; + + wkp=0.4; + wkd=0.003; + } + + + + //if(ci.id == 3) + //qDebug()<MAXROTATIONSPEED) + { + wintegral = wintegral - werr1*AI_TIMER; + wu1=MAXROTATIONSPEED*sign(wu1); + } + + RotationSpeed = wu1; + + + double alpha = ci.cur_pos.dir ;+atan(RotationSpeed*0.187); + //alpha is the corrected angel whitch handle the problem + //of nonlinear relation of rotational movement and linear movement + + + + + RotLinearSpeed.x = LinearSpeed.x * cos(alpha) + LinearSpeed.y * sin(alpha); + RotLinearSpeed.y = -LinearSpeed.x * sin(alpha) + LinearSpeed.y * cos(alpha); + + RobotSpeed ans; + + ans.VX = RotLinearSpeed.x; + ans.VY = RotLinearSpeed.y; + ans.VW = RotationSpeed ; + + if(werr <0.07 /*&& err1.length()<.015*/) ans.VW=0;//maximum priscision in angel for robot becuse of it/s phisic's limits is 0.07 rad + + + if(err1.length()<.02) + { + ans.VX=0; + ans.VY=0; + } + + return ans; +} + +RobotSpeed Controller::calcRobotSpeed_adjt(ControllerInput &ci) +{ + float RotationSpeed; + + RotationSpeed = wu1; + Vector2D RotLinearSpeed; + switch(stateCTRL) + { + case 0://jelo + RotationSpeed = 0; + werr1 = ((Vector2D(1500,0)-ci.cur_pos.loc).dir().radian()) - ci.cur_pos.dir; + if (werr1 > M_PI) werr1 -= 2 * M_PI; + if (werr1 < -M_PI) werr1 += 2 * M_PI; + RotLinearSpeed = Vector2D(1.5,0);//sorate robot jelo + if((Vector2D(1500,0) - ci.cur_pos.loc).length()>500 && fabs(werr1)>M_PI/2.0) + { + stateCTRL = 3; + } + break; + case 1://aghab + RotationSpeed = 0; + werr1 = ((Vector2D(1500,0)-ci.cur_pos.loc).dir().radian()) - ci.cur_pos.dir; + if (werr1 > M_PI) werr1 -= 2 * M_PI; + if (werr1 < -M_PI) werr1 += 2 * M_PI; + RotLinearSpeed = Vector2D(-.3,0);//sorate robot aghab + if((Vector2D(1500,0) - ci.cur_pos.loc).length()>500&& fabs(werr1) M_PI) werr1 -= 2 * M_PI; + if (werr1 < -M_PI) werr1 += 2 * M_PI; + + if(werr1<-(M_PI/18.0)) + { + RotationSpeed = -1; + } + else if(werr1>(M_PI/18.0)) + { + RotationSpeed = 1; + } + else + { + RotationSpeed = 0; + stateCTRL = 0; + } + + break; + case 3://charkhesh + RotLinearSpeed = Vector2D(0,0); + werr1 = ((Vector2D(1200,0)-ci.cur_pos.loc).dir().radian() + M_PI) - ci.cur_pos.dir; + if (werr1 > M_PI) werr1 -= 2 * M_PI; + if (werr1 < -M_PI) werr1 += 2 * M_PI; + + if(werr1<-(M_PI/18.0)) + { + RotationSpeed = -1; + } + else if(werr1>(M_PI/18.0)) + { + RotationSpeed = 1; + } + else + { + RotationSpeed = 0; + stateCTRL = 1; + } + break; + } + + + RobotSpeed ans; + + ans.VX = RotLinearSpeed.x; + ans.VY = RotLinearSpeed.y; + ans.VW = RotationSpeed; + + return ans; } +RobotSpeed Controller::calcRobotSpeed_test(ControllerInput &ci) +{ + float RotationSpeed; + + double ap=1; + double am=1; + double am2=1; + double t0; + //double t1,t2; + double s0; + double s3; + double s1; + double v,dt,s,sp,vb; + double tp; + double t2p; + double t3; + /******************************Linear Speed Controller************************************/ + Vector2D RotLinearSpeed; + err0 = err1; + err1 = (ci.fin_pos.loc - ci.cur_pos.loc)*.001; + + t0 = -ci.cur_vel.loc.length()/ap; + s0 = -ci.cur_vel.loc.length()*t0/2; + s3 = pow(ci.fin_vel.loc.length(),2)/(2*am); + v = 0;//sqrt(s1*2*ap); + tp = (v/ap)+t0; + t3 = (v/am) + tp; + t2p = t3 - (ci.fin_vel.loc.length()/am); + + if(v>ci.maxSpeed) + { + s = err1.length() + s0 + s3; + sp = s * pow((v-ci.maxSpeed)/v,2); + dt = sp/ci.maxSpeed; + t3 = t3 + dt; + t2p = t2p + dt; + } + + double dist; + vb=ci.maxSpeed/2.0; + if (ci.cur_vel.loc.length()dist) + { + t0 = -ci.cur_vel.loc.length()/ap; + + s0 = -ci.cur_vel.loc.length()*t0/2; + s3 = pow(ci.fin_vel.loc.length(),2)/(2*am); + s1 = (err1.length()+s0+s3)/(1+ap/am); + v = sqrt(s1*2*ap); + tp = (v/ap)+t0; + t3 = (v/am) + tp; + t2p = t3 - (ci.fin_vel.loc.length()/am); + //t2 = t2p; + double Sm = (pow(v,2)-pow(ci.fin_vel.loc.length(),2))/(2.0*am); + u1.setLength(sqrt(2.0*ap*((err1.length()-Sm))+pow(v,2))); + + } + + if(u1.length()>ci.maxSpeed) + { + u1.setLength(ci.maxSpeed); + } + Vector2D LinearSpeed; + + LinearSpeed = u1; + + RotLinearSpeed.x = LinearSpeed.x * cos(ci.cur_pos.dir) + LinearSpeed.y * sin(ci.cur_pos.dir); + RotLinearSpeed.y = -LinearSpeed.x * sin(ci.cur_pos.dir) + LinearSpeed.y * cos(ci.cur_pos.dir); + RotationSpeed=0; + RobotSpeed result; + + result.VX = RotLinearSpeed.x; + result.VY = RotLinearSpeed.y; + result.VW = RotationSpeed; + + out << err1.y <<" "<< LinearSpeed.x <<" "<< LinearSpeed.y << endl; + return result; +} -MotorSpeed Controller::calcSimul(RobotSpeed rs, ControllerInput &ci) +MotorSpeed Controller::calcReal(RobotSpeed rs) { double motor[4][1],rotate[4][3],speed[3][1]; - Vector2D RotLinearSpeed; - RotLinearSpeed.x = rs.VX * cos(ci.cur_pos.dir) + rs.VY * sin(ci.cur_pos.dir); - RotLinearSpeed.y = -rs.VX * sin(ci.cur_pos.dir) + rs.VY * cos(ci.cur_pos.dir); + speed[0][0] = -rs.VX; + speed[1][0] = -rs.VY; + speed[2][0] = -rs.VW; + + rotate[0][0] = cos( 0.18716 * M_PI);//cos(M_PI /4.0);//-sin(rangle + M_PI);//7/4 + rotate[1][0] = sin( M_PI / 4.0 );//-cos(0.22 * M_PI);//-sin(rangle - M_PI / 3);//0.218 + rotate[2][0] = -cos( M_PI / 4.0 );//-sin(0.22 * M_PI);//-sin(rangle + M_PI / 3);//0.78 + rotate[3][0] = -cos( 0.18716 * M_PI);//cos(M_PI /4.0);//-sin(rangle + M_PI);//5/4 + rotate[0][1] = -sin(0.18716 * M_PI );//cos(M_PI /4.0);//cos(rangle + M_PI);//7/4 + rotate[1][1] = cos(M_PI / 4.0 );//- sin(0.22 * M_PI);// cos(rangle - M_PI / 3);//0.218 + rotate[2][1] = sin(M_PI / 4.0);//cos(0.22 * M_PI);//cos(rangle + M_PI / 3);//0.187 + rotate[3][1] = -sin(0.18716 * M_PI);//-cos(M_PI /4.0);//cos(rangle + M_PI);//5/4 + + rotate[0][2] = -ROBOTRADIUS; + rotate[1][2] = -ROBOTRADIUS; + rotate[2][2] = -ROBOTRADIUS; + rotate[3][2] = -ROBOTRADIUS; + + motor[0][0] = (rotate[0][0] * speed[0][0] + rotate[0][1] * speed[1][0])*SpeedToRPM + rotate[0][2] * speed[2][0]*SpeedToRPMR; + motor[1][0] = (rotate[1][0] * speed[0][0] + rotate[1][1] * speed[1][0])*SpeedToRPM + rotate[1][2] * speed[2][0]*SpeedToRPMR; + motor[2][0] = (rotate[2][0] * speed[0][0] + rotate[2][1] * speed[1][0])*SpeedToRPM + rotate[2][2] * speed[2][0]*SpeedToRPMR; + motor[3][0] = (rotate[3][0] * speed[0][0] + rotate[3][1] * speed[1][0])*SpeedToRPM + rotate[3][2] * speed[2][0]*SpeedToRPMR; + + MotorSpeed result; + + result.M0 = (motor[0][0]); + result.M1 = (motor[1][0]); + result.M2 = (motor[2][0]); + result.M3 = (motor[3][0]); + + return result; +} + +MotorSpeed Controller::calcSimul(RobotSpeed rs) +{ + double motor[4][1],rotate[4][3],speed[3][1]; - speed[0][0] = RotLinearSpeed.x/10; - speed[1][0] = RotLinearSpeed.y/10; - speed[2][0] = rs.VW/10; + speed[0][0] = rs.VX; + speed[1][0] = rs.VY; + speed[2][0] = rs.VW; rotate[0][0] = sin(M_PI / 3);//-sin(rangle - M_PI / 3); rotate[1][0] = sin(3 * M_PI / 4);//-sin(rangle + M_PI / 3); diff --git a/src/output/controller.h b/src/output/controller.h index 5062fd5..4193952 100755 --- a/src/output/controller.h +++ b/src/output/controller.h @@ -18,7 +18,11 @@ class Controller : public QObject QTime timer; RobotSpeed calcRobotSpeed_main(ControllerInput &ci); - MotorSpeed calcSimul(RobotSpeed rs, ControllerInput &ci); + RobotSpeed calcRobotSpeed_adjt(ControllerInput &ci); + RobotSpeed calcRobotSpeed_test(ControllerInput &ci); + + MotorSpeed calcReal(RobotSpeed rs); + MotorSpeed calcSimul(RobotSpeed rs); private: @@ -34,14 +38,6 @@ class Controller : public QObject double wu1,wu1_last,wintegral,werr0,werr1; double wderived0,wderived1; - - ///////////////////////////////////////////////////////////////new controller - double wp,wi,wd; - Vector2D p,i,d,i_near,i_far; - int fault_counter; - /////////////////////////////////////////////////////////////// - - int stateCTRL; ofstream out; diff --git a/src/output/controller_struct.h b/src/output/controller_struct.h index 3f585d1..f0a68e5 100755 --- a/src/output/controller_struct.h +++ b/src/output/controller_struct.h @@ -17,7 +17,6 @@ struct ControllerInput int id; Position cur_pos; Position cur_vel; - Position last_vel; Position mid_pos; Position mid_vel; diff --git a/src/output/wpacket.cpp b/src/output/wpacket.cpp index e98a235..17f98c7 100755 --- a/src/output/wpacket.cpp +++ b/src/output/wpacket.cpp @@ -22,14 +22,11 @@ QByteArray WPacket::GetPacket() for(int i=0; i<_rdata.size(); i++) { - _rdata[i].Vx_sp = qToBigEndian(_rdata[i].Vx_sp); - _rdata[i].Vy_sp = qToBigEndian(_rdata[i].Vy_sp); - _rdata[i].Wr_sp = qToBigEndian(_rdata[i].Wr_sp); - _rdata[i].Vx = qToBigEndian(_rdata[i].Vx); - _rdata[i].Vy = qToBigEndian(_rdata[i].Vy); - _rdata[i].Wr = qToBigEndian(_rdata[i].Wr); - _rdata[i].alpha = qToBigEndian(_rdata[i].alpha); - rd.append((const char*)&(_rdata[i]), 18); //sizeof(RobotData); + _rdata[i].M0 = qToBigEndian(_rdata[i].M0); + _rdata[i].M1 = qToBigEndian(_rdata[i].M1); + _rdata[i].M2 = qToBigEndian(_rdata[i].M2); + _rdata[i].M3 = qToBigEndian(_rdata[i].M3); + rd.append((const char*)&(_rdata[i]), 11); //sizeof(RobotData); } unsigned char checksum=0; diff --git a/src/output/wpacket.h b/src/output/wpacket.h index 236d775..c0be0d0 100755 --- a/src/output/wpacket.h +++ b/src/output/wpacket.h @@ -29,16 +29,6 @@ struct SendPacketHeader struct RobotData { unsigned char RID; // robot id - signed short int Vx_sp; - signed short int Vy_sp; - signed short int Wr_sp; - signed short int Vx; - signed short int Vy; - signed short int Wr; - signed short int alpha; - unsigned char KICK; // kick options - unsigned char CHIP; // CHIP & SPIN #SCCCCCCC - unsigned char SPIN; signed short int M0; // motor 1 signed short int M1; // motor 2 signed short int M2; // motor 3 @@ -48,16 +38,12 @@ struct RobotData RobotData() : RID(0xFF), - Vx_sp(0), - Vy_sp(0), - Wr_sp(0), - Vx(0), - Vy(0), - Wr(0), - alpha(0), - KICK(0), - CHIP(0), - SPIN(0) + M0(0), + M1(0), + M2(0), + M3(0), + KCK(0), + CHP(0) { } }; #pragma pack(pop) /* restore original alignment from stack */ diff --git a/src/ssl/mobileobject.cpp b/src/ssl/mobileobject.cpp index 85a9def..34d0c31 100755 --- a/src/ssl/mobileobject.cpp +++ b/src/ssl/mobileobject.cpp @@ -8,7 +8,7 @@ MobileObject::MobileObject() : isValid = false; connect(&timer_seen, SIGNAL(timeout()), this, SLOT(timer_seen_timeout())); connect(&timer_vel, SIGNAL(timeout()), this, SLOT(timer_vel_timeout())); - timer_seen_interval = 100; + timer_seen_interval = 500; timer_vel_interval = 40; for(int i=0; i M_PI) dir_dif = dir_dif - dir_dif/fabs(dir_dif)*M_PI*2; - vel.dir = (dir_dif) / (time - last.time ) *1000 ; + vel.loc = vel.loc + (((pos.loc - last.pos.loc) / (time - last.time)) - vel.loc)*0.12; + vel.dir = (pos.dir - last.pos.dir) / (time - last.time ); + pos_predicted.loc = pos.loc + vel.loc * (time - last.time); pos_predicted.dir = pos.dir + vel.dir * (time - last.time); From cb063583982eb49db7739cce00c1f5d4593c50cd Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Wed, 21 Dec 2016 17:32:14 +0330 Subject: [PATCH 04/15] test --- src/ai/agent.cpp | 43 ++- src/ai/agent.h | 2 +- src/ai/play/playtest.cpp | 6 +- src/ai/soccer.cpp | 12 +- src/kn2cssl_new.pro.user | 2 +- src/output/controller.cpp | 555 +++++++++++---------------------- src/output/controller.h | 14 +- src/output/controller_struct.h | 1 + src/output/wpacket.cpp | 13 +- src/output/wpacket.h | 26 +- src/ssl/mobileobject.cpp | 9 +- src/ui/mainwindow.ui | 5 +- 12 files changed, 260 insertions(+), 428 deletions(-) diff --git a/src/ai/agent.cpp b/src/ai/agent.cpp index e49032a..da5ebc0 100755 --- a/src/ai/agent.cpp +++ b/src/ai/agent.cpp @@ -6,6 +6,8 @@ Agent::Agent() : { wm = 0; id = -1; + + ctrl = new Controller(); } void Agent::setID(int id) @@ -29,31 +31,33 @@ void Agent::SendCommand(RobotCommand rc) { if(!wm->ourRobot[id].isValid) return; - if( id == 0 ) wm->debug_pos.clear(); ControllerInput ci = nav.calc(rc); - if( id == 0 ) + ControllerResult co = ctrl->calc(ci); + + if( !controllerResultIsValid(co) ) { - wm->debug_pos.append(ci.mid_pos.loc); - wm->debug_pos.append(ci.cur_pos.loc); + delete ctrl; + ctrl = new Controller(); } - ControllerResult co = ctrl.calc(ci); - // Real Game Packet RobotData reRD; - reRD.RID = id; - reRD.M0 = co.msR.M0; - reRD.M1 = co.msR.M1; - reRD.M2 = co.msR.M2; - reRD.M3 = co.msR.M3; - reRD.KCK = (quint8) rc.kickspeedx; - reRD.CHP = (quint8) rc.kickspeedz; - + reRD.RID = id; + reRD.Vx_sp = co.rs.VX * 1000; + reRD.Vy_sp = co.rs.VY * 1000; + reRD.Wr_sp = co.rs.VW * 1000; + reRD.Vx = wm->ourRobot[id].vel.loc.x * 1000; + reRD.Vy = wm->ourRobot[id].vel.loc.y * 1000; + reRD.Wr = wm->ourRobot[id].vel.dir * 100; + reRD.alpha = wm->ourRobot[id].pos.dir * 1000; + reRD.KICK = (quint8) rc.kickspeedx; + reRD.CHIP = (quint8) rc.kickspeedz; + reRD.SPIN = 128;//for test outputBuffer->wpck.AddRobot(reRD); - // grSim Packet grRobotData grRD; + grRD.rid = id; grRD.velx = co.rs.VX; grRD.vely = co.rs.VY; @@ -102,7 +106,14 @@ bool Agent::grSimPacketIsValid(grRobotData grRD) if( !isnan(grRD.velx) && !isnan(grRD.vely) && !isnan(grRD.velw) && !isnan(grRD.wheel1) && !isnan(grRD.wheel2) && !isnan(grRD.wheel3) && !isnan(grRD.wheel4) ) return true; - return false; + return false; } +bool Agent::controllerResultIsValid(ControllerResult co) +{ + if( isnan(co.rs.VW) || isnan(co.rs.VX) || isnan(co.rs.VY) ) + return false; + + return true; +} diff --git a/src/ai/agent.h b/src/ai/agent.h index 1919a2b..264b772 100755 --- a/src/ai/agent.h +++ b/src/ai/agent.h @@ -81,7 +81,7 @@ class Agent : public Robot private: int id; - Controller ctrl; + Controller *ctrl; Navigation nav; OutputBuffer *outputBuffer; WorldModel *wm; diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 06b8e23..5cb3ae3 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -8,7 +8,7 @@ PlayTest::PlayTest(WorldModel *worldmodel, QObject *parent) : int PlayTest::enterCondition() { - return 0; + return 99990; } void PlayTest::initRole() @@ -21,6 +21,6 @@ void PlayTest::execute() // wm->debug_pos.clear(); // wm->debug_pos.append(wm->ourRobot[1].pos.loc); // wm->debug_pos.append(wm->ourRobot[0].pos.loc); - tactics[2] = tTest; - + if(wm->ball.vel.loc.length() > 1) + qDebug() << wm->ball.vel.loc.length(); } diff --git a/src/ai/soccer.cpp b/src/ai/soccer.cpp index bcc93a7..b24a2af 100644 --- a/src/ai/soccer.cpp +++ b/src/ai/soccer.cpp @@ -130,12 +130,12 @@ Soccer::Soccer(QObject *parent) : // serial port transmitter transmitter = 0; - if(gamemode==MODE_REAL) - { - transmitter = new Transmitter(serialport, outputbuffer, wm); - transmitter->Start(); - wm->isSim = false; - } +// if(gamemode==MODE_REAL) +// { +// transmitter = new Transmitter(serialport, outputbuffer, wm); +// transmitter->Start(); +// wm->isSim = false; +// } // AI ai = new AI(wm, field,outputbuffer, this); diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 705279a..1496e7f 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/output/controller.cpp b/src/output/controller.cpp index 21b2f0a..0b5dfda 100755 --- a/src/output/controller.cpp +++ b/src/output/controller.cpp @@ -1,5 +1,6 @@ #include "controller.h" #include "constants.h" +#include "math.h" #define ROBOTRADIUS 0.090 #define SpeedToRPMR 5000 @@ -13,14 +14,12 @@ Controller::Controller(QObject *parent) : timer.start(); - err0 = {0,0}; err1 = {0,0}; u1 = {0,0}; derived0 = {0,0}; derived1 = {0,0}; integral = {0,0}; - last_setpoint = {0,0}; wu1 = 0; wu1_last = 0; @@ -47,405 +46,201 @@ ControllerResult Controller::calc(ControllerInput &ci) //ctrlresult.rs = calcRobotSpeed_test(ci); //qDebug() << "id" << ci.id << "timer" << time; - ctrlresult.msR = calcReal(ctrlresult.rs); - ctrlresult.msS = calcSimul(ctrlresult.rs); + // ctrlresult.msR = calcReal(ctrlresult.rs); + ctrlresult.msS = calcSimul(ctrlresult.rs,ci); return ctrlresult; } RobotSpeed Controller::calcRobotSpeed_main(ControllerInput &ci) { - //double time = timer.elapsed()/1000; - //timer.restart(); - /******************************Linear Speed Controller************************************/ - err1 = (ci.mid_pos.loc - ci.cur_pos.loc)*.001; - -// if(ci.maxSpeed == 3) -// ci.maxSpeed == 4; - - - ///! -// if((ci.mid_pos.loc - last_setpoint ).length() > 30) -// { -//// qDebug() <<"L"< 1.5) - { - kp = fabs(err1.length()); - ki = 0.01; - kd = 3; - integral = integral + err1*AI_TIMER/1000.0 ; - } - else /*if(err > .04)*/ - { - integral.scale(0); - if(ci.fin_pos.loc == ci.mid_pos.loc) - { - kp = 5-2*fabs(ci.cur_vel.loc.length());fabs(err1.length())+2.9;////day2//f - if((ci.mid_pos.loc - last_setpoint ).length() > 30) - { - ki=.3; - } - last_setpoint = ci.mid_pos.loc; - } - else - { - kp = 4; - } - kd = 3; - - } - - - - - derived1 = (ci.cur_vel.loc - derived0)*0.1; - derived0 = ci.cur_vel.loc; - - - - LinearSpeed = err1*kp + integral*ki*err - derived1*kd; - - -// ////////////////////////////////////////day2 - double diff_angel = ci.cur_vel.dir - LinearSpeed.dir().radian(); - if (diff_angel > M_PI) diff_angel -= 2 * M_PI; - if (diff_angel < -M_PI) diff_angel += 2 * M_PI; - if(fabs(diff_angel) > M_PI*0.7) - { - LinearSpeed = LinearSpeed_past + (LinearSpeed - LinearSpeed_past)*0.01;//*50/(ci.mid_pos.loc - last_setpoint).length(); - - if(ci.id==8) - qDebug()<<"filter"<<(ci.mid_pos.loc - last_setpoint).length(); - } - LinearSpeed_past = LinearSpeed ; -// ////////////////////////////////////////day2 - - if(LinearSpeed.length()>ci.maxSpeed) - { - LinearSpeed.setLength(ci.maxSpeed); - } - - if(ci.id == 8) - qDebug()< M_PI) werr1 -= 2 * M_PI; - if (werr1 < -M_PI) werr1 += 2 * M_PI; - - double werr = fabs(werr1); - - - //wki=0.003*fabs(werr0); - //wintegral = wintegral + werr1*AI_TIMER; - - wkp=1*fabs(werr0);//0.3; - wkd=1; - if(werr<.3 + 10*fabs(ci.cur_vel.dir)) - { - wintegral=0; - //wintegral = wintegral - 3*werr1*AI_TIMER; - - wkp=0.4; - wkd=0.003; - } - - - - //if(ci.id == 3) - //qDebug()<MAXROTATIONSPEED) - { - wintegral = wintegral - werr1*AI_TIMER; - wu1=MAXROTATIONSPEED*sign(wu1); - } - - RotationSpeed = wu1; - - - double alpha = ci.cur_pos.dir ;+atan(RotationSpeed*0.187); - //alpha is the corrected angel whitch handle the problem - //of nonlinear relation of rotational movement and linear movement - - - + RobotSpeed setpoint; + Vector2D speed_sp; - RotLinearSpeed.x = LinearSpeed.x * cos(alpha) + LinearSpeed.y * sin(alpha); - RotLinearSpeed.y = -LinearSpeed.x * sin(alpha) + LinearSpeed.y * cos(alpha); + double werr; + Vector2D err; - RobotSpeed ans; - ans.VX = RotLinearSpeed.x; - ans.VY = RotLinearSpeed.y; - ans.VW = RotationSpeed ; +// //! Test + if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400,-2000)).r()) < 1000 ) + //if(ci.cur_pos.loc.x > -1000) + wu1=0; + if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400, 2000)).r()) < 1000 ) + //if(ci.cur_pos.loc.x < -3800) + wu1=1; - if(werr <0.07 /*&& err1.length()<.015*/) ans.VW=0;//maximum priscision in angel for robot becuse of it/s phisic's limits is 0.07 rad + ci.mid_pos.loc.x = 2400; + ci.mid_pos.dir = M_PI; - if(err1.length()<.02) - { - ans.VX=0; - ans.VY=0; - } - return ans; -} - -RobotSpeed Controller::calcRobotSpeed_adjt(ControllerInput &ci) -{ - float RotationSpeed; - - RotationSpeed = wu1; - Vector2D RotLinearSpeed; - switch(stateCTRL) - { - case 0://jelo - RotationSpeed = 0; - werr1 = ((Vector2D(1500,0)-ci.cur_pos.loc).dir().radian()) - ci.cur_pos.dir; - if (werr1 > M_PI) werr1 -= 2 * M_PI; - if (werr1 < -M_PI) werr1 += 2 * M_PI; - RotLinearSpeed = Vector2D(1.5,0);//sorate robot jelo - if((Vector2D(1500,0) - ci.cur_pos.loc).length()>500 && fabs(werr1)>M_PI/2.0) - { - stateCTRL = 3; - } - break; - case 1://aghab - RotationSpeed = 0; - werr1 = ((Vector2D(1500,0)-ci.cur_pos.loc).dir().radian()) - ci.cur_pos.dir; - if (werr1 > M_PI) werr1 -= 2 * M_PI; - if (werr1 < -M_PI) werr1 += 2 * M_PI; - RotLinearSpeed = Vector2D(-.3,0);//sorate robot aghab - if((Vector2D(1500,0) - ci.cur_pos.loc).length()>500&& fabs(werr1) M_PI) werr1 -= 2 * M_PI; - if (werr1 < -M_PI) werr1 += 2 * M_PI; - - if(werr1<-(M_PI/18.0)) - { - RotationSpeed = -1; - } - else if(werr1>(M_PI/18.0)) - { - RotationSpeed = 1; - } + if(wu1==0) + ci.mid_pos.loc.y = 2860; + //setpoint.VX = -2; else - { - RotationSpeed = 0; - stateCTRL = 0; - } - - break; - case 3://charkhesh - RotLinearSpeed = Vector2D(0,0); - werr1 = ((Vector2D(1200,0)-ci.cur_pos.loc).dir().radian() + M_PI) - ci.cur_pos.dir; - if (werr1 > M_PI) werr1 -= 2 * M_PI; - if (werr1 < -M_PI) werr1 += 2 * M_PI; - - if(werr1<-(M_PI/18.0)) - { - RotationSpeed = -1; - } - else if(werr1>(M_PI/18.0)) - { - RotationSpeed = 1; - } - else - { - RotationSpeed = 0; - stateCTRL = 1; - } - break; - } - - - RobotSpeed ans; - - ans.VX = RotLinearSpeed.x; - ans.VY = RotLinearSpeed.y; - ans.VW = RotationSpeed; - - return ans; + //setpoint.VX = 2; + ci.mid_pos.loc.y = -2860; +// //! test + + + + err = (ci.mid_pos.loc - ci.cur_pos.loc); + if(fabs(err.r()) < 5 ) err = {0,0}; + if(fabs(err.r()) < 500 ) ci.fin_pos.dir = (ci.mid_pos.loc - ci.cur_pos.loc).dir().radian() + M_PI_2; + + werr = (ci.mid_pos.dir - ci.cur_pos.dir); + if(fabs(werr) > M_PI) werr = werr - sign(werr)*M_2PI; + if(fabs(werr) < 0.07 ) werr = 0; + + + + /** + * @brief PID controller based on pure err of distance + */ + ///////////////////////////////////////////////////////////////////////////////// + + double wkp=1.9,wki_pos=0.18,wki_neg=.2,wkd = 0.1,wki=.01; + double wa_max = 2; + //* finding useful vector of previous setpoint +/* if ( wi * werr < 0) +// { +// wi = 0; +// } +// //# + +// if((pow(ci.cur_vel.dir,2)/2/wa_max > fabs(werr) )&& (wi * werr > 0 )) +// { + +// wi= wi - wki_neg*sign(werr); +// if(fabs(wi) < 0 ) wi=0; + +// } +// else +// { +// wi = wi + wki_pos*sign(werr); +// int wmaxSpeed = 20; +// if(fabs(wi) > wmaxSpeed ) wi = fabs(wi)/wi*20; + +// } + +// wd = (ci.cur_vel.dir - ci.last_vel.dir - wd) *.1 + wd ; +// float wi_err = wi - ci.cur_vel.dir ; +// wkp = 1.2; +// wp = wi_err * wkp; +*/ + wp = werr * wkp; + if (fabs(wp) > 10) wp = sign(wp) * 10; + qDebug() < 1) wi = sign(wi) * 1; +// wd = (ci.cur_vel.dir - ci.last_vel.dir - wd) *.1 + wd ; +// if (fabs(wd) > 3) wd = sign(wd) * 3; + + setpoint.VW = wp + wi - wd * wkd ; +////qDebug() < 0) + { + i.setLength(i.length() * diff ); + i.setDir(atan2(err.y,err.x)*180/M_PI ); + } + else + { + i = i.setLength(0); + } + //# + + //* it keeps setpoint small till robot can't compensate its err +// if( 2 < (i-ci.cur_vel.loc).length()) +// { +// fault_counter ++ ; +// if(fault_counter > 20) +// { +// fault_counter = 0 ; +// i.setLength(2); +// qDebug() <<"aaa"; +// } + +// } + //# + err_angel = atan2(err.y,err.x); + i_angel =atan2(ci.cur_vel.loc.y,ci.cur_vel.loc.x); + diff = cos(err_angel - i_angel); + if( ( fabs( ci.cur_vel.loc.r2()/2/a_max )> fabs(err.r()) ) && (diff > 0)) + { + i= i - err.setLength(ki_neg); + if(fabs(i.length()) < 0 ) i=i.setLength(0); + + } + else + { +// ci.maxSpeed = 4 ; + if( fabs( i.r2()/2/a_max_c )< fabs(err.r()) ) + i = i + err.setLength(ki_pos); + if(fabs(i.length()) > ci.maxSpeed ) i=i.setLength(ci.maxSpeed); + + } + + + Vector2D i_err = i - ci.cur_vel.loc ; + + p = i_err * kp; + i_near = i_near + i_err * ki; + + err_angel = atan2(i.y,i.x); + i_angel =atan2(i_near.y,i_near.x); + diff = cos(err_angel - i_angel); + if ( diff > 0) + { + i_near.setLength(i_near.length() * diff ); + i_near.setDir(atan2(i.y,i.x)*180/M_PI ); + } + else + { + i_near = i_near.setLength(0); + } + + + speed_sp = p + i_near +i+ d * kd; + +// if(ci.id==7) +// qDebug() <<"aaaaaaaaaaaaaaa"<ci.maxSpeed) - { - s = err1.length() + s0 + s3; - sp = s * pow((v-ci.maxSpeed)/v,2); - dt = sp/ci.maxSpeed; - t3 = t3 + dt; - t2p = t2p + dt; - } - - double dist; - vb=ci.maxSpeed/2.0; - if (ci.cur_vel.loc.length()dist) - { - t0 = -ci.cur_vel.loc.length()/ap; - - s0 = -ci.cur_vel.loc.length()*t0/2; - s3 = pow(ci.fin_vel.loc.length(),2)/(2*am); - s1 = (err1.length()+s0+s3)/(1+ap/am); - v = sqrt(s1*2*ap); - tp = (v/ap)+t0; - t3 = (v/am) + tp; - t2p = t3 - (ci.fin_vel.loc.length()/am); - //t2 = t2p; - double Sm = (pow(v,2)-pow(ci.fin_vel.loc.length(),2))/(2.0*am); - u1.setLength(sqrt(2.0*ap*((err1.length()-Sm))+pow(v,2))); - - } - - if(u1.length()>ci.maxSpeed) - { - u1.setLength(ci.maxSpeed); - } - Vector2D LinearSpeed; - - LinearSpeed = u1; - - RotLinearSpeed.x = LinearSpeed.x * cos(ci.cur_pos.dir) + LinearSpeed.y * sin(ci.cur_pos.dir); - RotLinearSpeed.y = -LinearSpeed.x * sin(ci.cur_pos.dir) + LinearSpeed.y * cos(ci.cur_pos.dir); - RotationSpeed=0; - RobotSpeed result; - - result.VX = RotLinearSpeed.x; - result.VY = RotLinearSpeed.y; - result.VW = RotationSpeed; - - out << err1.y <<" "<< LinearSpeed.x <<" "<< LinearSpeed.y << endl; - return result; -} -MotorSpeed Controller::calcReal(RobotSpeed rs) +MotorSpeed Controller::calcSimul(RobotSpeed rs, ControllerInput &ci) { double motor[4][1],rotate[4][3],speed[3][1]; - speed[0][0] = -rs.VX; - speed[1][0] = -rs.VY; - speed[2][0] = -rs.VW; - - rotate[0][0] = cos( 0.18716 * M_PI);//cos(M_PI /4.0);//-sin(rangle + M_PI);//7/4 - rotate[1][0] = sin( M_PI / 4.0 );//-cos(0.22 * M_PI);//-sin(rangle - M_PI / 3);//0.218 - rotate[2][0] = -cos( M_PI / 4.0 );//-sin(0.22 * M_PI);//-sin(rangle + M_PI / 3);//0.78 - rotate[3][0] = -cos( 0.18716 * M_PI);//cos(M_PI /4.0);//-sin(rangle + M_PI);//5/4 - rotate[0][1] = -sin(0.18716 * M_PI );//cos(M_PI /4.0);//cos(rangle + M_PI);//7/4 - rotate[1][1] = cos(M_PI / 4.0 );//- sin(0.22 * M_PI);// cos(rangle - M_PI / 3);//0.218 - rotate[2][1] = sin(M_PI / 4.0);//cos(0.22 * M_PI);//cos(rangle + M_PI / 3);//0.187 - rotate[3][1] = -sin(0.18716 * M_PI);//-cos(M_PI /4.0);//cos(rangle + M_PI);//5/4 - - rotate[0][2] = -ROBOTRADIUS; - rotate[1][2] = -ROBOTRADIUS; - rotate[2][2] = -ROBOTRADIUS; - rotate[3][2] = -ROBOTRADIUS; - - motor[0][0] = (rotate[0][0] * speed[0][0] + rotate[0][1] * speed[1][0])*SpeedToRPM + rotate[0][2] * speed[2][0]*SpeedToRPMR; - motor[1][0] = (rotate[1][0] * speed[0][0] + rotate[1][1] * speed[1][0])*SpeedToRPM + rotate[1][2] * speed[2][0]*SpeedToRPMR; - motor[2][0] = (rotate[2][0] * speed[0][0] + rotate[2][1] * speed[1][0])*SpeedToRPM + rotate[2][2] * speed[2][0]*SpeedToRPMR; - motor[3][0] = (rotate[3][0] * speed[0][0] + rotate[3][1] * speed[1][0])*SpeedToRPM + rotate[3][2] * speed[2][0]*SpeedToRPMR; - - MotorSpeed result; - - result.M0 = (motor[0][0]); - result.M1 = (motor[1][0]); - result.M2 = (motor[2][0]); - result.M3 = (motor[3][0]); - - return result; -} - -MotorSpeed Controller::calcSimul(RobotSpeed rs) -{ - double motor[4][1],rotate[4][3],speed[3][1]; + Vector2D RotLinearSpeed; + RotLinearSpeed.x = rs.VX * cos(ci.cur_pos.dir) + rs.VY * sin(ci.cur_pos.dir); + RotLinearSpeed.y = -rs.VX * sin(ci.cur_pos.dir) + rs.VY * cos(ci.cur_pos.dir); - speed[0][0] = rs.VX; - speed[1][0] = rs.VY; - speed[2][0] = rs.VW; + speed[0][0] = RotLinearSpeed.x/10; + speed[1][0] = RotLinearSpeed.y/10; + speed[2][0] = rs.VW/10; rotate[0][0] = sin(M_PI / 3);//-sin(rangle - M_PI / 3); rotate[1][0] = sin(3 * M_PI / 4);//-sin(rangle + M_PI / 3); diff --git a/src/output/controller.h b/src/output/controller.h index 4193952..5062fd5 100755 --- a/src/output/controller.h +++ b/src/output/controller.h @@ -18,11 +18,7 @@ class Controller : public QObject QTime timer; RobotSpeed calcRobotSpeed_main(ControllerInput &ci); - RobotSpeed calcRobotSpeed_adjt(ControllerInput &ci); - RobotSpeed calcRobotSpeed_test(ControllerInput &ci); - - MotorSpeed calcReal(RobotSpeed rs); - MotorSpeed calcSimul(RobotSpeed rs); + MotorSpeed calcSimul(RobotSpeed rs, ControllerInput &ci); private: @@ -38,6 +34,14 @@ class Controller : public QObject double wu1,wu1_last,wintegral,werr0,werr1; double wderived0,wderived1; + + ///////////////////////////////////////////////////////////////new controller + double wp,wi,wd; + Vector2D p,i,d,i_near,i_far; + int fault_counter; + /////////////////////////////////////////////////////////////// + + int stateCTRL; ofstream out; diff --git a/src/output/controller_struct.h b/src/output/controller_struct.h index f0a68e5..3f585d1 100755 --- a/src/output/controller_struct.h +++ b/src/output/controller_struct.h @@ -17,6 +17,7 @@ struct ControllerInput int id; Position cur_pos; Position cur_vel; + Position last_vel; Position mid_pos; Position mid_vel; diff --git a/src/output/wpacket.cpp b/src/output/wpacket.cpp index 17f98c7..e98a235 100755 --- a/src/output/wpacket.cpp +++ b/src/output/wpacket.cpp @@ -22,11 +22,14 @@ QByteArray WPacket::GetPacket() for(int i=0; i<_rdata.size(); i++) { - _rdata[i].M0 = qToBigEndian(_rdata[i].M0); - _rdata[i].M1 = qToBigEndian(_rdata[i].M1); - _rdata[i].M2 = qToBigEndian(_rdata[i].M2); - _rdata[i].M3 = qToBigEndian(_rdata[i].M3); - rd.append((const char*)&(_rdata[i]), 11); //sizeof(RobotData); + _rdata[i].Vx_sp = qToBigEndian(_rdata[i].Vx_sp); + _rdata[i].Vy_sp = qToBigEndian(_rdata[i].Vy_sp); + _rdata[i].Wr_sp = qToBigEndian(_rdata[i].Wr_sp); + _rdata[i].Vx = qToBigEndian(_rdata[i].Vx); + _rdata[i].Vy = qToBigEndian(_rdata[i].Vy); + _rdata[i].Wr = qToBigEndian(_rdata[i].Wr); + _rdata[i].alpha = qToBigEndian(_rdata[i].alpha); + rd.append((const char*)&(_rdata[i]), 18); //sizeof(RobotData); } unsigned char checksum=0; diff --git a/src/output/wpacket.h b/src/output/wpacket.h index c0be0d0..236d775 100755 --- a/src/output/wpacket.h +++ b/src/output/wpacket.h @@ -29,6 +29,16 @@ struct SendPacketHeader struct RobotData { unsigned char RID; // robot id + signed short int Vx_sp; + signed short int Vy_sp; + signed short int Wr_sp; + signed short int Vx; + signed short int Vy; + signed short int Wr; + signed short int alpha; + unsigned char KICK; // kick options + unsigned char CHIP; // CHIP & SPIN #SCCCCCCC + unsigned char SPIN; signed short int M0; // motor 1 signed short int M1; // motor 2 signed short int M2; // motor 3 @@ -38,12 +48,16 @@ struct RobotData RobotData() : RID(0xFF), - M0(0), - M1(0), - M2(0), - M3(0), - KCK(0), - CHP(0) + Vx_sp(0), + Vy_sp(0), + Wr_sp(0), + Vx(0), + Vy(0), + Wr(0), + alpha(0), + KICK(0), + CHIP(0), + SPIN(0) { } }; #pragma pack(pop) /* restore original alignment from stack */ diff --git a/src/ssl/mobileobject.cpp b/src/ssl/mobileobject.cpp index 34d0c31..85a9def 100755 --- a/src/ssl/mobileobject.cpp +++ b/src/ssl/mobileobject.cpp @@ -8,7 +8,7 @@ MobileObject::MobileObject() : isValid = false; connect(&timer_seen, SIGNAL(timeout()), this, SLOT(timer_seen_timeout())); connect(&timer_vel, SIGNAL(timeout()), this, SLOT(timer_vel_timeout())); - timer_seen_interval = 500; + timer_seen_interval = 100; timer_vel_interval = 40; for(int i=0; i M_PI) dir_dif = dir_dif - dir_dif/fabs(dir_dif)*M_PI*2; + vel.dir = (dir_dif) / (time - last.time ) *1000 ; pos_predicted.loc = pos.loc + vel.loc * (time - last.time); pos_predicted.dir = pos.dir + vel.dir * (time - last.time); diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 13bd469..214cfeb 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -40,7 +40,7 @@ - 0 + 1 @@ -820,6 +820,9 @@ 11 + + debug points for ai + Debug Points From 01f15c6265cd436fd7e718aca8b5f9547a609de0 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Wed, 21 Dec 2016 17:32:52 +0330 Subject: [PATCH 05/15] test --- config/settings.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings.ini b/config/settings.ini index 613681a..f971117 100644 --- a/config/settings.ini +++ b/config/settings.ini @@ -1,7 +1,7 @@ ; KN2C SSL Configuration File [Game] -Mode=Simulation;Real; +Mode=Real;Simulation; [Team] Color =Blue;Yellow; Side =Left;Right; From 22dda836f070c5e6647301ddd56e221a687360be Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sat, 21 Jan 2017 13:17:21 +0330 Subject: [PATCH 06/15] jkh --- src/kn2cssl_new.pro.user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 1496e7f..1f6655f 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId From a803751a0c5eaedc8d7a817fa7f0ea7d334e3395 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sat, 28 Jan 2017 09:11:13 +0330 Subject: [PATCH 07/15] save --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3a71622..4942e13 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ *.dll *.exe -*.pro.user +*.pro.user* build-KN2CSSL-* tmp/* build-* From 873db14357a06c1730e3f97724038aadd16e32a6 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Tue, 31 Jan 2017 17:08:12 +0330 Subject: [PATCH 08/15] ready for real test --- src/ai/play/playtest.cpp | 7 +- src/ai/soccer.cpp | 12 ++-- src/ai/tactic/tactictest.cpp | 126 ++--------------------------------- src/ai/tactic/tactictest.h | 2 + src/kn2cssl_new.pro.user | 2 +- src/output/controller.cpp | 28 ++++---- 6 files changed, 29 insertions(+), 148 deletions(-) diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 5cb3ae3..be41410 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -17,10 +17,5 @@ void PlayTest::initRole() void PlayTest::execute() { -// std::cout << wm->kn->ActiveAgents()[0] << std::endl; -// wm->debug_pos.clear(); -// wm->debug_pos.append(wm->ourRobot[1].pos.loc); -// wm->debug_pos.append(wm->ourRobot[0].pos.loc); - if(wm->ball.vel.loc.length() > 1) - qDebug() << wm->ball.vel.loc.length(); + tactics[5]= tTest; } diff --git a/src/ai/soccer.cpp b/src/ai/soccer.cpp index b24a2af..bcc93a7 100644 --- a/src/ai/soccer.cpp +++ b/src/ai/soccer.cpp @@ -130,12 +130,12 @@ Soccer::Soccer(QObject *parent) : // serial port transmitter transmitter = 0; -// if(gamemode==MODE_REAL) -// { -// transmitter = new Transmitter(serialport, outputbuffer, wm); -// transmitter->Start(); -// wm->isSim = false; -// } + if(gamemode==MODE_REAL) + { + transmitter = new Transmitter(serialport, outputbuffer, wm); + transmitter->Start(); + wm->isSim = false; + } // AI ai = new AI(wm, field,outputbuffer, this); diff --git a/src/ai/tactic/tactictest.cpp b/src/ai/tactic/tactictest.cpp index f78a6d1..f704206 100644 --- a/src/ai/tactic/tactictest.cpp +++ b/src/ai/tactic/tactictest.cpp @@ -22,126 +22,10 @@ RobotCommand TacticTest::getCommand() rc.fin_pos.loc.y = 0; rc.useNav = true; rc.maxSpeed = 3; - qDebug() << wm->ourRobot[2].pos.loc.x <<" - " << wm->ourRobot[2].pos.loc.y; + if(min > wm->ourRobot[5].vel.dir) + min = wm->ourRobot[5].vel.dir; + if(max < wm->ourRobot[5].vel.dir) + max = wm->ourRobot[5].vel.dir; + qDebug() << "robot" << "max" << max << "min" <ourRobot[1].pos.loc.x; -// if(std::abs(wm->ourRobot[0].pos.loc.x - wm->ourRobot[0].pos.loc.x) < 20){ -// active = false; -// } -// } -// else if((id == 1)&&(firstPos2 == true)&&(active == false)&&(firstPos1 == true)){ -// rc1.fin_pos.loc = Vector2D(-wm->ourRobot[0].pos.loc.x,-1000); -// if(std::abs(wm->ourRobot[1].pos.loc.x - (-wm->ourRobot[0].pos.loc.x)) < 20){ -// active = true; -// } -// } -// if(id == 0) -// return rc0; -// if(id == 1) -// return rc1; - -// */ -// //Step1 -// qDebug() << "fskdfj"; - -// if(!wm->ourRobot[id].isValid) return rc; -//// // wm->debug_pos.clear(); -//// // wm->debug_pos.append(wm->ourRobot[1].pos.loc); -//// // wm->debug_pos.append(wm->ourRobot[0].pos.loc); -//// // Vector2D p2 = Field::ourGoalCenter; -//// // Vector2D p1 = wm->ball.pos.loc; -//// // Segment2D ballViewMidSeg(p2,p1); -//// static double rad = 90; -//// double khata = 0.2; -//// if((id == 0) && (kicked == false)){ -//// Ray2D ray(wm->ourRobot[1].pos.loc,wm->ball.pos.loc); -//// Circle2D cir(wm->ball.pos.loc,rad); -//// Vector2D* v1 = new Vector2D(); -//// Vector2D* v2 = new Vector2D(); -//// cir.intersection(ray,v1,v2); -//// if(v1->dist(wm->ourRobot[1].pos.loc) > v2->dist(wm->ourRobot[1].pos.loc)){ -//// rc.fin_pos.loc = *v1; -//// rc.useNav = true; -//// rc.maxSpeed = 3; -//// Ray2D rayInvert(wm->ball.pos.loc,wm->ourRobot[1].pos.loc); -//// rc.fin_pos.dir = rayInvert.dir().radian(); -//// rc.isBallObs = true; -//// if(wm->ourRobot[0].pos.loc.dist(*v1) < 150){ -//// rc.maxSpeed = 3; -//// rc.isBallObs = false; -//// if(((std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian()) < khata) || -//// (((M_PI*2) - std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian())) < khata)) && (wm->ourRobot[0].pos.loc.dist(wm->ball.pos.loc) < 110)){ -//// rc.kickspeedx = 4; -//// rc.kickspeedz = 1; -//// kicked = true; -//// } -//// } -//// } -//// else{ -//// rc.fin_pos.loc = *v2; -//// rc.useNav = true; -//// rc.maxSpeed = 3; -//// rc.isBallObs = true; -//// if(wm->ourRobot[0].pos.loc.dist(*v2) < 150){ -//// rc.maxSpeed = 3; -//// rc.isBallObs = false; -//// Ray2D rayInvert(wm->ball.pos.loc,wm->ourRobot[1].pos.loc); -//// rc.fin_pos.dir = rayInvert.dir().radian(); -//// double rand = ((double) std::rand() / (RAND_MAX)); -//// std::cout << (wm->ourRobot[0].pos.loc.dir() - rayInvert.dir()).radian() << std::endl; -//// if(((std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian()) < khata) || -//// (((M_PI*2) - std::abs(wm->ourRobot[0].pos.dir - rayInvert.dir().radian())) < khata)) && (wm->ourRobot[0].pos.loc.dist(wm->ball.pos.loc) < 110)){ -//// rc.kickspeedx = 4; -//// rc.kickspeedz = 1; -//// kicked = true; -//// } -//// } -//// } -//// } -//// if((id == 1) && (kicked == true)){ -//// AngleDeg angSefr(0); -//// Line2D ray(wm->ourRobot[1].pos.loc,angSefr); -//// Vector2D jabejaSorat(wm->ball.vel.loc.x - wm->ball.pos.loc.x,wm->ball.vel.loc.y - wm->ball.pos.loc.y); -//// Line2D ray2(wm->ball.pos.loc,jabejaSorat); -//// Vector2D javab = ray.intersection(ray2); -//// rc.fin_pos.loc.x = javab.x; -//// rc.fin_pos.loc.y = javab.y; -//// rc.fin_pos.dir = (*(new Ray2D(wm->oppRobot[1].pos.loc,Field::ourGoalCenter))).dir().radian(); -//// rc.maxSpeed = 6; -//// rc.useNav = true; -//// if(wm->ourRobot[1].pos.loc.dist(wm->ball.pos.loc) < 700) -//// kicked = false; -//// } -//// if((id == 1) && (kicked == false)){ -//// rc.fin_pos.loc.x = wm->ourRobot[1].pos.loc.x; -//// rc.fin_pos.loc.y = wm->ourRobot[1].pos.loc.y; -//// } -//// if((id == 0) && (kicked == true)){ -//// rc.fin_pos.loc.x = wm->ourRobot[0].pos.loc.x; -//// rc.fin_pos.loc.y = wm->ourRobot[0].pos.loc.y; -//// } -// rc.fin_pos.loc.x = -2800; -// rc.fin_pos.loc.y = 0; -// rc.useNav = true; -// rc.maxSpeed = 2; -// qDebug()<<"i am here"; -// return rc; } diff --git a/src/ai/tactic/tactictest.h b/src/ai/tactic/tactictest.h index b5e16fb..cb28c20 100644 --- a/src/ai/tactic/tactictest.h +++ b/src/ai/tactic/tactictest.h @@ -8,6 +8,8 @@ class TacticTest : public Tactic Vector2D* finalPos; Q_OBJECT public: + int max = -10; + int min = 10; static bool kicked; explicit TacticTest(WorldModel *worldmodel, QObject *parent = 0); virtual RobotCommand getCommand(); diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 1f6655f..0067fcb 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/output/controller.cpp b/src/output/controller.cpp index 0b5dfda..f05fc3a 100755 --- a/src/output/controller.cpp +++ b/src/output/controller.cpp @@ -61,24 +61,24 @@ RobotSpeed Controller::calcRobotSpeed_main(ControllerInput &ci) // //! Test - if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400,-2000)).r()) < 1000 ) - //if(ci.cur_pos.loc.x > -1000) - wu1=0; - if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400, 2000)).r()) < 1000 ) - //if(ci.cur_pos.loc.x < -3800) - wu1=1; +// if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400,-2000)).r()) < 1000 ) +// //if(ci.cur_pos.loc.x > -1000) +// wu1=0; +// if(fabs(Vector2D(ci.cur_pos.loc-Vector2D( 2400, 2000)).r()) < 1000 ) +// //if(ci.cur_pos.loc.x < -3800) +// wu1=1; - ci.mid_pos.loc.x = 2400; - ci.mid_pos.dir = M_PI; +// ci.mid_pos.loc.x = 2400; +// ci.mid_pos.dir = M_PI; - if(wu1==0) - ci.mid_pos.loc.y = 2860; - //setpoint.VX = -2; - else - //setpoint.VX = 2; - ci.mid_pos.loc.y = -2860; +// if(wu1==0) +// ci.mid_pos.loc.y = 2860; +// //setpoint.VX = -2; +// else +// //setpoint.VX = 2; +// ci.mid_pos.loc.y = -2860; // //! test From 3a5edcf3ad7f50d7e1e75c357a8cfdd8b0e375b6 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Tue, 31 Jan 2017 19:59:10 +0330 Subject: [PATCH 09/15] debug vision --- src/ai/soccer.cpp | 4 +- src/ai/soccer.h | 3 +- src/kn2cssl_new.pro | 4 - src/kn2cssl_new.pro.user | 2 +- src/ssl/sslvision.cpp | 221 +++++++++++++++++++++++++++++++++++ src/ssl/sslvision.h | 11 +- src/ssl/sslvision_double.cpp | 161 ------------------------- src/ssl/sslvision_double.h | 54 --------- src/ssl/sslvision_single.cpp | 129 -------------------- src/ssl/sslvision_single.h | 51 -------- 10 files changed, 232 insertions(+), 408 deletions(-) delete mode 100644 src/ssl/sslvision_double.cpp delete mode 100644 src/ssl/sslvision_double.h delete mode 100644 src/ssl/sslvision_single.cpp delete mode 100644 src/ssl/sslvision_single.h diff --git a/src/ai/soccer.cpp b/src/ai/soccer.cpp index bcc93a7..e54c025 100644 --- a/src/ai/soccer.cpp +++ b/src/ai/soccer.cpp @@ -64,9 +64,7 @@ Soccer::Soccer(QObject *parent) : wm->ourColor = tcolor; MapSearchNode::wm = wm; if( field == "Double" ) - sslvision = new SSLVision_Double(vip, vport, tcolor, tside, tcam, wm); - else - sslvision = new SSLVision_Single(vip, vport, tcolor, tside, tcam, wm); + sslvision = new SSLVision(vip, vport, tcolor, tside, tcam, wm); sslvision->Start(); diff --git a/src/ai/soccer.h b/src/ai/soccer.h index 8bb5139..f45b7ff 100644 --- a/src/ai/soccer.h +++ b/src/ai/soccer.h @@ -13,8 +13,7 @@ #include "worldmodel.h" #include "sslrefbox.h" #include "sslrefboxnew.h" -#include "sslvision_single.h" -#include "sslvision_double.h" +#include "sslvision.h" #include "wpacket.h" #include "grsim.h" #include "outputbuffer.h" diff --git a/src/kn2cssl_new.pro b/src/kn2cssl_new.pro index d56e284..1daa181 100644 --- a/src/kn2cssl_new.pro +++ b/src/kn2cssl_new.pro @@ -174,8 +174,6 @@ SOURCES += main.cpp \ ai/play/freeKicks/freekick11.cpp \ ai/play/freeKicks/freekick47.cpp \ etc/constants.cpp \ - ssl/sslvision_single.cpp \ - ssl/sslvision_double.cpp \ ai/skill.cpp \ ai/skill/skillkick.cpp \ ai/skill/skilltest.cpp \ @@ -324,8 +322,6 @@ HEADERS += \ ai/play/freeKicks/freekick10.h \ ai/play/freeKicks/freekick11.h \ ai/play/freeKicks/freekick47.h \ - ssl/sslvision_single.h \ - ssl/sslvision_double.h \ ai/skill.h \ ai/skill/skillkick.h \ ai/Skills.h \ diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 0067fcb..baaf9fc 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/ssl/sslvision.cpp b/src/ssl/sslvision.cpp index b2c810f..0a75d95 100644 --- a/src/ssl/sslvision.cpp +++ b/src/ssl/sslvision.cpp @@ -106,3 +106,224 @@ void SSLVision::logResponder() // parse detection frame parseLog(pck); } +int SSLVision::getFPS(int c) +{ + return (c % CAMERA_NUM); +} + +void SSLVision::parse(SSL_DetectionFrame &pck) +{ + // update camera fps + int cid = pck.camera_id() % CAMERA_NUM; + _fpscam[cid].Pulse(); + + // update vision frame + //_vframe[cid].frame_number = pck.frame_number(); + + vector pt; + + // Team side Coefficient + float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; + qDebug() << "capture" << pck.t_capture()*1000 - time; + time = pck.t_capture()*1000; + + // insert balls + int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); + for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) +// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) + { + Position tp; + tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); + pt.push_back(tp); + } + } + _wm->ball.seenAt(pt, time, cid); + + if(_color == COLOR_BLUE) + { + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->ourRobot[rid].seenAt(pt, time, cid); + } + } + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->oppRobot[rid].seenAt(pt, time, cid); + } + } + } + else + { + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->ourRobot[rid].seenAt(pt, time, cid); + } + } + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->oppRobot[rid].seenAt(pt, time, cid); + } + } + } +} + +void SSLVision::parseLog(SSL_DetectionFrame &pck) +{ + // update camera fps + int cid = pck.camera_id(); + + switch(_camera) + { + case CAMERA_ALL: + break; + case CAMERA_0: + if (cid==1 || cid==2 || cid==3) return; + break; + case CAMERA_1: + if (cid==0 || cid==2 || cid==3) return; + break; + case CAMERA_2: + if (cid==0 || cid==1 || cid==3) return; + break; + case CAMERA_3: + if (cid==0 || cid==1 || cid==2) return; + break; + case CAMERA_BOTH_L: + if (cid==2 || cid==3) return; + break; + case CAMERA_BOTH_R: + if (cid==0 || cid==1) return; + break; + case CAMERA_NONE: + default: + return; + } + + // update vision frame + //_vframe[cid].frame_number = pck.frame_number(); + + vector pt; + + // Team side Coefficient + float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; + double time = _time.elapsed(); //pck.t_capture(); + + // insert balls + int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); + for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) +// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) + { + Position tp; + tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); + pt.push_back(tp); + } + } + _wm->ball.seenAt(pt, time, cid); + + if(_color == COLOR_BLUE) + { + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->ourRobot[rid].seenAt(pt, time, cid); + } + } + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->oppRobot[rid].seenAt(pt, time, cid); + } + } + } + else + { + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->ourRobot[rid].seenAt(pt, time, cid); + } + } + for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; + pt.push_back(tp); + _wm->oppRobot[rid].seenAt(pt, time, cid); + } + } + } +} diff --git a/src/ssl/sslvision.h b/src/ssl/sslvision.h index 600e40b..abe1fcb 100644 --- a/src/ssl/sslvision.h +++ b/src/ssl/sslvision.h @@ -19,7 +19,7 @@ class SSLVision : public SSLReceiver public: explicit SSLVision(QString ip, int port, TeamColorType color, TeamSideType side, CameraConfigType camera, WorldModel *wm, QObject *parent = 0); - virtual int getFPS(int c) = 0; + int getFPS(int c); void startRecording(); Vision_log stopRecording(); void startPlaying(); @@ -28,8 +28,13 @@ class SSLVision : public SSLReceiver void loadPlaying(Vision_log logs); int logLength(); void setLogFrame(int msec); + double time; protected: + vector balls; + std::vector ourRobots[PLAYERS_MAX_NUM]; + std::vector oppRobots[PLAYERS_MAX_NUM]; + FPSCounter _fpscam[CAMERA_NUM]; QTime _time; TeamColorType _color; TeamSideType _side; @@ -37,8 +42,8 @@ class SSLVision : public SSLReceiver WorldModel *_wm; Vision_logPlayer *logplayer; - virtual void parse(SSL_DetectionFrame &pck) = 0; - virtual void parseLog(SSL_DetectionFrame &pck) = 0; + virtual void parse(SSL_DetectionFrame &pck); + virtual void parseLog(SSL_DetectionFrame &pck); private slots: void readPendingPacket(QByteArray data, QString ip, int port); diff --git a/src/ssl/sslvision_double.cpp b/src/ssl/sslvision_double.cpp deleted file mode 100644 index 5d7adc0..0000000 --- a/src/ssl/sslvision_double.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#include "sslvision_double.h" - -SSLVision_Double::SSLVision_Double(QString ip, int port, TeamColorType color, TeamSideType side, CameraConfigType camera, WorldModel *wm, QObject *parent) : - SSLVision(ip,port,color,side,camera,wm,parent), - _fpscam0(parent), - _fpscam1(parent), - _fpscam2(parent), - _fpscam3(parent) -{ -} - -int SSLVision_Double::getFPS(int c) -{ - if(c == 0) return _fpscam0.FPS(); - if(c == 1) return _fpscam1.FPS(); - if(c == 2) return _fpscam2.FPS(); - if(c == 3) return _fpscam3.FPS(); - return 0; -} - -void SSLVision_Double::parse(SSL_DetectionFrame &pck) -{ - // update camera fps - int cid = pck.camera_id(); - if(cid == 0) _fpscam0.Pulse(); - if(cid == 1) _fpscam1.Pulse(); - if(cid == 2) _fpscam2.Pulse(); - if(cid == 3) _fpscam3.Pulse(); - - switch(_camera) - { - case CAMERA_ALL: - break; - case CAMERA_0: - if (cid==1 || cid==2 || cid==3) return; - break; - case CAMERA_1: - if (cid==0 || cid==2 || cid==3) return; - break; - case CAMERA_2: - if (cid==0 || cid==1 || cid==3) return; - break; - case CAMERA_3: - if (cid==0 || cid==1 || cid==2) return; - break; - case CAMERA_BOTH_L: - if (cid==2 || cid==3) return; - break; - case CAMERA_BOTH_R: - if (cid==0 || cid==1) return; - break; - case CAMERA_NONE: - default: - return; - } - - // update vision frame - //_vframe[cid].frame_number = pck.frame_number(); - - vector pt; - - // Team side Coefficient - float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - double time = _time.elapsed(); //pck.t_capture(); - - // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) -// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } - } - _wm->ball.seenAt(pt, time, cid); - - if(_color == COLOR_BLUE) - { - APPEND_ROBOTS_DOUBLE(blue, our); - APPEND_ROBOTS_DOUBLE(yellow, opp); - } - else // _color == COLOR_YELLOW - { - APPEND_ROBOTS_DOUBLE(yellow, our); - APPEND_ROBOTS_DOUBLE(blue, opp); - } -} - -void SSLVision_Double::parseLog(SSL_DetectionFrame &pck) -{ - // update camera fps - int cid = pck.camera_id(); - - switch(_camera) - { - case CAMERA_ALL: - break; - case CAMERA_0: - if (cid==1 || cid==2 || cid==3) return; - break; - case CAMERA_1: - if (cid==0 || cid==2 || cid==3) return; - break; - case CAMERA_2: - if (cid==0 || cid==1 || cid==3) return; - break; - case CAMERA_3: - if (cid==0 || cid==1 || cid==2) return; - break; - case CAMERA_BOTH_L: - if (cid==2 || cid==3) return; - break; - case CAMERA_BOTH_R: - if (cid==0 || cid==1) return; - break; - case CAMERA_NONE: - default: - return; - } - - // update vision frame - //_vframe[cid].frame_number = pck.frame_number(); - - vector pt; - - // Team side Coefficient - float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - double time = _time.elapsed(); //pck.t_capture(); - - // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) -// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } - } - _wm->ball.seenAt(pt, time, cid); - - if(_color == COLOR_BLUE) - { - APPEND_ROBOTS_DOUBLE(blue, our); - APPEND_ROBOTS_DOUBLE(yellow, opp); - } - else // _color == COLOR_YELLOW - { - APPEND_ROBOTS_DOUBLE(yellow, our); - APPEND_ROBOTS_DOUBLE(blue, opp); - } -} diff --git a/src/ssl/sslvision_double.h b/src/ssl/sslvision_double.h deleted file mode 100644 index 0b95fd4..0000000 --- a/src/ssl/sslvision_double.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef SSLVISION_DOUBLE_H -#define SSLVISION_DOUBLE_H - -#include -#include - -#include "proto/messages_robocup_ssl_wrapper.pb.h" -#include "base.h" -#include "constants.h" -#include "sslvision.h" -#include "geom.h" -#include "util.h" -#include "worldmodel.h" - -class SSLVision_Double : public SSLVision -{ - Q_OBJECT - -public: - explicit SSLVision_Double(QString ip, int port, TeamColorType color, TeamSideType side, CameraConfigType camera, WorldModel *wm, QObject *parent = 0); - virtual int getFPS(int c); - -private: - FPSCounter _fpscam0; - FPSCounter _fpscam1; - FPSCounter _fpscam2; - FPSCounter _fpscam3; - - virtual void parse(SSL_DetectionFrame &pck); - virtual void parseLog(SSL_DetectionFrame &pck); - -}; - - -//*180.0f/M_PI+(1.0-ourSide)*90.0f,rid)); - -#define APPEND_ROBOTS_DOUBLE(__COLOR__,__TEAM__) \ -for (int i=0; iMIN_CONF)&&(fabs(pck.robots_##__COLOR__(i).x())600*/)&&(fabs(pck.robots_##__COLOR__(i).y())M_PI) tp.dir -= M_2PI; \ - pt.push_back(tp); \ - _wm->__TEAM__##Robot[rid].seenAt(pt, time, cid); \ - } \ -} - - -#endif // SSLVISION_H diff --git a/src/ssl/sslvision_single.cpp b/src/ssl/sslvision_single.cpp deleted file mode 100644 index 72448aa..0000000 --- a/src/ssl/sslvision_single.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "sslvision_single.h" - -SSLVision_Single::SSLVision_Single(QString ip, int port, TeamColorType color, TeamSideType side, CameraConfigType camera, WorldModel *wm, QObject *parent) : - SSLVision(ip,port,color,side,camera,wm,parent), - _fpscam0(parent), - _fpscam1(parent) -{ -} - -int SSLVision_Single::getFPS(int c) -{ - if(c == 0) return _fpscam0.FPS(); - if(c == 1) return _fpscam1.FPS(); - return 0; -} - -void SSLVision_Single::parse(SSL_DetectionFrame &pck) -{ - // update camera fps - int cid = pck.camera_id(); - if(cid == 0) _fpscam0.Pulse(); - if(cid == 1) _fpscam1.Pulse(); - - switch(_camera) - { - case CAMERA_ALL: - break; - case CAMERA_0: - if (cid==1) return; - break; - case CAMERA_1: - if (cid==0) return; - break; - case CAMERA_NONE: - default: - return; - } - - // update vision frame - //_vframe[cid].frame_number = pck.frame_number(); - - vector pt; - - // Team side Coefficient - float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - double time = _time.elapsed(); //pck.t_capture(); - - // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_SINGLE_MAX_X && fabs(b.y()) < FIELD_SINGLE_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } - } - _wm->ball.seenAt(pt, time, cid); - - if(_color == COLOR_BLUE) - { - APPEND_ROBOTS_SINGLE(blue, our); - APPEND_ROBOTS_SINGLE(yellow, opp); - } - else // _color == COLOR_YELLOW - { - APPEND_ROBOTS_SINGLE(yellow, our); - APPEND_ROBOTS_SINGLE(blue, opp); - } -} - -void SSLVision_Single::parseLog(SSL_DetectionFrame &pck) -{ - // update camera fps - int cid = pck.camera_id(); - - switch(_camera) - { - case CAMERA_ALL: - break; - case CAMERA_0: - if (cid==1) return; - break; - case CAMERA_1: - if (cid==0) return; - break; - case CAMERA_NONE: - default: - return; - } - - // update vision frame - //_vframe[cid].frame_number = pck.frame_number(); - - vector pt; - - // Team side Coefficient - float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - double time = _time.elapsed(); //pck.t_capture(); - - // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_SINGLE_MAX_X && fabs(b.y()) < FIELD_SINGLE_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } - } - _wm->ball.seenAt(pt, time, cid); - - if(_color == COLOR_BLUE) - { - APPEND_ROBOTS_SINGLE(blue, our); - APPEND_ROBOTS_SINGLE(yellow, opp); - } - else // _color == COLOR_YELLOW - { - APPEND_ROBOTS_SINGLE(yellow, our); - APPEND_ROBOTS_SINGLE(blue, opp); - } -} diff --git a/src/ssl/sslvision_single.h b/src/ssl/sslvision_single.h deleted file mode 100644 index 5880591..0000000 --- a/src/ssl/sslvision_single.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SSLVISION_SINGLE_H -#define SSLVISION_SINGLE_H - -#include -#include - -#include "proto/messages_robocup_ssl_wrapper_legacy.pb.h" -#include "base.h" -#include "constants.h" -#include "sslvision.h" -#include "geom.h" -#include "util.h" -#include "worldmodel.h" - -class SSLVision_Single : public SSLVision -{ - Q_OBJECT - -public: - explicit SSLVision_Single(QString ip, int port, TeamColorType color, TeamSideType side, CameraConfigType camera, WorldModel *wm, QObject *parent = 0); - virtual int getFPS(int c); - -private: - FPSCounter _fpscam0; - FPSCounter _fpscam1; - - virtual void parse(SSL_DetectionFrame &pck); - virtual void parseLog(SSL_DetectionFrame &pck); -}; - - -//*180.0f/M_PI+(1.0-ourSide)*90.0f,rid)); - -#define APPEND_ROBOTS_SINGLE(__COLOR__,__TEAM__) \ -for (int i=0; iMIN_CONF)&&(fabs(pck.robots_##__COLOR__(i).x())M_PI) tp.dir -= M_2PI; \ - pt.push_back(tp); \ - _wm->__TEAM__##Robot[rid].seenAt(pt, time, cid); \ - } \ -} - - -#endif // SSLVISION_H From 1c947ef96e34aeeae2156d626bd358f2ef8974cb Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Tue, 31 Jan 2017 20:01:03 +0330 Subject: [PATCH 10/15] save --- src/kn2cssl_new.pro.user.18 | 271 ------------------------------------ 1 file changed, 271 deletions(-) delete mode 100644 src/kn2cssl_new.pro.user.18 diff --git a/src/kn2cssl_new.pro.user.18 b/src/kn2cssl_new.pro.user.18 deleted file mode 100644 index ac465c8..0000000 --- a/src/kn2cssl_new.pro.user.18 +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - EnvironmentId - {ef07ef72-173d-42d4-81ff-ba5650ee6fde} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.5.0 GCC 64bit - Desktop Qt 5.5.0 GCC 64bit - qt.55.gcc_64_kit - 0 - 0 - 0 - - /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_5_0_GCC_64bit-Debug - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - -j4 -l4 - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - true - - - /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_5_0_GCC_64bit-Release - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 2 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy locally - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - kn2cssl_new - - Qt4ProjectManager.Qt4RunConfiguration:/home/jafar/kn2cPrograms/src/kn2cssl_new.pro - - kn2cssl_new.pro - false - false - - 3768 - false - true - false - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 18 - - - Version - 18 - - From 1c1f9d674d79ca592bb8e54d87598875fd303889 Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Tue, 31 Jan 2017 20:01:35 +0330 Subject: [PATCH 11/15] save --- src/kn2cssl_new.pro.user.3.2-pre1 | 260 ------------------------------ 1 file changed, 260 deletions(-) delete mode 100644 src/kn2cssl_new.pro.user.3.2-pre1 diff --git a/src/kn2cssl_new.pro.user.3.2-pre1 b/src/kn2cssl_new.pro.user.3.2-pre1 deleted file mode 100644 index 38ef00a..0000000 --- a/src/kn2cssl_new.pro.user.3.2-pre1 +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - true - 1 - true - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.2.1 GCC 64bit - Desktop Qt 5.2.1 GCC 64bit - qt.521.gcc_64.essentials_kit - 0 - 0 - 0 - - /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_2_1_GCC_64bit-Debug - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - -j4 -l4 - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - true - - - /home/jafar/kn2cPrograms/build-kn2cssl_new-Desktop_Qt_5_2_1_GCC_64bit-Release - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 2 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy locally - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - kn2cssl_new - - Qt4ProjectManager.Qt4RunConfiguration:/home/jafar/kn2cPrograms/src/kn2cssl_new.pro - - kn2cssl_new.pro - false - false - - 3768 - true - false - false - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.EnvironmentId - {ef07ef72-173d-42d4-81ff-ba5650ee6fde} - - - ProjectExplorer.Project.Updater.FileVersion - 15 - - From 3a90bbb7377cea85da15ee0ceb15d8a2eef2cbaa Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Wed, 1 Feb 2017 20:32:30 +0330 Subject: [PATCH 12/15] save vision --- src/kn2cssl_new.pro.user | 2 +- src/ssl/ball.cpp | 15 ++- src/ssl/ball.h | 4 +- src/ssl/mobileobject.h | 3 +- src/ssl/robot.cpp | 15 +-- src/ssl/robot.h | 2 +- src/ssl/sslvision.cpp | 228 +++++++++------------------------------ src/ssl/sslvision.h | 4 +- 8 files changed, 71 insertions(+), 202 deletions(-) diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index baaf9fc..449fcee 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/ssl/ball.cpp b/src/ssl/ball.cpp index e9eab54..2c6a250 100644 --- a/src/ssl/ball.cpp +++ b/src/ssl/ball.cpp @@ -6,7 +6,7 @@ Ball::Ball() : { } -void Ball::seenAt(vector p, double t, int c) +void Ball::seenAt(vector p) { if(p.size()<1) return; @@ -14,16 +14,16 @@ void Ball::seenAt(vector p, double t, int c) timer_seen.start(timer_seen_interval); //restart PositionTimeCamera ans; - ans.time = t; - ans.camera = c; + ans.time = p[0].time; + ans.camera = p[0].camera; Vector2D buff; int min_i = 0; - buff = p[min_i].loc - pos_predicted.loc ; + buff = p[min_i].pos.loc - pos_predicted.loc ; double min_d = buff.length(); for(size_t i=0; i < p.size(); i++) { - buff = p[i].loc - pos_predicted.loc ; + buff = p[i].pos.loc - pos_predicted.loc ; double d = buff.length(); if(d < min_d) { @@ -32,9 +32,8 @@ void Ball::seenAt(vector p, double t, int c) } } - ans.pos.loc = p[min_i].loc; - ans.pos.dir = p[min_i].dir; - + ans.pos.loc = p[min_i].pos.loc; + ans.pos.dir = p[min_i].pos.dir; if (camera_mem == ans.camera || camera_mem == NO_CAMERA ) { diff --git a/src/ssl/ball.h b/src/ssl/ball.h index 93fffa5..8fd2064 100644 --- a/src/ssl/ball.h +++ b/src/ssl/ball.h @@ -9,9 +9,7 @@ class Ball : public MobileObject public: explicit Ball(); - virtual void seenAt(vector p, double t, int c); - - + virtual void seenAt(vector p); }; #endif // BALL_H diff --git a/src/ssl/mobileobject.h b/src/ssl/mobileobject.h index d7ee9f8..8408cc3 100644 --- a/src/ssl/mobileobject.h +++ b/src/ssl/mobileobject.h @@ -17,6 +17,7 @@ struct PositionTimeCamera double time; int camera; + double confidence; PositionTimeCamera() { time = 0; @@ -30,7 +31,7 @@ class MobileObject : public QObject public: explicit MobileObject(); - virtual void seenAt(vector p, double t, int c) = 0; + virtual void seenAt(vector) = 0; bool isValid; diff --git a/src/ssl/robot.cpp b/src/ssl/robot.cpp index 32b727a..198ba97 100644 --- a/src/ssl/robot.cpp +++ b/src/ssl/robot.cpp @@ -6,23 +6,24 @@ Robot::Robot() : { } -void Robot::seenAt(vector p, double t, int c) +void Robot::seenAt(vector p) { if(p.size()<1) return; // isValid = true; timer_seen.start(timer_seen_interval); //restart PositionTimeCamera ans; - ans.time = t; - ans.camera = c; + ans.time = p[0].time; + ans.camera = p[0].camera; Vector2D buff; int min_i = 0; - buff = p[min_i].loc - pos_predicted.loc ; + qDebug() << "posotion" << pos.loc.x; + buff = p[min_i].pos.loc - pos_predicted.loc ; double min_d = buff.length(); for(size_t i=0; i < p.size(); i++) { - buff = p[i].loc - pos_predicted.loc ; + buff = p[i].pos.loc - pos_predicted.loc ; double d = buff.length(); if(d < min_d) { @@ -31,8 +32,8 @@ void Robot::seenAt(vector p, double t, int c) } } - ans.pos.loc = p[min_i].loc; - ans.pos.dir = p[min_i].dir; + ans.pos.loc = p[min_i].pos.loc; + ans.pos.dir = p[min_i].pos.dir; if (camera_mem == ans.camera || camera_mem == NO_CAMERA ) { diff --git a/src/ssl/robot.h b/src/ssl/robot.h index 7011e80..61942ef 100644 --- a/src/ssl/robot.h +++ b/src/ssl/robot.h @@ -12,7 +12,7 @@ class Robot : public MobileObject public: Robot(); - virtual void seenAt(vector p, double t, int c); + virtual void seenAt(vector p); }; #endif // ROBOT_H diff --git a/src/ssl/sslvision.cpp b/src/ssl/sslvision.cpp index 0a75d95..9fe8c05 100644 --- a/src/ssl/sslvision.cpp +++ b/src/ssl/sslvision.cpp @@ -9,7 +9,6 @@ SSLVision::SSLVision(QString ip, int port, TeamColorType color, TeamSideType sid { qRegisterMetaType("SSL_WrapperPacket"); - _time.start(); connect(this, SIGNAL(newReceivedPacket(QByteArray,QString,int)), this, SLOT(readPendingPacket(QByteArray,QString,int)),Qt::DirectConnection); logplayer = new Vision_logPlayer(); @@ -114,216 +113,87 @@ int SSLVision::getFPS(int c) void SSLVision::parse(SSL_DetectionFrame &pck) { // update camera fps - int cid = pck.camera_id() % CAMERA_NUM; - _fpscam[cid].Pulse(); + int CamId = pck.camera_id() % CAMERA_NUM; + _fpscam[CamId].Pulse(); // update vision frame //_vframe[cid].frame_number = pck.frame_number(); - vector pt; - // Team side Coefficient float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - qDebug() << "capture" << pck.t_capture()*1000 - time; time = pck.t_capture()*1000; // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) -// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } + PositionTimeCamera point; + point.pos.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); + point.confidence = b.confidence(); + point.camera = CamId; + point.time = time; + balls.push_back(point); } - _wm->ball.seenAt(pt, time, cid); if(_color == COLOR_BLUE) { - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->ourRobot[rid].seenAt(pt, time, cid); - } + int robotId = pck.robots_blue(i).robot_id(); + addRobot(pck.robots_blue(i),robotId,false,time,CamId); } - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->oppRobot[rid].seenAt(pt, time, cid); - } + int robotId = pck.robots_blue(i).robot_id(); + addRobot(pck.robots_yellow(i),robotId,true,time,CamId); } } else { - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->ourRobot[rid].seenAt(pt, time, cid); - } + int robotId = pck.robots_blue(i).robot_id(); + addRobot(pck.robots_yellow(i),robotId,false,time,CamId); } - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->oppRobot[rid].seenAt(pt, time, cid); - } + int robotId = pck.robots_blue(i).robot_id(); + addRobot(pck.robots_blue(i),robotId,true,time,CamId); + } + } + + checkCameras[CamId] = true; + if((checkCameras[1] & checkCameras[2]) == true && time > 4){ + for(int i = 0 ; i < 5 ; i++) + checkCameras[i] = false; + _wm->ball.seenAt(balls); + qDebug() << "i am here"; + balls.clear(); + for (int i = 0; i < PLAYERS_MAX_NUM; ++i) { + _wm->ourRobot[i].seenAt(ourRobots[i]); + _wm->oppRobot[i].seenAt(oppRobots[i]); + ourRobots[i].clear(); + oppRobots[i].clear(); } } } void SSLVision::parseLog(SSL_DetectionFrame &pck) { - // update camera fps - int cid = pck.camera_id(); - - switch(_camera) - { - case CAMERA_ALL: - break; - case CAMERA_0: - if (cid==1 || cid==2 || cid==3) return; - break; - case CAMERA_1: - if (cid==0 || cid==2 || cid==3) return; - break; - case CAMERA_2: - if (cid==0 || cid==1 || cid==3) return; - break; - case CAMERA_3: - if (cid==0 || cid==1 || cid==2) return; - break; - case CAMERA_BOTH_L: - if (cid==2 || cid==3) return; - break; - case CAMERA_BOTH_R: - if (cid==0 || cid==1) return; - break; - case CAMERA_NONE: - default: - return; - } - - // update vision frame - //_vframe[cid].frame_number = pck.frame_number(); - - vector pt; +} - // Team side Coefficient +void SSLVision::addRobot(const SSL_DetectionRobot& robot,int id,bool isEnemy,double time,int camera){ float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - double time = _time.elapsed(); //pck.t_capture(); - - // insert balls - int max_balls=min(VOBJ_MAX_NUM, pck.balls_size()); - for(int i=0; i MIN_CONF && fabs(b.x()) < FIELD_DOUBLE_MAX_X && fabs(b.y()) < FIELD_DOUBLE_MAX_Y) -// if(b.confidence() > MIN_CONF && (fabs(b.x()) < FIELD_MAX_X && fabs(b.x()) > 600) && fabs(b.y()) < FIELD_MAX_Y) - { - Position tp; - tp.loc = Vector2D(b.x()*ourSide, b.y()*ourSide); - pt.push_back(tp); - } - } - _wm->ball.seenAt(pt, time, cid); - - if(_color == COLOR_BLUE) - { - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->ourRobot[rid].seenAt(pt, time, cid); - } - } - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->oppRobot[rid].seenAt(pt, time, cid); - } - } - } + PositionTimeCamera point; + point.pos.loc = Vector2D(robot.x()*ourSide, robot.y()*ourSide); + point.pos.dir = robot.orientation()+(1.0 - ourSide)*M_PI_2; + point.confidence = robot.confidence(); + point.camera = camera; + point.time = time; + if(point.pos.dir > M_PI) + point.pos.dir -= M_2PI; + if(isEnemy) + oppRobots[id].push_back(point); else - { - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_yellow(i).x())600*/)&&(fabs(pck.robots_yellow(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->ourRobot[rid].seenAt(pt, time, cid); - } - } - for (int i=0; iMIN_CONF)&&(fabs(pck.robots_blue(i).x())600*/)&&(fabs(pck.robots_blue(i).y())M_PI) tp.dir -= M_2PI; - pt.push_back(tp); - _wm->oppRobot[rid].seenAt(pt, time, cid); - } - } - } + ourRobots[id].push_back(point); } diff --git a/src/ssl/sslvision.h b/src/ssl/sslvision.h index abe1fcb..4185b30 100644 --- a/src/ssl/sslvision.h +++ b/src/ssl/sslvision.h @@ -32,16 +32,16 @@ class SSLVision : public SSLReceiver protected: vector balls; + bool checkCameras[5]; std::vector ourRobots[PLAYERS_MAX_NUM]; std::vector oppRobots[PLAYERS_MAX_NUM]; FPSCounter _fpscam[CAMERA_NUM]; - QTime _time; TeamColorType _color; TeamSideType _side; CameraConfigType _camera; WorldModel *_wm; Vision_logPlayer *logplayer; - + void addRobot(const SSL_DetectionRobot& robot,int id,bool isEnemy,double time,int camera); virtual void parse(SSL_DetectionFrame &pck); virtual void parseLog(SSL_DetectionFrame &pck); From dd7199e63ec33162620b5b5ca7fcaede254a4a3a Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sat, 4 Feb 2017 15:16:06 +0330 Subject: [PATCH 13/15] save --- src/ai/play/playtest.cpp | 2 +- src/kn2cssl_new.pro.user | 2 +- src/ssl/sslvision.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index be41410..9d186dc 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -17,5 +17,5 @@ void PlayTest::initRole() void PlayTest::execute() { - tactics[5]= tTest; + tactics[3]= tTest; } diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 449fcee..f07befd 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/ssl/sslvision.cpp b/src/ssl/sslvision.cpp index 9fe8c05..f049654 100644 --- a/src/ssl/sslvision.cpp +++ b/src/ssl/sslvision.cpp @@ -134,7 +134,7 @@ void SSLVision::parse(SSL_DetectionFrame &pck) point.time = time; balls.push_back(point); } - + //insert robots if(_color == COLOR_BLUE) { for (int i = 0 ; i < pck.robots_blue_size() ; i++) From 6573b25983869908a307ef79a14cc708b85d24aa Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sat, 4 Feb 2017 20:46:36 +0330 Subject: [PATCH 14/15] save --- src/ai/play/playtest.cpp | 4 +- src/ai/play/playtest.h | 1 + src/ai/tactic/tactictest.cpp | 29 +++++++++---- src/ai/tactic/tactictest.h | 1 + src/etc/constants.h | 2 + src/kn2cssl_new.pro.user | 2 +- src/ssl/ball.cpp | 80 ++++++++++++++---------------------- src/ssl/ball.h | 2 + src/ssl/mobileobject.cpp | 34 +++++++++++++-- src/ssl/mobileobject.h | 2 + src/ssl/robot.cpp | 23 ++++++++++- src/ssl/sslvision.cpp | 4 +- src/ssl/sslvision.h | 2 +- 13 files changed, 119 insertions(+), 67 deletions(-) diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 9d186dc..98606ee 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -17,5 +17,7 @@ void PlayTest::initRole() void PlayTest::execute() { - tactics[3]= tTest; + tactics[5]= tTest; + wm->debug_type=2; + wm->debug_pos.append(wm->ourRobot[5].pos.loc); } diff --git a/src/ai/play/playtest.h b/src/ai/play/playtest.h index 6ea392a..5861a98 100644 --- a/src/ai/play/playtest.h +++ b/src/ai/play/playtest.h @@ -11,6 +11,7 @@ class PlayTest : public Play virtual void execute(); virtual void initRole(); virtual int enterCondition(); + int flag=0; private: TacticTest* tTest; TacticTest* tTest2; diff --git a/src/ai/tactic/tactictest.cpp b/src/ai/tactic/tactictest.cpp index f704206..cb24728 100644 --- a/src/ai/tactic/tactictest.cpp +++ b/src/ai/tactic/tactictest.cpp @@ -18,14 +18,25 @@ RobotCommand TacticTest::getCommand() RobotCommand rc; if(!wm->ourRobot[id].isValid) return rc; - rc.fin_pos.loc.x = -3000; - rc.fin_pos.loc.y = 0; - rc.useNav = true; - rc.maxSpeed = 3; - if(min > wm->ourRobot[5].vel.dir) - min = wm->ourRobot[5].vel.dir; - if(max < wm->ourRobot[5].vel.dir) - max = wm->ourRobot[5].vel.dir; - qDebug() << "robot" << "max" << max << "min" <ourRobot[id].pos.loc.dist(v1)<150){ + flag=1; + } + } + else if(flag==1){ + rc.fin_pos.loc=v2; + rc.maxSpeed=4; + rc.useNav=true; + if(wm->ourRobot[id].pos.loc.dist(v2)<150){ + flag=0; + wm->debug_pos.clear(); + } + } return rc; } diff --git a/src/ai/tactic/tactictest.h b/src/ai/tactic/tactictest.h index cb28c20..2c62c27 100644 --- a/src/ai/tactic/tactictest.h +++ b/src/ai/tactic/tactictest.h @@ -10,6 +10,7 @@ class TacticTest : public Tactic public: int max = -10; int min = 10; + int flag=0; static bool kicked; explicit TacticTest(WorldModel *worldmodel, QObject *parent = 0); virtual RobotCommand getCommand(); diff --git a/src/etc/constants.h b/src/etc/constants.h index b4588f4..9004718 100644 --- a/src/etc/constants.h +++ b/src/etc/constants.h @@ -41,6 +41,8 @@ #define MIN_CONF 0.1 #define VISION_TIMEDOUT 1000.0 #define MAX_RADIOUS 2000 +#define MERGE_DISTANCE 90 +#define MIN_CONFIDENCE 0.1 // Timer speeds diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index f07befd..1927214 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/ssl/ball.cpp b/src/ssl/ball.cpp index 2c6a250..60bb5a2 100644 --- a/src/ssl/ball.cpp +++ b/src/ssl/ball.cpp @@ -9,53 +9,35 @@ Ball::Ball() : void Ball::seenAt(vector p) { - if(p.size()<1) return; - // isValid = true; - timer_seen.start(timer_seen_interval); //restart - - PositionTimeCamera ans; - ans.time = p[0].time; - ans.camera = p[0].camera; - - Vector2D buff; - int min_i = 0; - buff = p[min_i].pos.loc - pos_predicted.loc ; - double min_d = buff.length(); - for(size_t i=0; i < p.size(); i++) - { - buff = p[i].pos.loc - pos_predicted.loc ; - double d = buff.length(); - if(d < min_d) - { - min_d = d; - min_i = i; - } - } - - ans.pos.loc = p[min_i].pos.loc; - ans.pos.dir = p[min_i].pos.dir; - - if (camera_mem == ans.camera || camera_mem == NO_CAMERA ) - { - if((pos.loc - ans.pos.loc).length() < 540 || camera_mem == NO_CAMERA) - { - camera = ans.camera; - time = ans.time; - pos = ans.pos; - vel_calc(); - isValid = true ; - camera_mem = camera ; - camera_timeout = 0; - } - else - { - camera_timeout++; - if(camera_timeout >8) camera_mem = NO_CAMERA; - } - } - else - { - camera_timeout++; - if(camera_timeout >8) camera_mem = NO_CAMERA; - } + if(p.size() == 0){ + hiddenTime += time; + if(hiddenTime > 500){ + isValid = false; + return; + } + else{ + pos.loc.x = pos.loc.x + time*vel.loc.x; + pos.loc.y = pos.loc.y + time*vel.loc.y; + debugs->append(pos.loc); + vel_calc(); + return; + } + } + else{ + mergePoints(p); + if(p.size() == 0){ + hiddenTime += time; + return; + } + else if(p.size() > 1){ + qDebug() << "vision problem"; + isValid = false; + return; + } + } + isValid = true; + time = p[0].time; + pos.loc = p[0].pos.loc; +// debugs->append(pos.loc); + vel_calc(); } diff --git a/src/ssl/ball.h b/src/ssl/ball.h index 8fd2064..5421eaa 100644 --- a/src/ssl/ball.h +++ b/src/ssl/ball.h @@ -2,6 +2,7 @@ #define BALL_H #include "mobileobject.h" +#include class Ball : public MobileObject { @@ -9,6 +10,7 @@ class Ball : public MobileObject public: explicit Ball(); + QList *debugs; virtual void seenAt(vector p); }; diff --git a/src/ssl/mobileobject.cpp b/src/ssl/mobileobject.cpp index 85a9def..238c4ec 100755 --- a/src/ssl/mobileobject.cpp +++ b/src/ssl/mobileobject.cpp @@ -50,15 +50,41 @@ void MobileObject::vel_calc() { PositionTimeCamera last = vel_postc; - vel.loc = vel.loc + (((pos.loc - last.pos.loc) / (time - last.time)) - vel.loc)*1; + vel.loc = vel.loc + (((pos.loc - last.pos.loc) / (time)) - vel.loc)*1; float dir_dif = pos.dir - last.pos.dir ; if(fabs(dir_dif) > M_PI) dir_dif = dir_dif - dir_dif/fabs(dir_dif)*M_PI*2; - vel.dir = (dir_dif) / (time - last.time ) *1000 ; + vel.dir = (dir_dif) / (time) *1000 ; - pos_predicted.loc = pos.loc + vel.loc * (time - last.time); - pos_predicted.dir = pos.dir + vel.dir * (time - last.time); + pos_predicted.loc = pos.loc + vel.loc * (time); + pos_predicted.dir = pos.dir + vel.dir * (time); vel_postc.pos = pos; vel_postc.time = time; } + +void MobileObject::mergePoints(std::vector& points){ + for(int i = 0 ; i < points.size() ; i++){ + if(points[i].confidence < MIN_CONFIDENCE){ + qDebug() << "fuuuuuuck" << points[i].confidence; + points.erase(points.begin() + i); + } + } + //wiegted mean + for (int i = 0; i < points.size(); ++i) { + for (int j = i + 1; j < points.size(); ++j) { + if(points[i].pos.loc.dist(points[j].pos.loc) <= MERGE_DISTANCE){ + points[i].pos.loc.x = ((points[i].pos.loc.x * points[i].confidence) + (points[j].pos.loc.x * points[j].confidence)) + /(points[i].confidence + points[j].confidence); + points[i].pos.loc.y = ((points[i].pos.loc.y * points[i].confidence) + (points[j].pos.loc.y * points[j].confidence)) + /(points[i].confidence + points[j].confidence); + points[i].confidence = std::max(points[i].confidence,points[j].confidence); + points.erase(points.begin() + j); + } + } + } + for(int i = 0 ; i < points.size() ; i++){ + if(points[i].confidence < MIN_CONFIDENCE) + points.erase(points.begin() + i); + } +} diff --git a/src/ssl/mobileobject.h b/src/ssl/mobileobject.h index 8408cc3..7733356 100644 --- a/src/ssl/mobileobject.h +++ b/src/ssl/mobileobject.h @@ -48,8 +48,10 @@ class MobileObject : public QObject PositionTimeCamera last_postc[LAST_COUNT]; PositionTimeCamera vel_postc; void appendPostc(PositionTimeCamera &postc); + void mergePoints(std::vector& points); //private: + double hiddenTime; QTimer timer_seen; int timer_seen_interval; QTimer timer_vel; diff --git a/src/ssl/robot.cpp b/src/ssl/robot.cpp index 198ba97..a52d1d6 100644 --- a/src/ssl/robot.cpp +++ b/src/ssl/robot.cpp @@ -8,6 +8,7 @@ Robot::Robot() : void Robot::seenAt(vector p) { + if(p.size()<1) return; // isValid = true; timer_seen.start(timer_seen_interval); //restart @@ -18,7 +19,6 @@ void Robot::seenAt(vector p) Vector2D buff; int min_i = 0; - qDebug() << "posotion" << pos.loc.x; buff = p[min_i].pos.loc - pos_predicted.loc ; double min_d = buff.length(); for(size_t i=0; i < p.size(); i++) @@ -58,4 +58,25 @@ void Robot::seenAt(vector p) camera_timeout++; if(camera_timeout >8) camera_mem = NO_CAMERA; } +// if(p.size() == 0){ +// isValid = false; +// return; +// } +// else{ +// mergePoints(p); +// if(p.size() == 0){ +// isValid = false; +// return; +// } +// else if(p.size() > 1){ +// qDebug() << "vision problem"; +// isValid = false; +// return; +// } +// } +// isValid = true; +// qDebug() << "bande khoda" << p[0].time << p[0].pos.loc.x; +// time = p[0].time; +// pos.loc = p[0].pos.loc; +// vel_calc(); } diff --git a/src/ssl/sslvision.cpp b/src/ssl/sslvision.cpp index f049654..a929803 100644 --- a/src/ssl/sslvision.cpp +++ b/src/ssl/sslvision.cpp @@ -121,7 +121,8 @@ void SSLVision::parse(SSL_DetectionFrame &pck) // Team side Coefficient float ourSide = (_side == SIDE_RIGHT)? -1.0f : 1.0f; - time = pck.t_capture()*1000; + double time = pck.t_capture()*1000 - lastTime[CamId]; + lastTime[CamId] = pck.t_capture()*1000; // insert balls for(int i=0; i < pck.balls_size(); ++i) @@ -166,6 +167,7 @@ void SSLVision::parse(SSL_DetectionFrame &pck) if((checkCameras[1] & checkCameras[2]) == true && time > 4){ for(int i = 0 ; i < 5 ; i++) checkCameras[i] = false; + _wm->ball.debugs = &_wm->debug_pos; _wm->ball.seenAt(balls); qDebug() << "i am here"; balls.clear(); diff --git a/src/ssl/sslvision.h b/src/ssl/sslvision.h index 4185b30..a8655ef 100644 --- a/src/ssl/sslvision.h +++ b/src/ssl/sslvision.h @@ -28,7 +28,7 @@ class SSLVision : public SSLReceiver void loadPlaying(Vision_log logs); int logLength(); void setLogFrame(int msec); - double time; + double lastTime[CAMERA_NUM]; protected: vector balls; From 475ffe97dd045d81275fdb246d45208310f357fc Mon Sep 17 00:00:00 2001 From: Seyed Ali Hejazi Date: Sun, 5 Feb 2017 15:35:35 +0330 Subject: [PATCH 15/15] save contents --- src/ai/play/playtest.cpp | 2 +- src/kn2cssl_new.pro.user | 2 +- src/ssl/robot.cpp | 93 ++++++++++------------------------------ 3 files changed, 24 insertions(+), 73 deletions(-) diff --git a/src/ai/play/playtest.cpp b/src/ai/play/playtest.cpp index 98606ee..c9f8be1 100644 --- a/src/ai/play/playtest.cpp +++ b/src/ai/play/playtest.cpp @@ -17,7 +17,7 @@ void PlayTest::initRole() void PlayTest::execute() { - tactics[5]= tTest; + tactics[3]= tTest; wm->debug_type=2; wm->debug_pos.append(wm->ourRobot[5].pos.loc); } diff --git a/src/kn2cssl_new.pro.user b/src/kn2cssl_new.pro.user index 1927214..320bf7c 100644 --- a/src/kn2cssl_new.pro.user +++ b/src/kn2cssl_new.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/ssl/robot.cpp b/src/ssl/robot.cpp index a52d1d6..fa2f72c 100644 --- a/src/ssl/robot.cpp +++ b/src/ssl/robot.cpp @@ -8,75 +8,26 @@ Robot::Robot() : void Robot::seenAt(vector p) { - - if(p.size()<1) return; - // isValid = true; - timer_seen.start(timer_seen_interval); //restart - - PositionTimeCamera ans; - ans.time = p[0].time; - ans.camera = p[0].camera; - - Vector2D buff; - int min_i = 0; - buff = p[min_i].pos.loc - pos_predicted.loc ; - double min_d = buff.length(); - for(size_t i=0; i < p.size(); i++) - { - buff = p[i].pos.loc - pos_predicted.loc ; - double d = buff.length(); - if(d < min_d) - { - min_d = d; - min_i = i; - } - } - - ans.pos.loc = p[min_i].pos.loc; - ans.pos.dir = p[min_i].pos.dir; - - if (camera_mem == ans.camera || camera_mem == NO_CAMERA ) - { - if((pos.loc - ans.pos.loc).length() < 540 || camera_mem == NO_CAMERA) - { - camera = ans.camera; - time = ans.time; - pos = ans.pos; - vel_calc(); - isValid = true ; - camera_mem = camera ; - camera_timeout = 0; - } - else - { - camera_timeout++; - if(camera_timeout >8) camera_mem = NO_CAMERA; - } - } - else - { - camera_timeout++; - if(camera_timeout >8) camera_mem = NO_CAMERA; - } -// if(p.size() == 0){ -// isValid = false; -// return; -// } -// else{ -// mergePoints(p); -// if(p.size() == 0){ -// isValid = false; -// return; -// } -// else if(p.size() > 1){ -// qDebug() << "vision problem"; -// isValid = false; -// return; -// } -// } -// isValid = true; -// qDebug() << "bande khoda" << p[0].time << p[0].pos.loc.x; -// time = p[0].time; -// pos.loc = p[0].pos.loc; -// vel_calc(); + if(p.size() == 0){ + isValid = false; + return; + } + else{ + mergePoints(p); + if(p.size() == 0){ + isValid = false; + return; + } + else if(p.size() > 1){ + qDebug() << "vision problem"; + isValid = false; + return; + } + } + isValid = true; + qDebug() << "bande khoda" << p[0].time << p[0].pos.loc.x; + time = p[0].time; + pos.loc = p[0].pos.loc; + pos.dir = p[0].pos.dir; + vel_calc(); }