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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MeasureBuf.cpp Source File

MeasureBuf.cpp

00001 // Copyright (c) Microsoft. All rights reserved.
00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
00003 
00004 #include "mbed.h"
00005 
00006 #include "MeasureBuf.h"
00007 
00008 
00009 SafeCircBuf<MeasureSnapshot, MeasureBufSize, uint32_t> MeasureBuf;
00010 
00011 void MeasureGroup::SetMeasure(int numParts, float vals[])
00012 {
00013     NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts;
00014     
00015     for (int ix = 0; ix < NumVals; ix++)
00016     {
00017         MeasVals[ix] = vals[ix];
00018     }
00019 }
00020 
00021 MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs)
00022 {
00023     NumVals = rhs.NumVals;
00024     for (int ix = 0; ix < NUMJOINTS; ix++)
00025     {
00026         MeasVals[ix] = rhs.MeasVals[ix];
00027     }
00028     return *this;
00029 }
00030