A body machine interface based on inertial sensors