diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c88df2f..8eb6b39a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ if(BUILD_CLOUD_CLIENT) $ $ ) - target_compile_definitions(ruckig PUBLIC WITH_CLOUD_CLIENT WITH_SERIALIZATION) + target_compile_definitions(ruckig PUBLIC WITH_CLOUD_CLIENT) endif() diff --git a/include/ruckig/brake.hpp b/include/ruckig/brake.hpp index 8fb9e4a2..3695ac54 100644 --- a/include/ruckig/brake.hpp +++ b/include/ruckig/brake.hpp @@ -4,10 +4,6 @@ #include #include -#ifdef WITH_SERIALIZATION -#include -#endif - #include @@ -73,10 +69,6 @@ class BrakeProfile { v[0] = vs; std::tie(ps, vs, as) = integrate(t[0], ps, vs, a[0], 0.0); } - -#ifdef WITH_SERIALIZATION - NLOHMANN_DEFINE_TYPE_INTRUSIVE(BrakeProfile, duration, t, j, a, v, p) -#endif }; } // namespace ruckig diff --git a/include/ruckig/calculator_cloud.hpp b/include/ruckig/calculator_cloud.hpp index 02f8a950..25add575 100644 --- a/include/ruckig/calculator_cloud.hpp +++ b/include/ruckig/calculator_cloud.hpp @@ -31,6 +31,10 @@ class CloudClient { }; +NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(BrakeProfile, duration, t, j, a, v, p) +NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Profile, t, t_sum, j, a, v, p, pf, vf, af, brake, accel) + + //! Calculation class for a trajectory along waypoints. template class CustomVector = StandardVector> class WaypointsCalculator { diff --git a/include/ruckig/profile.hpp b/include/ruckig/profile.hpp index 0dbd5963..51dce461 100644 --- a/include/ruckig/profile.hpp +++ b/include/ruckig/profile.hpp @@ -8,10 +8,6 @@ #include #include -#ifdef WITH_SERIALIZATION -#include -#endif - #include #include #include @@ -29,7 +25,9 @@ struct PositionExtrema { }; -//! A single-dof kinematic profile with position, velocity, acceleration and jerk +//! @brief A single-dof kinematic profile with position, velocity, acceleration and jerk +//! +//! The class members are only available in the Ruckig Community Version. class Profile { constexpr static double v_eps {1e-12}; constexpr static double a_eps {1e-12}; @@ -529,10 +527,6 @@ class Profile { } return result; } - -#ifdef WITH_SERIALIZATION - NLOHMANN_DEFINE_TYPE_INTRUSIVE(Profile, t, t_sum, j, a, v, p, pf, vf, af, brake, accel) -#endif }; } // namespace ruckig diff --git a/include/ruckig/trajectory.hpp b/include/ruckig/trajectory.hpp index 3fab06d3..cb028fcd 100644 --- a/include/ruckig/trajectory.hpp +++ b/include/ruckig/trajectory.hpp @@ -15,7 +15,7 @@ template class> class TargetCalculator; template class> class WaypointsCalculator; -//! Interface for the generated trajectory. +//! The trajectory generated by the Ruckig algorithm. template class CustomVector = StandardVector> class Trajectory { #if defined WITH_CLOUD_CLIENT @@ -245,7 +245,7 @@ class Trajectory { } - //! Get the underlying profiles of the trajectory + //! Get the underlying profiles of the trajectory (only in the Ruckig Community Version) Container> get_profiles() const { return profiles; } diff --git a/test/plot_waypoints.py b/test/plot_waypoints.py index aad7243e..5afa3acc 100644 --- a/test/plot_waypoints.py +++ b/test/plot_waypoints.py @@ -60,7 +60,7 @@ def walk_through_trajectory(otg, inp): i = 1 while out_list[i].new_calculation: print(f'{i}\tCalculation duration: {out_list[i].calculation_duration:0.1f} [µs]') - print(f'\tTrajectory duration: {i*otg.delta_time + out_list[i].trajectory.duration:0.4f} [s]') + print(f'\tTrajectory duration: {i * otg.delta_time + out_list[i].trajectory.duration:0.4f} [s]') i += 1 Plotter.plot_trajectory('otg_trajectory.png', otg, inp, out_list, plot_jerk=False, time_offsets=time_offsets) diff --git a/test/plotter.py b/test/plotter.py index 92fd0f75..fc2f153b 100644 --- a/test/plotter.py +++ b/test/plotter.py @@ -32,13 +32,13 @@ def plot_trajectory(filename, otg, inp, out_list, show=False, plot_acceleration= global_min = min(global_min, np.min(dddqaxis[:, dof])) plt.subplot(inp.degrees_of_freedom, 1, dof + 1) - plt.ylabel(f'DoF {dof+1}') - plt.plot(taxis, qaxis[:, dof], label=f'Position {dof+1}') - plt.plot(taxis, dqaxis[:, dof], label=f'Velocity {dof+1}') + plt.ylabel(f'DoF {dof + 1}') + plt.plot(taxis, qaxis[:, dof], label=f'Position {dof + 1}') + plt.plot(taxis, dqaxis[:, dof], label=f'Velocity {dof + 1}') if plot_acceleration: - plt.plot(taxis, ddqaxis[:, dof], label=f'Acceleration {dof+1}') + plt.plot(taxis, ddqaxis[:, dof], label=f'Acceleration {dof + 1}') if plot_jerk: - plt.plot(taxis, dddqaxis[:, dof], label=f'Jerk {dof+1}') + plt.plot(taxis, dddqaxis[:, dof], label=f'Jerk {dof + 1}') # Plot sections if hasattr(out_list[-1], 'trajectory'):