This includes fixed joints too. I am not sure this is correct. You can get only the active joint models using getActiveJointModels(), which excludes mimic & fixed joints. You can get mimic joints with getMimicJointModels(). So you can use getActiveJointModels().size() + getMimicJointModels().size() to avoid including fixed joints.