Towards optimal design of modular robotic arms