A Model for the Cooperation between Robots and Smart Environments