A soft robot that adapts to environments through shape change