A novel approach to motion tracking with wearable sensors based on Probabilistic Graphical Models