Construction of Real-time Motion Measurement System using Inertial Sensors and its Application to Robot Teaching System