From 3f6836649fae34232dd0682c642cd52a19e05167 Mon Sep 17 00:00:00 2001
From: "Tassos (nakano) Natsakis" <891234ser@eipieq.com>
Date: Mon, 13 Sep 2021 14:21:18 +0300
Subject: [PATCH] Making the mask compatible with robots with more than 6
 joints

---
 robopy/base/serial_link.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/robopy/base/serial_link.py b/robopy/base/serial_link.py
index 6ed4665..1c76fb7 100644
--- a/robopy/base/serial_link.py
+++ b/robopy/base/serial_link.py
@@ -142,7 +142,7 @@ class SerialLink:
         """
         assert type(T) is np.matrix and T.shape == (4, 4)
         assert mask.shape == (6,), 'The mask must have 6 elements'
-        assert mask.sum() == self.length, 'The mask must have equal amount of 1s as the degrees of freedom of the kinematic chain'
+        assert mask.sum() == min(self.length,6), 'The mask must have equal amount of 1s as the degrees of freedom of the kinematic chain'
         bounds = [(link.qlim[0], link.qlim[1]) for link in self]
 
         if q0 is None:
-- 
GitLab