robot arm demo team / Mbed 2 deprecated RobotArmDemo Featured

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

ActionBuf.h

Committer:
henryrawas
Date:
2016-01-15
Revision:
13:ffeff9b5e513
Parent:
10:9b21566a5ddb

File content as of revision 13:ffeff9b5e513:

/* 
Copyright (c) 2015 Jonathan Pickett & Microsoft. Some appropriate open source license.
*/

#ifndef __ACTIONBUF_H__
#define __ACTIONBUF_H__

#include "mbed.h"
#include "SafeCircBuf.h"
#include "RobotArm.h"


#define ActionArgSize  40

class ActionGroup
{
public:
    ActionGroup() {};
    
    bool SetAction(ArmAction aId, char* args);
    
    ArmAction ActionId;
    
    char ActionArg[ActionArgSize];
};



enum SequenceAction
{
    SA_SetGoal          = 0x1,
    SA_Delay            = 0x2,
    SA_LoopBegin        = 0x3,
    SA_LoopEnd          = 0x4
};

class ActionSequence
{
public:
    ActionSequence();
    
    ActionSequence(SequenceAction aType);
    
 
    ActionSequence(SequenceAction aType, int parts, const float vals[], int param);
    
    void SetGoal(int parts, const float vals[]);
    
    void SetParam(int param);
    
    void SetAction(SequenceAction aType);
    
    SequenceAction ActionType;
    
    float GoalVals[NUMJOINTS];
    
    int NumParts;
    
    int Param;
    
};


#endif