Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sjahr committed Oct 6, 2024
1 parent aed419a commit 5e14588
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 18 additions & 0 deletions include/moveit/drake/conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,26 @@ namespace moveit::drake
const std::string& group_name,
const ::drake::multibody::MultibodyPlant<double>& plant);

/**
* @brief Copy velocity bounds from joint model group to Eigen vectors
*
* @param joint_model_group Joint model group to get velocity bounds from
* @param plant Drake MultiBody Plant, used to get model information
* @param lower_velocity_bounds Lower velocity bounds populated by this function
* @param upper_velocity_bounds Upper velocity bounds populated by this function
*/
void getVelocityBounds(const moveit::core::JointModelGroup* joint_model_group,
const ::drake::multibody::MultibodyPlant<double>& plant, Eigen::VectorXd& lower_velocity_bounds,
Eigen::VectorXd& upper_velocity_bounds);

/**
* @brief Get the Acceleration Bounds object
*
* @param joint_model_group Joint model group to get acceleration bounds from
* @param plant Drake model plant, used to get model information
* @param lower_acceleration_bounds Lower acceleration bounds ppulated by this function
* @param upper_acceleration_bounds Upper acceleration bounds populated by this function
*/
void getAccelerationBounds(const moveit::core::JointModelGroup* joint_model_group,
const ::drake::multibody::MultibodyPlant<double>& plant,
Eigen::VectorXd& lower_acceleration_bounds, Eigen::VectorXd& upper_acceleration_bounds);
Expand All @@ -87,6 +103,7 @@ void getAccelerationBounds(const moveit::core::JointModelGroup* joint_model_grou
*
* @param robot_trajectory MoveIt trajectory to be translated
* @param group Joint group for which a piecewise polynomial is created
* @param plant Drake Multibody Plant, used to get model information
* @return ::drake::trajectories::PiecewisePolynomial<double>
*/
[[nodiscard]] ::drake::trajectories::PiecewisePolynomial<double>
Expand All @@ -100,6 +117,7 @@ getPiecewisePolynomial(const ::robot_trajectory::RobotTrajectory& robot_trajecto
*
* @param drake_trajectory Drake trajectory
* @param delta_t Time step size
* @param plant Drake Multibody Plant, used to get model information
* @param moveit_trajectory MoveIt trajectory to be populated based on the piecewise polynomial
*/
void getRobotTrajectory(const ::drake::trajectories::Trajectory<double>& drake_trajectory, const double delta_t,
Expand Down
3 changes: 1 addition & 2 deletions src/add_toppra_time_parameterization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class AddToppraTimeParameterization : public planning_interface::PlanningRespons
// Create drake::trajectories::Trajectory from moveit trajectory
auto input_path = getPiecewisePolynomial(*res.trajectory, joint_model_group, plant);

input_path.end_time(input_path.end_time() * 2);
// Run toppra
const auto grid_points = Toppra::CalcGridPoints(input_path, CalcGridPointsOptions());
auto toppra = Toppra(input_path, plant, grid_points);
Expand Down Expand Up @@ -235,7 +234,7 @@ class AddToppraTimeParameterization : public planning_interface::PlanningRespons
std::unique_ptr<Diagram<double>> diagram_;
std::unique_ptr<Context<double>> diagram_context_;

// Temporary visualization
// Optional visualization
std::shared_ptr<Meshcat> meshcat_;
MeshcatVisualizer<double>* visualizer_;
};
Expand Down

0 comments on commit 5e14588

Please sign in to comment.