Ejemplo n.º 1
0
void PGRLKick::process(NUSensorsData* data, NUActionatorsData* actions) {
	
	MotionScript* kick = new MotionScript("kick");
	
	#ifdef USE_WALK
    if (m_walk)
        m_walk->kill();
    #endif
    
    kick->play(m_data, m_actions);
	m_completion_time = kick->timeFinished();
	m_head_completion_time = kick->timeFinishedWithHead();
	m_arm_completion_time = max(kick->timeFinishedWithLArm(), kick->timeFinishedWithRArm());
	
	delete kick
}
Ejemplo n.º 2
0
void Getup::playGetup()
{
    if (m_walk)
        m_walk->kill();
    
    vector<float> fallen;
    if (m_data->get(NUSensorsData::Fallen, fallen))
    {
        MotionScript* getup = m_on_front;
        if (fallen[1])
            getup = m_on_left;
        else if (fallen[2])
            getup = m_on_right;
        else if (fallen[3])
            getup = m_on_front;
        else if (fallen[4])
            getup = m_on_back;
        getup->play(m_data, m_actions);
        m_completion_time = getup->timeFinished();
        m_head_completion_time = getup->timeFinishedWithHead();
        m_arm_completion_time = max(getup->timeFinishedWithLArm(), getup->timeFinishedWithRArm());
    }
}