001/* 002 * Copyright (C) Cross The Road Electronics. All rights reserved. 003 * License information can be found in CTRE_LICENSE.txt 004 * For support and suggestions contact support@ctr-electronics.com or file 005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases 006 */ 007package com.ctre.phoenix6.wpiutils; 008 009import edu.wpi.first.wpilibj.motorcontrol.MotorController; 010import edu.wpi.first.wpilibj.MotorSafety; 011 012/** 013 * Implem of MotorSafety interface from WPILib. This also allows late/lazy 014 * construction of WPILib's motor safety object. 015 */ 016public class MotorSafetyImplem extends MotorSafety { 017 private final MotorController m_motorController; 018 private final String m_description; 019 020 /** 021 * Constructor for MotorSafetyImplem 022 * @param motorController Motor Controller to implement motor safety on 023 * @param description Description of motor controller 024 */ 025 public MotorSafetyImplem(MotorController motorController, String description) { 026 m_motorController = motorController; 027 m_description = description; 028 } 029 030 /** 031 * Stops the controller 032 */ 033 public void stopMotor() { m_motorController.stopMotor(); } 034 035 /** 036 * @return Description of motor controller 037 */ 038 public String getDescription() { return m_description; } 039}