[TeamTalk 23]: [560] TeamTalk/Agents: fixed references from win_netutils to the now generic netutils

tk@edam.speech.cs.cmu.edu tk at edam.speech.cs.cmu.edu
Wed Dec 13 14:04:18 EST 2006


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20061213/1501480c/attachment.html
-------------- next part --------------
Modified: TeamTalk/Agents/PrimitiveComm/robot_client.cpp
===================================================================
--- TeamTalk/Agents/PrimitiveComm/robot_client.cpp	2006-12-11 08:18:25 UTC (rev 559)
+++ TeamTalk/Agents/PrimitiveComm/robot_client.cpp	2006-12-13 19:04:17 UTC (rev 560)
@@ -6,7 +6,7 @@
 
 #include "robot_client.hpp"
 #include "utils.h"
-#include "win_netutils.h"
+#include "netutils.h"
 #include <cstdio>
 #include <cstring>
 #include <ctime>

Modified: TeamTalk/Agents/PrimitiveComm/robot_server.hpp
===================================================================
--- TeamTalk/Agents/PrimitiveComm/robot_server.hpp	2006-12-11 08:18:25 UTC (rev 559)
+++ TeamTalk/Agents/PrimitiveComm/robot_server.hpp	2006-12-13 19:04:17 UTC (rev 560)
@@ -5,7 +5,6 @@
 
 #ifdef WIN32
 #include <Winsock2.h>
-#include "win_netutils.h"
 #include "win32dep.h"
 #else
 #include <sys/types.h>
@@ -24,6 +23,7 @@
 #include <string>
 #include "robot_packet2.h"
 #include "udpsocket.h"
+#include "netutils.h"
 
 using namespace std;
 

Modified: TeamTalk/Agents/PrimitiveComm/utils.cpp
===================================================================
--- TeamTalk/Agents/PrimitiveComm/utils.cpp	2006-12-11 08:18:25 UTC (rev 559)
+++ TeamTalk/Agents/PrimitiveComm/utils.cpp	2006-12-13 19:04:17 UTC (rev 560)
@@ -174,7 +174,7 @@
   return spawn(wait, working_dir, cmd, args);
 }
 #else
-PROCESS_INFORMATION spawn(const string& title, const string& wdir, 
+PROCESS_INFORMATION spawn(bool wait, const string& title, const string& wdir, 
                           const string& cmd, 
                           vector<string> args=vector<string>())
 {
@@ -183,10 +183,10 @@
     if(i != args.begin()) argstring << ' ';
     argstring << *i;
   }
-  return spawn(title, wdir, cmd, argstring.str());
+  return spawn(wait, title, wdir, cmd, argstring.str());
 }
 
-PROCESS_INFORMATION spawn(const string& title, const string& wdir, 
+PROCESS_INFORMATION spawn(bool wait, const string& title, const string& wdir, 
                           const string& exe, string args)  
 {
   //CreateProcess wants a writable char* for some stupid reason
@@ -223,6 +223,7 @@
     }
     error << endl;
   }
+  if(wait) WaitForSingleObject(pi.hProcess, INFINITE);
   delete temppath;
   return pi;
 }

Modified: TeamTalk/Agents/TeamTalkBackend/agent.cpp
===================================================================
--- TeamTalk/Agents/TeamTalkBackend/agent.cpp	2006-12-11 08:18:25 UTC (rev 559)
+++ TeamTalk/Agents/TeamTalkBackend/agent.cpp	2006-12-13 19:04:17 UTC (rev 560)
@@ -28,7 +28,7 @@
 
 	ostringstream args;
 	args << "-verbosity 3 -pgm_file " << cfilename;
-  serverChildren_.push(spawn(cfilename, ".", HUB, args.str()).hProcess);
+  serverChildren_.push(spawn(false, cfilename, ".", HUB, args.str()).hProcess);
 }
 
 void Agent::spawnHelios(const string& uppername) 
@@ -42,7 +42,7 @@
 
 	ostringstream args;
 	args << "-port " << iHeliosPort << " -config " << cfilename;
-	serverChildren_.push(spawn(cfilename, ".", HELIOS, args.str()).hProcess);
+	serverChildren_.push(spawn(false, cfilename, ".", HELIOS, args.str()).hProcess);
 }
 
 void Agent::spawnDM(const string& uppername, const string& safeness) 
@@ -70,7 +70,7 @@
 
 	ostringstream args;
 	args << "-maxconns 6 -config " << cfilename;
-	serverChildren_.push(spawn(cfilename, ".", DM, args.str()).hProcess);
+	serverChildren_.push(spawn(false, cfilename, ".", DM, args.str()).hProcess);
 }
 
 string Agent::writeSpecializedConfig(const string temp, const string ext, 

Modified: TeamTalk/Agents/TeamTalkBackend/backendstub/robot.cpp
===================================================================
--- TeamTalk/Agents/TeamTalkBackend/backendstub/robot.cpp	2006-12-11 08:18:25 UTC (rev 559)
+++ TeamTalk/Agents/TeamTalkBackend/backendstub/robot.cpp	2006-12-13 19:04:17 UTC (rev 560)
@@ -230,17 +230,13 @@
 	EnterCriticalSection(&CriticalSection);
 	if(const MsgCmdGoTo* goTo = dynamic_cast<const MsgCmdGoTo*>(temp_message)) {
 		info << "got: " << goTo << endl;
-    Point<float> gotoVec(goTo->getX(), goTo->getY());
-		float m_x = goTo->getX();
-		float m_y = goTo->getY();
-    if(goTo->isAbsolute()) setGoal(gotoVec); //will report done when complete
-    else if(goTo->useAngle() && m_x == 0 && m_y == 0) {
+    Point<float> vec(goTo->getX(), goTo->getY());
+    if(goTo->isAbsolute()) setGoal(vec); //will report done when complete
+    else if(goTo->useAngle() &&  !vec) {
       setGoal(canonical_angle(pose.yaw+goTo->getAngle()));
 		  action = GO_TO_ANGLE; //will report done when complete
     } else {
-      float dir = pose.yaw+atan2(m_y, m_x);
-		  float len = sqrt(m_x*m_x+m_y*m_y);
-      setGoal(Point<float>::Polar(len, dir));
+      setGoal(pose.loc+Point<float>::Polar(vec.length(), pose.yaw+vec.angle()));
     }
 	} else if(const MsgCmdHalt* halt = dynamic_cast<const MsgCmdHalt*>(temp_message)) {
 		info << "got: " << halt << endl;


More information about the TeamTalk-developers mailing list