Design and validation of a motion-tracking system for ROM measurements in home rehabilitation