Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment thread
AndyZe marked this conversation as resolved.

cd $CATKIN_WS/src/trackjoint
clang_this_directory_custom 10

## Hints for Tuning

Expand Down
2 changes: 2 additions & 0 deletions include/trackjoint/error_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint, std::string> 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 "
Expand All @@ -50,4 +51,5 @@ const std::unordered_map<uint, std::string> 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
10 changes: 5 additions & 5 deletions include/trackjoint/trajectory_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<KinematicState>& current_joint_states,
const std::vector<KinematicState>& goal_joint_states, const std::vector<Limits>& limits,
double nominal_timestep);
Expand All @@ -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<JointTrajectory>* trajectory);

/** \brief upsample if num. waypoints would be short. Helps with accuracy. */
Expand All @@ -100,15 +100,15 @@ 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);

/** \brief Synchronize all trajectories with the one of longest duration.
*
* input output_trajectories the calculated trajectories for n joints
* returna TrackJoint status code
*/
*/
ErrorCodeEnum synchronizeTrajComponents(std::vector<JointTrajectory>* output_trajectories);

// TODO(andyz): set this back to a small number when done testing
Expand Down
2 changes: 1 addition & 1 deletion include/trackjoint/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<JointTrajectory>& output_trajectories,
const double desired_duration);

Expand Down
13 changes: 6 additions & 7 deletions test/trajectory_generation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,12 @@ TEST_F(TrajectoryGenerationTest, OscillatingUR5TrackJointCase)
std::vector<std::vector<double>> 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)
Expand Down