From e47c2b33abf3d1c0c873e2a133cf62a579301a4c Mon Sep 17 00:00:00 2001 From: AndyZe Date: Mon, 13 Jul 2020 12:02:27 -0500 Subject: [PATCH 1/4] Update Readme that we are not using Google style --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c9f6c8f9..ff2973eb 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ 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. ## Hints for Tuning From 58208d8bd8aed012d51f8682fb8e990626187aa2 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Sun, 20 Sep 2020 17:00:29 -0500 Subject: [PATCH 2/4] Update README.md Co-authored-by: Nathan Brooks --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ff2973eb..3486c0ec 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ See [the Doxygen documentation](http://docs.ros.org/melodic/api/trackjoint/html/ Use the clang format file in the root directory. + cd $CATKIN_WS/src/trackjoint + clang_this_directory_custom 3.9 + ## Hints for Tuning Usually a robot manufacturer provides joint velocity limits. It can be difficult to set joint acceleration or jerk limits when the manufacturer does not provide them. Here are some hints to help choose reasonable values: From 10fdee7cea2801cb632fe4c042a65307c54a6196 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Mon, 21 Sep 2020 08:22:15 -0500 Subject: [PATCH 3/4] Turn off clang format for error code map. Clang format. --- include/trackjoint/error_codes.h | 2 ++ include/trackjoint/trajectory_generator.h | 10 +++++----- include/trackjoint/utilities.h | 2 +- test/trajectory_generation_test.cpp | 13 ++++++------- 4 files changed, 14 insertions(+), 13 deletions(-) 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) From 26782010e85b902d5e7510fdfd82c91fa1690f12 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Tue, 23 Nov 2021 14:01:28 -0600 Subject: [PATCH 4/4] Update clang version from 3.9 to 10 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3486c0ec..8461c378 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ See [the Doxygen documentation](http://docs.ros.org/melodic/api/trackjoint/html/ Use the clang format file in the root directory. cd $CATKIN_WS/src/trackjoint - clang_this_directory_custom 3.9 + clang_this_directory_custom 10 ## Hints for Tuning