This paper describes the Obje Perception Framework (OPF), a distributed software architecture for context sensing and inference in ubiquitous computing environments. OPF provides flexibility, scalability, and robustness even as the sensor configuration changes. For flexibility, OPF supports many context inference tasks, ways of achieving those tasks, and heterogeneity in sensor types. With respect to scalability, OFF accommodates the needs of a large number of applications simultaneously while conserving power and reducing the amount of data transmitted over the network. And to support robustness to dynamism, OFF constructs context inference pipelines to satisfy each applications' needs in a goal-directed fashion. The value of OPF is demonstrated by a case study of an end-user application that helps users establish and manage connections among the various digital resources in their environment.