Guessing human intentions to avoid dangerous situations in caregiving robots