From 9c07cc176f1281ecb8b162caf15f33c2ff486058 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergi=20Hern=C3=A1ndez?= <shernand@iri.upc.edu>
Date: Tue, 23 Aug 2016 23:28:12 +0200
Subject: [PATCH] Removed the joints_status attributes.

---
 src/darwin_robot.cpp | 13 ++-----------
 src/darwin_robot.h   |  2 --
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/darwin_robot.cpp b/src/darwin_robot.cpp
index 35df42d..3508488 100644
--- a/src/darwin_robot.cpp
+++ b/src/darwin_robot.cpp
@@ -80,9 +80,6 @@ CDarwinRobot::CDarwinRobot(const std::string &name,std::string &bus_id,int bus_s
       this->robot_device->read_byte_register(DARWIN_MM_NUM_SERVOS,&this->manager_num_servos);
       /* get the current action status */
       this->robot_device->read_byte_register(DARWIN_ACTION_CNTRL,&this->action_status);
-      /* get the current joints status */
-      for(i=0;i<JOINTS_NUM_GROUPS;i++)
-        this->robot_device->read_byte_register(DARWIN_JOINT_GRP0_CNTRL+i*5,&this->joints_status[i]);
       /* get the current head tracking status */
       this->robot_device->read_byte_register(DARWIN_HEAD_CNTRL,&this->head_tracking_status);
     }
@@ -1538,10 +1535,7 @@ std::vector<double> CDarwinRobot::joints_get_group_accels(joints_grp_t group)
 void CDarwinRobot::joints_start(joints_grp_t group)
 {
   if(this->robot_device!=NULL)
-  {
-    this->joints_status[(int)group]|=JOINT_START;
-    this->robot_device->write_byte_register(DARWIN_JOINT_GRP0_CNTRL+((unsigned short int)group*5),this->joints_status[(int)group]);
-  }
+    this->robot_device->write_byte_register(DARWIN_JOINT_GRP0_CNTRL+((unsigned short int)group*5),JOINT_START);
   else
     throw CDarwinRobotException(_HERE_,"Invalid robot device");
 }
@@ -1549,10 +1543,7 @@ void CDarwinRobot::joints_start(joints_grp_t group)
 void CDarwinRobot::joints_stop(joints_grp_t group)
 {
   if(this->robot_device!=NULL)
-  {
-    this->joints_status[(int)group]|=JOINT_STOP;
-    this->robot_device->write_byte_register(DARWIN_JOINT_GRP0_CNTRL+((unsigned short int)group*5),this->joints_status[(int)group]);
-  }
+    this->robot_device->write_byte_register(DARWIN_JOINT_GRP0_CNTRL+((unsigned short int)group*5),JOINT_STOP);
   else
     throw CDarwinRobotException(_HERE_,"Invalid robot device");
 }
diff --git a/src/darwin_robot.h b/src/darwin_robot.h
index 80af216..51343b1 100644
--- a/src/darwin_robot.h
+++ b/src/darwin_robot.h
@@ -52,8 +52,6 @@ class CDarwinRobot
     unsigned char manager_status;
     /* action status */
     unsigned char action_status;
-    /* joint group status */
-    unsigned char joints_status[JOINTS_NUM_GROUPS];
     /* head tracking status */
     unsigned char head_tracking_status;
   public:
-- 
GitLab