-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started JNI cursed bs crashes for now
Signed-off-by: Jade Turner <[email protected]>
- Loading branch information
1 parent
0b10ae0
commit 8ebacc3
Showing
16 changed files
with
258 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/org/curtinfrc/frc2025/auto/TrajectoryGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.curtinfrc.frc2025.auto; | ||
|
||
public class TrajectoryGenerator { | ||
public static void main(String... args) { | ||
TrajgenJNI.helloWorld(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.curtinfrc.frc2025.auto; | ||
|
||
import edu.wpi.first.util.RuntimeLoader; | ||
import java.io.IOException; | ||
|
||
public class TrajgenJNI { | ||
static { | ||
try { | ||
RuntimeLoader.loadLibrary("TrajgenJNI"); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
public static native void helloWorld(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "TrajectoryGeneration.h" | ||
#include "trajopt/SwerveTrajectoryGenerator.hpp" | ||
#include "trajopt/path/Path.hpp" | ||
#include <vector> | ||
|
||
trajopt::SwerveSolution trajgen::CreateInitialGuess(std::vector<trajopt::Waypoint> trajectory) { | ||
return trajopt::SwerveSolution{}; | ||
} | ||
|
||
trajopt::SwerveTrajectory trajgen::Generate(InputTrajectory trajectory) { | ||
return trajopt::SwerveTrajectory{}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <jni.h> | ||
#include <wpi/array.h> | ||
#include <wpi/jni_util.h> | ||
|
||
#include "fmt/base.h" | ||
#include "jni_md.h" | ||
|
||
extern "C" { | ||
/* | ||
* Class: frc_robot_jni_ShooterTrajoptJNI | ||
* Method: calculateTrajectory | ||
* Signature: ([D????)V | ||
*/ | ||
JNIEXPORT void JNICALL | ||
Java_org_curtinfrc_frc2025_auto_TrajgenJNI_helloWorld | ||
(JNIEnv* env, jclass) | ||
{ | ||
fmt::println("Hello world!"); | ||
} | ||
} // extern "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "trajopt/SwerveTrajectoryGenerator.hpp" | ||
#include "trajopt/constraint/Constraint.hpp" | ||
#include "trajopt/path/Path.hpp" | ||
#include <vector> | ||
|
||
namespace trajgen { | ||
struct InputTrajectory { | ||
std::vector<trajopt::Waypoint> waypoints; | ||
std::vector<trajopt::Constraint> constraints; | ||
}; | ||
|
||
trajopt::SwerveSolution CreateInitialGuess(std::vector<trajopt::Waypoint> waypoints); | ||
trajopt::SwerveTrajectory Generate(InputTrajectory trajectory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
trajoptlib/build/tmp/compileTrajoptLibDebugSharedLibraryTrajoptLibCpp/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
See file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibDebugSharedLibraryTrajoptLibCpp/output.txt for all output for compileTrajoptLibDebugSharedLibraryTrajoptLibCpp. | ||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
compiling Cancellation.cpp successful. | ||
|
||
compiling SwerveTrajectoryGenerator.cpp successful. | ||
|
||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
Finished compileTrajoptLibDebugSharedLibraryTrajoptLibCpp, see full log file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibDebugSharedLibraryTrajoptLibCpp/output.txt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
trajoptlib/build/tmp/compileTrajoptLibDebugStaticLibraryTrajoptLibCpp/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
See file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibDebugStaticLibraryTrajoptLibCpp/output.txt for all output for compileTrajoptLibDebugStaticLibraryTrajoptLibCpp. | ||
compiling Cancellation.cpp successful. | ||
|
||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
compiling SwerveTrajectoryGenerator.cpp successful. | ||
|
||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
Finished compileTrajoptLibDebugStaticLibraryTrajoptLibCpp, see full log file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibDebugStaticLibraryTrajoptLibCpp/output.txt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
trajoptlib/build/tmp/compileTrajoptLibReleaseStaticLibraryTrajoptLibCpp/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
See file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibReleaseStaticLibraryTrajoptLibCpp/output.txt for all output for compileTrajoptLibReleaseStaticLibraryTrajoptLibCpp. | ||
compiling Cancellation.cpp successful. | ||
|
||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
compiling SwerveTrajectoryGenerator.cpp successful. | ||
|
||
compiling DifferentialTrajectoryGenerator.cpp successful. | ||
|
||
Finished compileTrajoptLibReleaseStaticLibraryTrajoptLibCpp, see full log file:///home/jadey/Documents/frc/2025-Reefscape/trajoptlib/build/tmp/compileTrajoptLibReleaseStaticLibraryTrajoptLibCpp/output.txt. |
Oops, something went wrong.