From b39744b5622673d2b9a948b8a0a4e4764bec2d76 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:43:45 -0500 Subject: [PATCH] [wpimath] Remove PathWeaver support (#7813) Also rename file load type in glass to "Field Image JSON". --- .github/workflows/gradle.yml | 2 +- .github/workflows/tools.yml | 29 ---- glass/src/lib/native/cpp/other/Field2D.cpp | 3 +- wpimath/CMakeLists.txt | 1 - .../wpi/first/math/jni/TrajectoryUtilJNI.java | 47 ------ .../first/math/trajectory/TrajectoryUtil.java | 131 ----------------- .../src/main/native/cpp/jni/Exceptions.cpp | 5 +- .../main/native/cpp/jni/TrajectoryUtilJNI.cpp | 139 ------------------ .../native/cpp/trajectory/TrajectoryUtil.cpp | 53 ------- .../include/frc/trajectory/TrajectoryUtil.h | 61 -------- .../first/math/jni/TrajectoryUtilJNITest.java | 16 -- .../math/trajectory/TrajectoryJsonTest.java | 30 ---- .../cpp/trajectory/TrajectoryJsonTest.cpp | 21 --- 13 files changed, 4 insertions(+), 534 deletions(-) delete mode 100644 wpimath/src/main/java/edu/wpi/first/math/jni/TrajectoryUtilJNI.java delete mode 100644 wpimath/src/main/java/edu/wpi/first/math/trajectory/TrajectoryUtil.java delete mode 100644 wpimath/src/main/native/cpp/jni/TrajectoryUtilJNI.cpp delete mode 100644 wpimath/src/main/native/cpp/trajectory/TrajectoryUtil.cpp delete mode 100644 wpimath/src/main/native/include/frc/trajectory/TrajectoryUtil.h delete mode 100644 wpimath/src/test/java/edu/wpi/first/math/jni/TrajectoryUtilJNITest.java delete mode 100644 wpimath/src/test/java/edu/wpi/first/math/trajectory/TrajectoryJsonTest.java delete mode 100644 wpimath/src/test/native/cpp/trajectory/TrajectoryJsonTest.cpp diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5af5a35901..a1941a3e50 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -283,7 +283,7 @@ jobs: needs: [combine] strategy: matrix: - repo: ['SmartDashboard', 'PathWeaver', 'Shuffleboard', 'RobotBuilder'] + repo: ["SmartDashboard", "Shuffleboard", "RobotBuilder"] runs-on: ubuntu-24.04 steps: - uses: peter-evans/repository-dispatch@v3 diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index afed11a67c..e1c01000b0 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -42,32 +42,3 @@ jobs: path: | development retention-days: 1 - - # PathWeaver: - # name: "Build - PathWeaver" - # needs: [build-artifacts] - # runs-on: ubuntu-24.04 - # steps: - # - uses: actions/checkout@v4 - # with: - # repository: wpilibsuite/PathWeaver - # fetch-depth: 0 - # - name: Patch PathWeaver to use local development - # run: sed -i "s/wpilibTools.deps.wpilibVersion.*/wpilibTools.deps.wpilibVersion = \'$YEAR\.424242\.+\'/" dependencies.gradle - # - uses: actions/download-artifact@v4 - # with: - # name: MavenArtifacts - # - uses: actions/setup-java@v4 - # with: - # java-version: 17 - # distribution: 'temurin' - # - name: Move artifacts - # run: mkdir -p ~/releases/maven/development && cp -r edu ~/releases/maven/development - # - name: Build with Gradle - # run: ./gradlew build - # - uses: actions/upload-artifact@v4 - # with: - # name: PathWeaver Build - # path: | - # build/allOutputs/ - # retention-days: 7 diff --git a/glass/src/lib/native/cpp/other/Field2D.cpp b/glass/src/lib/native/cpp/other/Field2D.cpp index 609a75b182..40d5d571dd 100644 --- a/glass/src/lib/native/cpp/other/Field2D.cpp +++ b/glass/src/lib/native/cpp/other/Field2D.cpp @@ -376,7 +376,8 @@ void FieldInfo::DisplaySettings() { if (m_builtin.empty() && ImGui::Button("Load JSON/image...")) { m_fileOpener = std::make_unique( "Choose field JSON/image", "", - std::vector{"PathWeaver JSON File", "*.json", "Image File", + std::vector{"Field Image JSON File", "*.json", + "Image File", "*.jpg *.jpeg *.png *.bmp *.psd *.tga *.gif " "*.hdr *.pic *.ppm *.pgm"}); } diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt index 348fef5e99..ef21f48c6c 100644 --- a/wpimath/CMakeLists.txt +++ b/wpimath/CMakeLists.txt @@ -14,7 +14,6 @@ file( src/main/native/cpp/jni/Exceptions.cpp src/main/native/cpp/jni/Pose3dJNI.cpp src/main/native/cpp/jni/StateSpaceUtilJNI.cpp - src/main/native/cpp/jni/TrajectoryUtilJNI.cpp ) # Java bindings diff --git a/wpimath/src/main/java/edu/wpi/first/math/jni/TrajectoryUtilJNI.java b/wpimath/src/main/java/edu/wpi/first/math/jni/TrajectoryUtilJNI.java deleted file mode 100644 index 7b27240cb3..0000000000 --- a/wpimath/src/main/java/edu/wpi/first/math/jni/TrajectoryUtilJNI.java +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -package edu.wpi.first.math.jni; - -import java.io.IOException; - -/** TrajectoryUtil JNI. */ -public final class TrajectoryUtilJNI extends WPIMathJNI { - /** - * Loads a Pathweaver JSON. - * - * @param path The path to the JSON. - * @return A double array with the trajectory states from the JSON. - * @throws IOException if the JSON could not be read. - */ - public static native double[] fromPathweaverJson(String path) throws IOException; - - /** - * Converts a trajectory into a Pathweaver JSON and saves it. - * - * @param elements The elements of the trajectory. - * @param path The location to save the JSON to. - * @throws IOException if the JSON could not be written. - */ - public static native void toPathweaverJson(double[] elements, String path) throws IOException; - - /** - * Deserializes a trajectory JSON into a double[] of trajectory elements. - * - * @param json The JSON containing the serialized trajectory. - * @return A double array with the trajectory states. - */ - public static native double[] deserializeTrajectory(String json); - - /** - * Serializes the trajectory into a JSON string. - * - * @param elements The elements of the trajectory. - * @return A JSON containing the serialized trajectory. - */ - public static native String serializeTrajectory(double[] elements); - - /** Utility class. */ - private TrajectoryUtilJNI() {} -} diff --git a/wpimath/src/main/java/edu/wpi/first/math/trajectory/TrajectoryUtil.java b/wpimath/src/main/java/edu/wpi/first/math/trajectory/TrajectoryUtil.java deleted file mode 100644 index c710cdbe22..0000000000 --- a/wpimath/src/main/java/edu/wpi/first/math/trajectory/TrajectoryUtil.java +++ /dev/null @@ -1,131 +0,0 @@ -// 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. - -package edu.wpi.first.math.trajectory; - -import edu.wpi.first.math.MathSharedStore; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.jni.TrajectoryUtilJNI; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - -/** Trajectory utilities. */ -public final class TrajectoryUtil { - private TrajectoryUtil() { - throw new UnsupportedOperationException("This is a utility class!"); - } - - /** - * Creates a trajectory from a double[] of elements. - * - * @param elements A double[] containing the raw elements of the trajectory. - * @return A trajectory created from the elements. - */ - private static Trajectory createTrajectoryFromElements(double[] elements) { - // Make sure that the elements have the correct length. - if (elements.length % 7 != 0) { - throw new TrajectorySerializationException( - "An error occurred when converting trajectory elements into a trajectory."); - } - - // Create a list of states from the elements. - List states = new ArrayList<>(); - for (int i = 0; i < elements.length; i += 7) { - states.add( - new Trajectory.State( - elements[i], - elements[i + 1], - elements[i + 2], - new Pose2d(elements[i + 3], elements[i + 4], new Rotation2d(elements[i + 5])), - elements[i + 6])); - } - return new Trajectory(states); - } - - /** - * Returns a double[] of elements from the given trajectory. - * - * @param trajectory The trajectory to retrieve raw elements from. - * @return A double[] of elements from the given trajectory. - */ - private static double[] getElementsFromTrajectory(Trajectory trajectory) { - // Create a double[] of elements and fill it from the trajectory states. - double[] elements = new double[trajectory.getStates().size() * 7]; - - for (int i = 0; i < trajectory.getStates().size() * 7; i += 7) { - var state = trajectory.getStates().get(i / 7); - elements[i] = state.time; - elements[i + 1] = state.velocity; - elements[i + 2] = state.acceleration; - elements[i + 3] = state.pose.getX(); - elements[i + 4] = state.pose.getY(); - elements[i + 5] = state.pose.getRotation().getRadians(); - elements[i + 6] = state.curvature; - } - return elements; - } - - private static int pathWeaverTrajectoryInstances; - - /** - * Imports a Trajectory from a JSON file exported from PathWeaver. - * - * @param path The path of the json file to import from - * @return The trajectory represented by the file. - * @throws IOException if reading from the file fails. - */ - public static Trajectory fromPathweaverJson(Path path) throws IOException { - MathSharedStore.reportUsage( - "Trajectory.PathWeaver", String.valueOf(++pathWeaverTrajectoryInstances)); - return createTrajectoryFromElements(TrajectoryUtilJNI.fromPathweaverJson(path.toString())); - } - - /** - * Exports a Trajectory to a PathWeaver-style JSON file. - * - * @param trajectory The trajectory to export - * @param path The path of the file to export to - * @throws IOException if writing to the file fails. - */ - public static void toPathweaverJson(Trajectory trajectory, Path path) throws IOException { - TrajectoryUtilJNI.toPathweaverJson(getElementsFromTrajectory(trajectory), path.toString()); - } - - /** - * Deserializes a Trajectory from JSON exported from PathWeaver. - * - * @param json The string containing the serialized JSON - * @return the trajectory represented by the JSON - * @throws TrajectorySerializationException if deserialization of the string fails. - */ - public static Trajectory deserializeTrajectory(String json) { - return createTrajectoryFromElements(TrajectoryUtilJNI.deserializeTrajectory(json)); - } - - /** - * Serializes a Trajectory to PathWeaver-style JSON. - * - * @param trajectory The trajectory to export - * @return The string containing the serialized JSON - * @throws TrajectorySerializationException if serialization of the trajectory fails. - */ - public static String serializeTrajectory(Trajectory trajectory) { - return TrajectoryUtilJNI.serializeTrajectory(getElementsFromTrajectory(trajectory)); - } - - /** Exception for trajectory serialization failure. */ - public static class TrajectorySerializationException extends RuntimeException { - /** - * Constructs a TrajectorySerializationException. - * - * @param message The exception message. - */ - public TrajectorySerializationException(String message) { - super(message); - } - } -} diff --git a/wpimath/src/main/native/cpp/jni/Exceptions.cpp b/wpimath/src/main/native/cpp/jni/Exceptions.cpp index 6e217bfafc..948df75454 100644 --- a/wpimath/src/main/native/cpp/jni/Exceptions.cpp +++ b/wpimath/src/main/native/cpp/jni/Exceptions.cpp @@ -18,10 +18,7 @@ JException trajectorySerializationEx; static const JExceptionInit exceptions[] = { {"java/lang/IllegalArgumentException", &illegalArgEx}, - {"java/io/IOException", &ioEx}, - {"edu/wpi/first/math/trajectory/" - "TrajectoryUtil$TrajectorySerializationException", - &trajectorySerializationEx}}; + {"java/io/IOException", &ioEx}}; extern "C" { diff --git a/wpimath/src/main/native/cpp/jni/TrajectoryUtilJNI.cpp b/wpimath/src/main/native/cpp/jni/TrajectoryUtilJNI.cpp deleted file mode 100644 index 62abc36e8e..0000000000 --- a/wpimath/src/main/native/cpp/jni/TrajectoryUtilJNI.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// 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 - -#include "Exceptions.h" -#include "edu_wpi_first_math_jni_TrajectoryUtilJNI.h" -#include "frc/trajectory/TrajectoryUtil.h" - -using namespace wpi::java; - -std::vector GetElementsFromTrajectory( - const frc::Trajectory& trajectory) { - std::vector elements; - elements.reserve(trajectory.States().size() * 7); - - for (auto&& state : trajectory.States()) { - elements.push_back(state.t.value()); - elements.push_back(state.velocity.value()); - elements.push_back(state.acceleration.value()); - elements.push_back(state.pose.X().value()); - elements.push_back(state.pose.Y().value()); - elements.push_back(state.pose.Rotation().Radians().value()); - elements.push_back(state.curvature.value()); - } - - return elements; -} - -frc::Trajectory CreateTrajectoryFromElements(std::span elements) { - // Make sure that the elements have the correct length. - assert(elements.size() % 7 == 0); - - // Create a vector of states from the elements. - std::vector states; - states.reserve(elements.size() / 7); - - for (size_t i = 0; i < elements.size(); i += 7) { - states.emplace_back(frc::Trajectory::State{ - units::second_t{elements[i]}, - units::meters_per_second_t{elements[i + 1]}, - units::meters_per_second_squared_t{elements[i + 2]}, - frc::Pose2d{units::meter_t{elements[i + 3]}, - units::meter_t{elements[i + 4]}, - units::radian_t{elements[i + 5]}}, - units::curvature_t{elements[i + 6]}}); - } - - return frc::Trajectory(states); -} - -extern "C" { - -/* - * Class: edu_wpi_first_math_jni_TrajectoryUtilJNI - * Method: fromPathweaverJson - * Signature: (Ljava/lang/String;)[D - */ -JNIEXPORT jdoubleArray JNICALL -Java_edu_wpi_first_math_jni_TrajectoryUtilJNI_fromPathweaverJson - (JNIEnv* env, jclass, jstring path) -{ - try { - auto trajectory = - frc::TrajectoryUtil::FromPathweaverJson(JStringRef{env, path}.c_str()); - std::vector elements = GetElementsFromTrajectory(trajectory); - return MakeJDoubleArray(env, elements); - } catch (std::exception& e) { - ioEx.Throw(env, e.what()); - return nullptr; - } -} - -/* - * Class: edu_wpi_first_math_jni_TrajectoryUtilJNI - * Method: toPathweaverJson - * Signature: ([DLjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_edu_wpi_first_math_jni_TrajectoryUtilJNI_toPathweaverJson - (JNIEnv* env, jclass, jdoubleArray elements, jstring path) -{ - try { - auto trajectory = - CreateTrajectoryFromElements(JSpan{env, elements}); - frc::TrajectoryUtil::ToPathweaverJson(trajectory, - JStringRef{env, path}.c_str()); - } catch (std::exception& e) { - ioEx.Throw(env, e.what()); - } -} - -/* - * Class: edu_wpi_first_math_jni_TrajectoryUtilJNI - * Method: deserializeTrajectory - * Signature: (Ljava/lang/String;)[D - */ -JNIEXPORT jdoubleArray JNICALL -Java_edu_wpi_first_math_jni_TrajectoryUtilJNI_deserializeTrajectory - (JNIEnv* env, jclass, jstring json) -{ - try { - auto trajectory = frc::TrajectoryUtil::DeserializeTrajectory( - JStringRef{env, json}.c_str()); - std::vector elements = GetElementsFromTrajectory(trajectory); - return MakeJDoubleArray(env, elements); - } catch (std::exception& e) { - trajectorySerializationEx.Throw(env, e.what()); - return nullptr; - } -} - -/* - * Class: edu_wpi_first_math_jni_TrajectoryUtilJNI - * Method: serializeTrajectory - * Signature: ([D)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_edu_wpi_first_math_jni_TrajectoryUtilJNI_serializeTrajectory - (JNIEnv* env, jclass, jdoubleArray elements) -{ - try { - auto trajectory = - CreateTrajectoryFromElements(JSpan{env, elements}); - return MakeJString(env, - frc::TrajectoryUtil::SerializeTrajectory(trajectory)); - } catch (std::exception& e) { - trajectorySerializationEx.Throw(env, e.what()); - return nullptr; - } -} - -} // extern "C" diff --git a/wpimath/src/main/native/cpp/trajectory/TrajectoryUtil.cpp b/wpimath/src/main/native/cpp/trajectory/TrajectoryUtil.cpp deleted file mode 100644 index efc9e79678..0000000000 --- a/wpimath/src/main/native/cpp/trajectory/TrajectoryUtil.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// 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 "frc/trajectory/TrajectoryUtil.h" - -#include -#include - -#include -#include -#include -#include - -using namespace frc; - -void TrajectoryUtil::ToPathweaverJson(const Trajectory& trajectory, - std::string_view path) { - std::error_code error_code; - - wpi::raw_fd_ostream output{path, error_code}; - if (error_code) { - throw std::runtime_error(fmt::format("Cannot open file: {}", path)); - } - - wpi::json json = trajectory.States(); - output << json; - output.flush(); -} - -Trajectory TrajectoryUtil::FromPathweaverJson(std::string_view path) { - auto fileBuffer = wpi::MemoryBuffer::GetFile(path); - if (!fileBuffer) { - throw std::runtime_error(fmt::format("Cannot open file: {}", path)); - } - - wpi::json json = wpi::json::parse(fileBuffer.value()->GetCharBuffer()); - - wpi::math::MathSharedStore::ReportUsage( - "Trajectory.PathWeaver", std::to_string(++pathWeaverTrajectoryInstances)); - - return Trajectory{json.get>()}; -} - -std::string TrajectoryUtil::SerializeTrajectory(const Trajectory& trajectory) { - wpi::json json = trajectory.States(); - return json.dump(); -} - -Trajectory TrajectoryUtil::DeserializeTrajectory(std::string_view jsonStr) { - wpi::json json = wpi::json::parse(jsonStr); - return Trajectory{json.get>()}; -} diff --git a/wpimath/src/main/native/include/frc/trajectory/TrajectoryUtil.h b/wpimath/src/main/native/include/frc/trajectory/TrajectoryUtil.h deleted file mode 100644 index 49f69eba17..0000000000 --- a/wpimath/src/main/native/include/frc/trajectory/TrajectoryUtil.h +++ /dev/null @@ -1,61 +0,0 @@ -// 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. - -#pragma once - -#include -#include - -#include - -#include "frc/trajectory/Trajectory.h" - -namespace frc { -/** - * Trajectory utilities. - */ -class WPILIB_DLLEXPORT TrajectoryUtil { - public: - TrajectoryUtil() = delete; - - /** - * Exports a Trajectory to a PathWeaver-style JSON file. - * - * @param trajectory the trajectory to export - * @param path the path of the file to export to - */ - static void ToPathweaverJson(const Trajectory& trajectory, - std::string_view path); - /** - * Imports a Trajectory from a JSON file exported from PathWeaver. - * - * @param path The path of the json file to import from. - * - * @return The trajectory represented by the file. - */ - static Trajectory FromPathweaverJson(std::string_view path); - - /** - * Deserializes a Trajectory from JSON exported from PathWeaver. - * - * @param trajectory the trajectory to export - * - * @return the string containing the serialized JSON - */ - static std::string SerializeTrajectory(const Trajectory& trajectory); - - /** - * Serializes a Trajectory to PathWeaver-style JSON. - * - * @param jsonStr the string containing the serialized JSON - * - * @return the trajectory represented by the JSON - */ - static Trajectory DeserializeTrajectory(std::string_view jsonStr); - - private: - // Usage reporting for PathWeaver Trajectory instances - inline static int pathWeaverTrajectoryInstances = 0; -}; -} // namespace frc diff --git a/wpimath/src/test/java/edu/wpi/first/math/jni/TrajectoryUtilJNITest.java b/wpimath/src/test/java/edu/wpi/first/math/jni/TrajectoryUtilJNITest.java deleted file mode 100644 index 9513995f13..0000000000 --- a/wpimath/src/test/java/edu/wpi/first/math/jni/TrajectoryUtilJNITest.java +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -package edu.wpi.first.math.jni; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; - -import org.junit.jupiter.api.Test; - -public class TrajectoryUtilJNITest { - @Test - public void testLink() { - assertDoesNotThrow(TrajectoryUtilJNI::forceLoad); - } -} diff --git a/wpimath/src/test/java/edu/wpi/first/math/trajectory/TrajectoryJsonTest.java b/wpimath/src/test/java/edu/wpi/first/math/trajectory/TrajectoryJsonTest.java deleted file mode 100644 index 3c6627fb3f..0000000000 --- a/wpimath/src/test/java/edu/wpi/first/math/trajectory/TrajectoryJsonTest.java +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -package edu.wpi.first.math.trajectory; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import edu.wpi.first.math.kinematics.DifferentialDriveKinematics; -import edu.wpi.first.math.trajectory.constraint.DifferentialDriveKinematicsConstraint; -import java.util.List; -import org.junit.jupiter.api.Test; - -class TrajectoryJsonTest { - @Test - void deserializeMatches() { - var config = - List.of(new DifferentialDriveKinematicsConstraint(new DifferentialDriveKinematics(0.5), 3)); - var trajectory = TrajectoryGeneratorTest.getTrajectory(config); - - var deserialized = - assertDoesNotThrow( - () -> - TrajectoryUtil.deserializeTrajectory( - TrajectoryUtil.serializeTrajectory(trajectory))); - - assertEquals(trajectory.getStates(), deserialized.getStates()); - } -} diff --git a/wpimath/src/test/native/cpp/trajectory/TrajectoryJsonTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrajectoryJsonTest.cpp deleted file mode 100644 index 9411696002..0000000000 --- a/wpimath/src/test/native/cpp/trajectory/TrajectoryJsonTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// 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 "frc/trajectory/TrajectoryConfig.h" -#include "frc/trajectory/TrajectoryUtil.h" -#include "trajectory/TestTrajectory.h" - -using namespace frc; - -TEST(TrajectoryJsonTest, DeserializeMatches) { - TrajectoryConfig config{12_fps, 12_fps_sq}; - auto trajectory = TestTrajectory::GetTrajectory(config); - - Trajectory deserialized; - EXPECT_NO_THROW(deserialized = TrajectoryUtil::DeserializeTrajectory( - TrajectoryUtil::SerializeTrajectory(trajectory))); - EXPECT_EQ(trajectory.States(), deserialized.States()); -}