demo project

Dependencies:   AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL

Utils/ActionBuf.cpp

Committer:
henryrawas
Date:
2016-01-23
Revision:
18:224289104fc0
Child:
19:2f0ec9ac1238

File content as of revision 18:224289104fc0:

#include "mbed.h"
#include "rtos.h"

#include "ActionBuf.h"


ActionSequence::ActionSequence()
{
};

ActionSequence::ActionSequence(SequenceAction aType)
{
    ActionType = aType;
    Param = 0;
    NumParts = 0;
};

ActionSequence::ActionSequence(SequenceAction aType, int parts, const float vals[], int param)
{
    ActionType = aType;

    if (parts > NUMJOINTS) parts = NUMJOINTS;
    
    if (vals != NULL)
    {
        for (int i = 0; i < parts; i++)
            GoalVals[i] = vals[i];
    }
    NumParts = parts;
    
    Param = param;
}

void ActionSequence::SetGoal(int parts, const float vals[])
{
    if (parts > NUMJOINTS) parts = NUMJOINTS;
    
    if (vals != NULL)
    {
        for (int i = 0; i < parts; i++)
            GoalVals[i] = vals[i];
    }
    NumParts = parts;
}

void ActionSequence::SetParam(int param)
{
    Param = param;
}
    
void ActionSequence::SetAction(SequenceAction aType)
{
    ActionType = aType;
}