Human Motion Tracking for Assisting Balance Training and Control of a Humanoid Robot