Modular microrobot for swimming in heterogeneous environments