From 7c66f0446676f9103e0d5fd5f04c41abdb8ab1b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu>
Date: Fri, 8 Apr 2016 09:28:31 +0000
Subject: [PATCH] Solved a bug when trying to create a group with no servos.

---
 src/dynamixel_motor_group.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dynamixel_motor_group.cpp b/src/dynamixel_motor_group.cpp
index 2ff5f4b..202f59c 100644
--- a/src/dynamixel_motor_group.cpp
+++ b/src/dynamixel_motor_group.cpp
@@ -851,7 +851,7 @@ void CDynamixelMotorGroup::load_config(std::string &filename)
         this->set_max_torque(i,motor->max_torque());
         this->set_limit_torque(i,motor->max_torque());
       }  
-      if(this->config[0].min_angle==-this->info[0].center_angle && this->config[0].max_angle==-this->info[0].center_angle)
+      if(cfg->dyn_motor_config().size()>0 && this->config[0].min_angle==-this->info[0].center_angle && this->config[0].max_angle==-this->info[0].center_angle)
       {
         this->mode=torque_ctrl;
         for(i=1;i<this->servo_id.size();i++)
-- 
GitLab