From f795f60fe6cb1bb010474bd75ee727386791d98c Mon Sep 17 00:00:00 2001
From: Daniel Flickinger <flikx@flux.utah.edu>
Date: Wed, 15 Dec 2004 22:06:06 +0000
Subject: [PATCH] Since the changes to gorobot.cc were minimal, I reverted them
 by hand.

No reason to change everything back in grobot.`
---
 robots/primotion/gorobot.cc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/robots/primotion/gorobot.cc b/robots/primotion/gorobot.cc
index aab5872533..78538b5b23 100755
--- a/robots/primotion/gorobot.cc
+++ b/robots/primotion/gorobot.cc
@@ -63,7 +63,10 @@ static void handle_client_packet(grobot &bot,
     case MTP_COMMAND_GOTO:
 	/* Record our robot id. */
 	robot_id = mp->data.command_goto->robot_id;
+ 
+        // theta should be calculated by grobot; override instead
 	theta = mp->data.command_goto->position.theta;
+ 
 	bot.dgoto(mp->data.command_goto->position.x,
 		  mp->data.command_goto->position.y,
 		  mp->data.command_goto->position.theta);
@@ -79,6 +82,7 @@ static void handle_client_packet(grobot &bot,
 	    bot.getDisplacement(mup.position.x,
                                 mup.position.y,
                                 mup.position.theta);
+            bot.resetPosition(); // not really needed
 	    mup.status = MTP_POSITION_STATUS_IDLE;
 	    if ((ump = mtp_make_packet(MTP_UPDATE_POSITION,
 				       MTP_ROLE_RMC,
@@ -268,7 +272,14 @@ int main(int argc, char *argv[])
 		bot.getDisplacement(mup.position.x,
                                     mup.position.y,
                                     mup.position.theta);
-		bot.resetPosition();
+  		
+  		// override, for now:
+  		mup.position.theta = theta;
+  
+		// bot.resetPosition();
+                // No need to reset position, because it's done
+                // automatically at the start of each primitive
+  
 		if (rc < 0) {
 		    mup.status = MTP_POSITION_STATUS_ERROR;
 		}
-- 
GitLab