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.phoenixpro.configs;
008
009import com.ctre.phoenix6.StatusCode;
010import com.ctre.phoenix6.configs.jni.ConfigJNI;
011import com.ctre.phoenix6.spns.*;
012
013/**
014 *  Configs for Pigeon 2's Mount Pose configuration.
015 * <p>
016 *  These configs allow the Pigeon2 to be mounted in whatever
017 *  orientation that's desired and ensure the reported Yaw/Pitch/Roll
018 *  is from the robot's reference.
019 *
020 * @deprecated Classes in the phoenixpro package will be removed in 2024.
021 *             Users should instead use classes from the phoenix6 package.
022 */
023@Deprecated(forRemoval = true)
024public class MountPoseConfigs implements ParentConfiguration
025{
026    /**
027     * The mounting calibration yaw-component
028     *
029     *  <ul>
030     *  <li> <b>Minimum Value:</b> -360
031     *  <li> <b>Maximum Value:</b> 360
032     *  <li> <b>Default Value:</b> 0
033     *  <li> <b>Units:</b> deg
034     *  </ul>
035     */
036    public double MountPoseYaw = 0;
037    /**
038     * The mounting calibration pitch-component
039     *
040     *  <ul>
041     *  <li> <b>Minimum Value:</b> -360
042     *  <li> <b>Maximum Value:</b> 360
043     *  <li> <b>Default Value:</b> 0
044     *  <li> <b>Units:</b> deg
045     *  </ul>
046     */
047    public double MountPosePitch = 0;
048    /**
049     * The mounting calibration roll-component
050     *
051     *  <ul>
052     *  <li> <b>Minimum Value:</b> -360
053     *  <li> <b>Maximum Value:</b> 360
054     *  <li> <b>Default Value:</b> 0
055     *  <li> <b>Units:</b> deg
056     *  </ul>
057     */
058    public double MountPoseRoll = 0;
059
060    @Override
061    public String toString()
062    {
063        String ss = "Config Group: MountPose\n";
064        ss += "Name: \"MountPoseYaw\" Value: \"" + MountPoseYaw + "deg\"" + "\n";
065        ss += "Name: \"MountPosePitch\" Value: \"" + MountPosePitch + "deg\"" + "\n";
066        ss += "Name: \"MountPoseRoll\" Value: \"" + MountPoseRoll + "deg\"" + "\n";
067        return ss;
068    }
069
070    /**
071     *
072     */
073    public StatusCode deserialize(String string)
074    {
075        MountPoseYaw = ConfigJNI.Deserializedouble(SpnValue.Pigeon2MountPoseYaw.value, string);
076        MountPosePitch = ConfigJNI.Deserializedouble(SpnValue.Pigeon2MountPosePitch.value, string);
077        MountPoseRoll = ConfigJNI.Deserializedouble(SpnValue.Pigeon2MountPoseRoll.value, string);
078        return  StatusCode.OK;
079    }
080
081    /**
082     *
083     */
084    public String serialize()
085    {
086        String ss = "";
087        ss += ConfigJNI.Serializedouble(952, MountPoseYaw);
088        ss += ConfigJNI.Serializedouble(953, MountPosePitch);
089        ss += ConfigJNI.Serializedouble(954, MountPoseRoll);
090        return ss;
091    }
092}
093