From cf267bb4f10122816ec1dae2dba3dfab902d1d58 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Sun, 2 Feb 2020 21:31:47 +0100
Subject: [PATCH] Updated the IMU example to show gyro data.

---
 src/examples/darwin_imu_test.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/examples/darwin_imu_test.cpp b/src/examples/darwin_imu_test.cpp
index 32d0749..6d2185b 100644
--- a/src/examples/darwin_imu_test.cpp
+++ b/src/examples/darwin_imu_test.cpp
@@ -10,7 +10,7 @@ std::string robot_device="/tmp/darwin_driver";
 int main(int argc, char *argv[])
 {
   int i=0;
-  double accel_x,accel_y,accel_z;
+  double gyro_x,gyro_y,gyro_z;
 
   try{
     CDarwinRobot darwin("Darwin",robot_device,1000000,0x01,true);
@@ -19,8 +19,8 @@ int main(int argc, char *argv[])
     darwin.imu_start();
     for(i=0;i<50;i++)
     {
-      darwin.imu_get_accel_data(&accel_x,&accel_y,&accel_z);
-      std::cout << "Accel: x:" << accel_x << ", y: " << accel_y << ", z: " << accel_z << std::endl;
+      darwin.imu_get_gyro_data(&gyro_x,&gyro_y,&gyro_z);
+      std::cout << "Gyro: x:" << gyro_x << ", y: " << gyro_y << ", z: " << gyro_z << std::endl;
       usleep(100000);
     }
     darwin.imu_stop();
-- 
GitLab