diff --git a/README.md b/README.md index c9f6c8f9..8461c378 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ See [the Doxygen documentation](http://docs.ros.org/melodic/api/trackjoint/html/ ## Formatting -Use `clang_this_directory_google` +Use the clang format file in the root directory. + + cd $CATKIN_WS/src/trackjoint + clang_this_directory_custom 10 ## Hints for Tuning diff --git a/include/trackjoint/error_codes.h b/include/trackjoint/error_codes.h index f5156a06..1c468f9c 100644 --- a/include/trackjoint/error_codes.h +++ b/include/trackjoint/error_codes.h @@ -37,6 +37,7 @@ enum ErrorCodeEnum /** * \brief Use this map to look up human-readable strings for each error code */ +// clang-format off const std::unordered_map ERROR_CODE_MAP( { { NO_ERROR, "No error, trajectory generation was successful" }, { DESIRED_DURATION_TOO_SHORT, "Desired duration is too short, cannot have less than one timestep in a " @@ -50,4 +51,5 @@ const std::unordered_map ERROR_CODE_MAP( { FAILURE_TO_GENERATE_SINGLE_WAYPOINT, "Failed to generate even a single new waypoint" }, { LESS_THAN_TEN_TIMESTEPS_FOR_STREAMING_MODE, "In streaming mode, desired duration should be at least 10 " "timesteps" } }); +// clang-format on } // end namespace trackjoint diff --git a/include/trackjoint/trajectory_generator.h b/include/trackjoint/trajectory_generator.h index 4e4dc14a..8018e212 100644 --- a/include/trackjoint/trajectory_generator.h +++ b/include/trackjoint/trajectory_generator.h @@ -77,8 +77,8 @@ class TrajectoryGenerator * input goal_joint_states vector of the target kinematic states for each degree of freedom * input limits vector of kinematic limits for each degree of freedom * input nominal_timestep the user-requested time between waypoints - * returna TrackJoint status code - */ + * return a TrackJoint status code + */ ErrorCodeEnum inputChecking(const std::vector& current_joint_states, const std::vector& goal_joint_states, const std::vector& limits, double nominal_timestep); @@ -87,7 +87,7 @@ class TrajectoryGenerator /** \brief Ensure limits are obeyed before outputting. * * input trajectory the calculated trajectories for n joints - */ + */ void clipVectorsForOutput(std::vector* trajectory); /** \brief upsample if num. waypoints would be short. Helps with accuracy. */ @@ -100,7 +100,7 @@ class TrajectoryGenerator * input velocity_vector a vector of velocities * input acceleration_vector a vector of accelerations * input jerk_vector a vector of jerks - */ + */ void downSample(Eigen::VectorXd* time_vector, Eigen::VectorXd* position_vector, Eigen::VectorXd* velocity_vector, Eigen::VectorXd* acceleration_vector, Eigen::VectorXd* jerk_vector); @@ -108,7 +108,7 @@ class TrajectoryGenerator * * input output_trajectories the calculated trajectories for n joints * returna TrackJoint status code - */ + */ ErrorCodeEnum synchronizeTrajComponents(std::vector* output_trajectories); // TODO(andyz): set this back to a small number when done testing diff --git a/include/trackjoint/utilities.h b/include/trackjoint/utilities.h index 0357c42e..dd7dfaac 100644 --- a/include/trackjoint/utilities.h +++ b/include/trackjoint/utilities.h @@ -35,7 +35,7 @@ Eigen::VectorXd DiscreteDifferentiation(const Eigen::VectorXd& input_vector, dou * input joint the index of a joint * input output_trajectories the calculated trajectories for n joints * input desired_duration the user-requested duration of the trajectory -*/ + */ void PrintJointTrajectory(const std::size_t joint, const std::vector& output_trajectories, const double desired_duration); diff --git a/test/trajectory_generation_test.cpp b/test/trajectory_generation_test.cpp index 5bde2e57..120cefcf 100644 --- a/test/trajectory_generation_test.cpp +++ b/test/trajectory_generation_test.cpp @@ -535,13 +535,12 @@ TEST_F(TrajectoryGenerationTest, OscillatingUR5TrackJointCase) std::vector> moveit_times_from_start; // Reading MoveIt experimental data from .txt files - moveit_des_positions = loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/moveit_des_pos.txt"); - moveit_des_velocities = - loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/moveit_des_vel.txt"); - moveit_des_accelerations = - loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/moveit_des_acc.txt"); - moveit_times_from_start = - loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/moveit_time_from_start.txt"); + moveit_des_velocities = loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/" + "moveit_des_vel.txt"); + moveit_des_accelerations = loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/" + "moveit_des_acc.txt"); + moveit_times_from_start = loadWaypointsFromFile(REF_PATH + "/test/data/30_percent_speed_oscillation/" + "moveit_time_from_start.txt"); // For each MoveIt waypoint for (std::size_t point = 0; point < moveit_times_from_start.size() - 1; ++point)