Smart foam and artificial intelligence could help robots know if they're injured