コード例 #1
0
ファイル: walkControl.c プロジェクト: mws262/Ranger
/* Sends commands to the motors based on the current state of the
 * walking finite state machine */
void sendMotorCommands(void) {

    float push = CtrlWalk_ankPush;

    switch (WALK_FSM_MODE_PREV) {
    case Glide_Out:
        holdStance_ankOut();
        flipUp_ankInn();
        hipGlide();
        break;
    case Push_Out:
        flipDown_ankInn();
        pushOff_ankOut(push);
        hipHold(CtrlWalk_hipHold);
        break;
    case Glide_Inn:
        flipUp_ankOut();
        holdStance_ankInn();
        hipGlide();
        break;
    case Push_Inn:
        flipDown_ankOut();
        pushOff_ankInn(push);
        hipHold(CtrlWalk_hipHold);
        break;
    case Flight:  // In the air, get ready for Glide_Out
        holdStance_ankOut();
        flipUp_ankInn();
        disable_hip();
        break;
    }

}
コード例 #2
0
ファイル: walkControl.c プロジェクト: RuinaLab/Ranger
/* Sends commands to the motors based on the current state of the
 * walking finite state machine */
void sendMotorCommands(void) {
	float hipTargetAngle;
	float push = CtrlWalk_ankPush;

	switch (WALK_FSM_MODE_PREV) {
	case Glide_Out:
		holdStance_ankOut();
		flipUp_ankInn();
		hipGlide();
		break;
	case Push1_Out:
	case Push2_Out:
		flipDown_ankInn();
		pushOff_ankOut(push);
		hipTargetAngle = getTargetHipAngle(STATE_th0, STATE_th1, CtrlWalk_critStepLen);
		hipHold(hipTargetAngle);
		break;
	case Glide_Inn:
		holdStance_ankInn();
		flipUp_ankOut();
		hipGlide();
		break;
	case Push1_Inn:
	case Push2_Inn:
		flipDown_ankOut();
		pushOff_ankInn(push);
		hipTargetAngle = getTargetHipAngle(STATE_th1, STATE_th0, CtrlWalk_critStepLen);
		hipHold(hipTargetAngle);
		break;
	case Flight:  // In the air, get ready for Glide_Out
		holdStance_ankOut();
		flipUp_ankInn();
		disable_hip();
		break;
	}

}
コード例 #3
0
ファイル: unit_test.c プロジェクト: mws262/Ranger
/* --15-- Holds both feet in stance. The behavior of the hip:
 * double stance = do nothing
 * flight = hold zero
 * single stance outer = hold pos
 * single stance inner = hold neg    */
void test_hipHold() {
	holdStance_ankOut();
	holdStance_ankInn();
	hipHold(0.3);
}