001/* 002 * Software License Agreement 003 * 004 * Copyright (C) Cross The Road Electronics. All rights 005 * reserved. 006 * 007 * Cross The Road Electronics (CTRE) licenses to you the right to 008 * use, publish, and distribute copies of CRF (Cross The Road) firmware files ( *.crf) and Software 009 * API Libraries ONLY when in use with Cross The Road Electronics hardware products. 010 * 011 * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT 012 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT 013 * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A 014 * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL 015 * CROSS THE ROAD ELECTRONICS BE LIABLE FOR ANY INCIDENTAL, SPECIAL, 016 * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF 017 * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS 018 * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE 019 * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER 020 * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT 021 * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE 022 */ 023package com.ctre.phoenix.sensors; 024import com.ctre.phoenix.CTREJNIWrapper; 025 026 027public class PigeonImuJNI extends CTREJNIWrapper { 028 029 public static native long JNI_new_PigeonImu_Talon(int talonID, String version); 030 031 public static native long JNI_new_PigeonImu(int deviceNumber, String version, String canbus); 032 033 public static native int JNI_destroy_PigeonImu(long handle); 034 035 //public static native void JNI_destroy_AllPigeonImus(); 036 037 public static native int JNI_ConfigSetCustomParam(long handle, int newValue, int paramIndex, int timeoutMs); 038 039 public static native int JNI_ConfigGetCustomParam(long handle, int paramIndex, int timoutMs); 040 041 public static native int JNI_ConfigSetParameter(long handle, int param, double value, int subValue, int ordinal, 042 int timeoutMs); 043 044 public static native double JNI_ConfigGetParameter(long handle, int param, int ordinal, int timeoutMs); 045 046 public static native int JNI_ConfigFactoryDefault(long handle, int timeoutMs); 047 048 public static native int JNI_SetStatusFramePeriod(long handle, int statusFrame, int periodMs, int timeoutMs); 049 050 public static native int JNI_SetYaw(long handle, double angleDeg, int timeoutMs); 051 052 public static native int JNI_AddYaw(long handle, double angleDeg, int timeoutMs); 053 054 public static native int JNI_SetYawToCompass(long handle, int timeoutMs); 055 056 public static native int JNI_SetFusedHeading(long handle, double angleDeg, int timeoutMs); 057 058 public static native int JNI_AddFusedHeading(long handle, double angleDeg, int timeoutMs); 059 060 public static native int JNI_SetFusedHeadingToCompass(long handle, int timeoutMs); 061 062 public static native int JNI_SetAccumZAngle(long handle, double angleDeg, int timeoutMs); 063 064 public static native int JNI_SetTemperatureCompensationDisable(long handle, int bTempCompDisable, int timeoutMs); 065 066 public static native int JNI_SetCompassDeclination(long handle, double angleDegOffset, int timeoutMs); 067 068 public static native int JNI_SetCompassAngle(long handle, double angleDeg, int timeoutMs); 069 070 public static native int JNI_EnterCalibrationMode(long handle, int calMode, int timeoutMs); 071 072 public static native int JNI_GetGeneralStatus(long handle, double [] params); 073 074 public static native int JNI_Get6dQuaternion(long handle, double [] wxyz ); 075 076 public static native int JNI_GetYawPitchRoll(long handle, double [] ypr); 077 078 public static native int JNI_GetYawPitchRoll2(long handle, double [] ypr); 079 080 public static native double JNI_GetYaw(long handle); 081 082 public static native double JNI_GetPitch(long handle); 083 084 public static native double JNI_GetRoll(long handle); 085 086 public static native int JNI_GetGravityVector(long handle, double [] gravityVector); 087 088 public static native int JNI_GetAccumGyro(long handle, double [] xyz_deg); 089 090 public static native double JNI_GetAbsoluteCompassHeading(long handle); 091 092 public static native double JNI_GetCompassHeading(long handle); 093 094 public static native double JNI_GetCompassFieldStrength(long handle); 095 096 public static native double JNI_GetTemp(long handle); 097 098 public static native int JNI_GetUpTime(long handle); 099 100 public static native int JNI_GetRawMagnetometer(long handle, short [] rm_xyz); 101 102 public static native int JNI_GetBiasedMagnetometer(long handle, short [] bm_xyz); 103 104 public static native int JNI_GetBiasedAccelerometer(long handle, short [] ba_xyz); 105 106 public static native int JNI_GetRawGyro(long handle, double [] xyz_dps); 107 108 public static native int JNI_GetAccelerometerAngles(long handle, double [] tiltAngles); 109 110 public static native int JNI_GetFusedHeading(long handle, double [] params); 111 112 public static native int JNI_GetState(long handle); 113 114 public static native int JNI_GetResetCount(long handle); 115 116 public static native int JNI_GetResetFlags(long handle); 117 118 public static native int JNI_GetFirmwareVersion(long handle); 119 120 public static native int JNI_GetLastError(long handle); 121 122 public static native double JNI_GetLastTimestamp(long handle); 123 124 public static native boolean JNI_HasResetOccurred(long handle); 125 126 public static native int JNI_GetStatusFramePeriod(long handle, int frame, int timeoutMs); 127 128 public static native int JNI_SetControlFramePeriod(long handle, int frame, int periodMs); 129 130 public static native int JNI_GetFaults(long handle); 131 132 public static native int JNI_GetStickyFaults(long handle); 133 134 public static native int JNI_ClearStickyFaults(long handle, int timeoutMs); 135 136}