Collect motion data and save to mongodb.