From b4b28c056a38b68d8c0405618a1e9c07142fb537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Luis=20Rivero=20Partida?= <jrivero@iri.upc.edu>
Date: Thu, 26 May 2011 13:22:28 +0000
Subject: [PATCH] segwayRMP200 is now returning values in international units.

Don't need to convert to them anymore.
---
 src/segway_RMP400.cpp | 6 +++---
 src/segway_RMP400.h   | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/segway_RMP400.cpp b/src/segway_RMP400.cpp
index de5f245..8418313 100644
--- a/src/segway_RMP400.cpp
+++ b/src/segway_RMP400.cpp
@@ -198,7 +198,7 @@ CSegwayRMP400::get_yaw_displacement()
     if (use_correction_wheel_factor_)
         fix_with_wheel_factor(yaw_displacement_tmp);
 
-    yaw_displacement_ = yaw_displacement_tmp * 2 * PI; // convert to radians
+    yaw_displacement_ = yaw_displacement_tmp;
     return yaw_displacement_;
 }
 
@@ -207,7 +207,7 @@ CSegwayRMP400::get_yaw_rate()
 {
     need_to_be_connected();
 
-    yaw_rate_ = get_yaw_rate() * (PI / 180);
+    yaw_rate_ = get_yaw_rate();
     return yaw_rate_;
 }
 
@@ -252,7 +252,7 @@ CSegwayRMP400::move(float vT, float vR)
 {
     need_to_be_connected();
 
-    float vRradsec = vR * 2.0 * PI;  // revs per sec to rads per sec
+    float vRradsec = vR;
 
     if (fabs(vT) < fabs(RMP400_b * vRradsec / 2)) {
         // minimum translational velocity needed to enforce rotation about a ICR outside of the robot base
diff --git a/src/segway_RMP400.h b/src/segway_RMP400.h
index a7ddf7e..60dfe60 100644
--- a/src/segway_RMP400.h
+++ b/src/segway_RMP400.h
@@ -3,13 +3,11 @@
 
 #include <segway_rmp200.h>
 #include <ftdiserver.h>
-#include <math.h>
 #include <vector>
 #include <string>
 #include <iostream>
 
 #define RMP400_b 0.54 // distance between weels for one rmp unit in meters
-#define PI 3.141592
 #define RMP200_DEFAULT_WHEEL_RADIUS 0.24
 
 const int NUM_SEGWAY_200 = 2;
-- 
GitLab