mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
* Fixed cpplint.py [build/include_order] and [build/include_what_you_use] warnings * Fixed cpplint.py [readability/casting] warnings * Updated .styleguide format * Fixed cpplint.py [build/header_guard] warnings
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) FIRST 2014-2016. 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 <memory>
|
|
#include <string>
|
|
|
|
#include "LiveWindow/LiveWindowSendable.h"
|
|
#include "SensorBase.h"
|
|
#include "interfaces/Accelerometer.h"
|
|
|
|
/**
|
|
* Built-in accelerometer.
|
|
*
|
|
* This class allows access to the roboRIO's internal accelerometer.
|
|
*/
|
|
class BuiltInAccelerometer : public Accelerometer,
|
|
public SensorBase,
|
|
public LiveWindowSendable {
|
|
public:
|
|
explicit BuiltInAccelerometer(Range range = kRange_8G);
|
|
virtual ~BuiltInAccelerometer() = default;
|
|
|
|
// Accelerometer interface
|
|
void SetRange(Range range) override;
|
|
double GetX() override;
|
|
double GetY() override;
|
|
double GetZ() override;
|
|
|
|
std::string GetSmartDashboardType() const override;
|
|
void InitTable(std::shared_ptr<ITable> subtable) override;
|
|
void UpdateTable() override;
|
|
std::shared_ptr<ITable> GetTable() const override;
|
|
void StartLiveWindowMode() override {}
|
|
void StopLiveWindowMode() override {}
|
|
|
|
private:
|
|
std::shared_ptr<ITable> m_table;
|
|
};
|