Update to 2018_v4 image and new build system. (#598)

* Revert "Force OpenCV to 3.1.0 (#602)"

This reverts commit 50ed55e8e2.

* Removes Simulation

* Removes old build system

* Removes old gtest

* Adds new gmock and gtest

* Updates to new ni-libraries

* removes MyRobot (to be replaced)

* moves files to new location

* Adds new sim backend and new test executables

* updates .styleguide and .gitignore

* Changes cpp WPILibVersion to a function

MSVC throws an AV with the old version.

* Disables USBCamera on all systems except for linux

* 2018 NI Libraries

* New build system
This commit is contained in:
Thad House
2017-08-18 21:35:53 -07:00
committed by Peter Johnson
parent 50ed55e8e2
commit e1195e8b9d
1024 changed files with 64481 additions and 61340 deletions

View File

@@ -0,0 +1,76 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2016-2017. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
#include "HAL/Encoder.h"
namespace hal {
class Encoder {
public:
Encoder(HAL_Handle digitalSourceHandleA,
HAL_AnalogTriggerType analogTriggerTypeA,
HAL_Handle digitalSourceHandleB,
HAL_AnalogTriggerType analogTriggerTypeB, bool reverseDirection,
HAL_EncoderEncodingType encodingType, int32_t* status);
~Encoder();
// CounterBase interface
int32_t Get(int32_t* status) const;
int32_t GetRaw(int32_t* status) const;
int32_t GetEncodingScale(int32_t* status) const;
void Reset(int32_t* status);
double GetPeriod(int32_t* status) const;
void SetMaxPeriod(double maxPeriod, int32_t* status);
bool GetStopped(int32_t* status) const;
bool GetDirection(int32_t* status) const;
double GetDistance(int32_t* status) const;
double GetRate(int32_t* status) const;
void SetMinRate(double minRate, int32_t* status);
void SetDistancePerPulse(double distancePerPulse, int32_t* status);
void SetReverseDirection(bool reverseDirection, int32_t* status);
void SetSamplesToAverage(int32_t samplesToAverage, int32_t* status);
int32_t GetSamplesToAverage(int32_t* status) const;
void SetIndexSource(HAL_Handle digitalSourceHandle,
HAL_AnalogTriggerType analogTriggerType,
HAL_EncoderIndexingType type, int32_t* status);
int32_t GetFPGAIndex() const { return m_index; }
int32_t GetEncodingScale() const { return m_encodingScale; }
double DecodingScaleFactor() const;
double GetDistancePerPulse() const { return m_distancePerPulse; }
HAL_EncoderEncodingType GetEncodingType() const { return m_encodingType; }
private:
void SetupCounter(HAL_Handle digitalSourceHandleA,
HAL_AnalogTriggerType analogTriggerTypeA,
HAL_Handle digitalSourceHandleB,
HAL_AnalogTriggerType analogTriggerTypeB,
bool reverseDirection, HAL_EncoderEncodingType encodingType,
int32_t* status);
HAL_FPGAEncoderHandle m_encoder = HAL_kInvalidHandle;
HAL_CounterHandle m_counter = HAL_kInvalidHandle;
int32_t m_index = 0;
double m_distancePerPulse = 1.0;
HAL_EncoderEncodingType m_encodingType;
int32_t m_encodingScale;
};
} // namespace hal