// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #include #include #include #include "edu_wpi_first_math_jni_StateSpaceUtilJNI.h" #include "frc/StateSpaceUtil.h" using namespace wpi::java; extern "C" { /* * Class: edu_wpi_first_math_jni_StateSpaceUtilJNI * Method: isStabilizable * Signature: (II[D[D)Z */ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_math_jni_StateSpaceUtilJNI_isStabilizable (JNIEnv* env, jclass, jint states, jint inputs, jdoubleArray aSrc, jdoubleArray bSrc) { JSpan nativeA{env, aSrc}; JSpan nativeB{env, bSrc}; Eigen::Map> A{nativeA.data(), states, states}; Eigen::Map> B{nativeB.data(), states, inputs}; bool isStabilizable = frc::IsStabilizable(A, B); return isStabilizable; } } // extern "C"