Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Remove unused exception classes (#109)
Browse files Browse the repository at this point in the history
We don't throw them anywhere, so there's no reason to catch them.
  • Loading branch information
calcmogul authored Feb 27, 2024
1 parent f3bee63 commit 9ecf496
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 110 deletions.
1 change: 0 additions & 1 deletion examples/Swerve/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <numbers>
#include <vector>

#include <trajopt/IncompatibleTrajectoryException.h>
#include <trajopt/OptimalTrajectoryGenerator.h>
#include <trajopt/constraint/Constraint.h>
#include <trajopt/constraint/TranslationConstraint.h>
Expand Down
34 changes: 0 additions & 34 deletions include/trajopt/IncompatibleTrajectoryException.h

This file was deleted.

32 changes: 0 additions & 32 deletions include/trajopt/InvalidPathException.h

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

public final class OptimalTrajectoryGenerator {
private native HolonomicTrajectory generateHolonomicTrajectory(SwerveDrivetrain swerveDrivetrain,
HolonomicPath holonomicPath) throws InvalidPathException, TrajectoryGenerationException;
HolonomicPath holonomicPath) throws TrajectoryGenerationException;

public static HolonomicTrajectory generate(SwerveDrivetrain swerveDrivetrain, HolonomicPath holonomicPath)
throws NullPointerException, InvalidPathException, PluginLoadException, TrajectoryGenerationException {
throws NullPointerException, PluginLoadException, TrajectoryGenerationException {
PluginLoader.loadPlugin();
return new OptimalTrajectoryGenerator().generateHolonomicTrajectory(
Objects.requireNonNull(swerveDrivetrain, "Holonomic Trajectory Generator swerve drivetrain cannot be null"),
Expand Down
5 changes: 0 additions & 5 deletions jni/TrajoptLibJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "jni.h"
#include "org_sleipnirgroup_trajopt_OptimalTrajectoryGenerator.h"
#include "trajopt/InvalidPathException.h"
#include "trajopt/OptimalTrajectoryGenerator.h"
#include "trajopt/TrajectoryGenerationException.h"
#include "trajopt/constraint/AngularVelocityConstraint.h"
Expand Down Expand Up @@ -459,10 +458,6 @@ Java_org_sleipnirgroup_trajopt_OptimalTrajectoryGenerator_generateHolonomicTraje
auto solution = OptimalTrajectoryGenerator::Generate(path);
auto trajectory = HolonomicTrajectory(solution);
return jHolonomicTrajectoryFromHolonomicTrajectory(env, trajectory);
} catch (const InvalidPathException& e) {
jclass jInvalidPathExceptionClass =
env->FindClass("org/sleipnirgroup/trajopt/InvalidPathException");
env->ThrowNew(jInvalidPathExceptionClass, e.what());
return nullptr;
} catch (const TrajectoryGenerationException& e) {
jclass jTrajectoryGenerationExceptionClass = env->FindClass(
Expand Down
14 changes: 0 additions & 14 deletions src/IncompatibleTrajectoryException.cpp

This file was deleted.

12 changes: 0 additions & 12 deletions src/InvalidPathException.cpp

This file was deleted.

1 change: 0 additions & 1 deletion src/OptimalTrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#define _OPTI_BACKEND SleipnirExpr, SleipnirOpti
#endif
#include "DebugOptions.h"
#include "trajopt/InvalidPathException.h"
#include "trajopt/drivetrain/SwerveDrivetrain.h"
#include "optimization/algorithms/SwerveDiscreteOptimal.h"
#include "trajopt/solution/SwerveSolution.h"
Expand Down

0 comments on commit 9ecf496

Please sign in to comment.