Program Listing for File turret_subsystem_interface.hpp

Return to documentation for file (src/tap/control/turret_subsystem_interface.hpp)

/*
 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
 *
 * This file is part of Taproot.
 *
 * Taproot is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Taproot is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Taproot.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef TAPROOT_TURRET_SUBSYSTEM_INTERFACE_HPP_
#define TAPROOT_TURRET_SUBSYSTEM_INTERFACE_HPP_

#include "tap/algorithms/wrapped_float.hpp"

#include "subsystem.hpp"

namespace tap::control::turret
{
class TurretSubsystemInterface : public Subsystem
{
public:
    explicit TurretSubsystemInterface(Drivers *drivers) : Subsystem(drivers) {}

    virtual inline float getYawSetpoint() const = 0;
    virtual inline float getPitchSetpoint() const = 0;

    virtual void setYawSetpoint(float newAngle) = 0;
    virtual void setPitchSetpoint(float newAngle) = 0;

    virtual const tap::algorithms::WrappedFloat &getCurrentYawValue() const = 0;

    virtual const tap::algorithms::WrappedFloat &getCurrentPitchValue() const = 0;

    virtual inline bool isOnline() const = 0;

    virtual inline float getYawVelocity() const = 0;
    virtual inline float getPitchVelocity() const = 0;

    virtual float getYawAngleFromCenter() const = 0;

    virtual float getPitchAngleFromCenter() const = 0;

    virtual void setYawMotorOutput(float out) = 0;

    virtual void setPitchMotorOutput(float out) = 0;

    virtual bool yawLimited() const = 0;
};
}  // namespace tap::control::turret

#endif  // TAPROOT_TURRET_SUBSYSTEM_INTERFACE_HPP_