Learning control strategy in soft robotics through a set of configuration spaces