LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
rotationSensor.hpp
Go to the documentation of this file.
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6#pragma once
7
8#include "api.h"
10
11namespace okapi {
13 public:
26 RotationSensor(std::uint8_t iport, bool ireversed = false);
27
34 double get() const override;
35
42 std::int32_t reset() override;
43
50 double controllerGet() override;
51
58 double getVelocity() const;
59
60 protected:
61 std::uint8_t port;
62 std::int8_t reversed{1};
63};
64} // namespace okapi
PROS API header provides high-level user functionality.
double get() const override
Get the current rotation in degrees.
RotationSensor(std::uint8_t iport, bool ireversed=false)
A rotation sensor in a V5 port.
double getVelocity() const
Get the current rotational velocity estimate in degrees per second.
double controllerGet() override
Get the sensor value for use in a control loop.
std::int32_t reset() override
Reset the sensor to zero.