-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I am trying to run the following on the roboRIO:
public void initialize() {
DcMotor motor = new DcMotor(12.0, 5330 * 2.0 * Math.PI / 60.0 / 12.75, 2 * 2.7, 2 * 131.0, 2 * 2.41 * 12.75);
CoupledChassis chassis = new CoupledChassis(motor, motor, 0.0762, 0.5, 25.0);
CoupledCausalTrajGen gen = new CoupledCausalTrajGen(chassis);
TrapezoidalProfile profile = new TrapezoidalProfile();
List<HermiteQuintic.Waypoint> waypoints = new ArrayList<>();
waypoints.add(new HermiteQuintic.Waypoint(Vec2.cartesian(0, 0), Vec2.cartesian(5, 0), Vec2.cartesian(0, 0)));
waypoints.add(new HermiteQuintic.Waypoint(Vec2.cartesian(4, 4), Vec2.cartesian(0, 5), Vec2.cartesian(0, 0)));
List<HermiteQuintic> hermites = HermiteFactory.generateQuintic(waypoints);
ArcParameterizer param = new ArcParameterizer();
param.configure(0.01, 0.01);
List<? extends Curve2d> curves = param.parameterize(hermites);
gen.configure(curves, profile);
CoupledState state = new CoupledState();
for (double t = 0; !state.finished && t < 5; t += 0.01) {
state = gen.generate(state, t);
echo(state);
}
motor.close();
chassis.close();
gen.close();
param.close();
profile.close();
}
private static void echo(CoupledState state) {
Object obj[] = new Object[] {
state.time, state.config.position.x(), state.config.position.y(),
state.config.heading, state.kinematics.distance, state.kinematics.velocity, state.kinematics.acceleration,
state.curvature, 0, 0, 0,
};
log.debug("{}", obj);
}
However, it will crash (sometime before reaching the echo(state); line) with the following message from eigen:
java: /__w/1/s/libs/eigen/Eigen/src/Core/DenseStorage.h:109:
Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array() [with T = double; int Size = 8; int MatrixOrArrayOptions = 0]: Assertion `(internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (15)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed
Other times, the entire command runs successfully.
I am using Pathfinder and Pathfinder-JNI 2.0.0-prealpha.
Running the same code on my local windows environment does seem to crash.