void JuppWalk::doWalk()
{
    #if DEBUG_NUMOTION_VERBOSITY > 4
        debug << "JuppWalk::doWalk()" << std::endl;
    #endif
    getParameters();
    // Convert speed vector into swing leg amplitudes (ar, ap, ay)
    m_swing_amplitude_roll = asin(-m_speed_y/(2*m_step_frequency*m_leg_length));
    m_swing_amplitude_pitch = asin(m_speed_x/(2*m_step_frequency*m_leg_length));
    m_swing_amplitude_yaw = m_speed_yaw/(2*m_step_frequency);
    
    calculateGaitPhase();
    m_left_leg_phase = NORMALISE(m_gait_phase + M_PI/2);
    m_right_leg_phase = NORMALISE(m_gait_phase - M_PI/2);
    
    calculateGyroFeedback();
    calculateLeftLeg();
    calculateRightLeg();
    
    calculateLeftArm();
    calculateRightArm();
    
    updateActionatorsData();
    
    #if DEBUG_NUMOTION_VERBOSITY > 4
        debug << "JuppWalk::doWalk(). Completed" << std::endl;
    #endif
}
Exemple #2
0
void DarwinWalk::doWalk()
{

	//SET THE MOTOR POSITIONS IN THE WALK ENGINE:
	updateWalkEngineSensorData();
	//TELL THE WALK ENGINE THE NEW COMMAND
	if(m_speed_x==0  && m_speed_y==0  && m_speed_yaw ==0 )
		Robot::Walking::GetInstance()->Stop();
	else
		Robot::Walking::GetInstance()->Start();

	vector<float> speeds = m_walk_parameters.getMaxSpeeds();
	Robot::Walking::GetInstance()->X_MOVE_AMPLITUDE = m_speed_x/speeds[0]*15;
	Robot::Walking::GetInstance()->Y_MOVE_AMPLITUDE = m_speed_y/speeds[1]*15;
	Robot::Walking::GetInstance()->A_MOVE_AMPLITUDE = m_speed_yaw/speeds[2]*25;

	//cout << "Walk Commands: " << Robot::Walking::GetInstance()->X_MOVE_AMPLITUDE << " " << Robot::Walking::GetInstance()->Y_MOVE_AMPLITUDE << " " << Robot::Walking::GetInstance()->A_MOVE_AMPLITUDE << endl;
	Robot::Walking::GetInstance()->Process();

	//GET THE NEW TARGET POSITIONS FROM THE WALK ENGINE
	updateActionatorsData();
	return;
}