demo project

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

Revision:
18:224289104fc0
Child:
19:2f0ec9ac1238
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/ActionBuf.cpp	Sat Jan 23 00:08:30 2016 +0000
@@ -0,0 +1,56 @@
+#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;
+}
+
+