Represents a discretized joint-space trajectory for CHOMP. More...
#include <chomp_trajectory.h>
Public Member Functions | |
void | assignCHOMPTrajectoryPointFromRobotState (const moveit::core::RobotState &source, size_t chomp_trajectory_point, const moveit::core::JointModelGroup *group) |
This function assigns the given source RobotState to the row at index chomp_trajectory_point. More... | |
ChompTrajectory (const ChompTrajectory &source_traj, const std::string &group_name, int diff_rule_length) | |
Creates a new containing only the joints of interest, and adds padding to the start and end if needed, to have enough trajectory points for the differentiation rules. More... | |
ChompTrajectory (const moveit::core::RobotModelConstPtr &robot_model, const std::string &group_name, const trajectory_msgs::JointTrajectory &traj) | |
ChompTrajectory (const moveit::core::RobotModelConstPtr &robot_model, double duration, double discretization, const std::string &group_name) | |
Constructs a trajectory for a given robot model, trajectory duration, and discretization. More... | |
ChompTrajectory (const moveit::core::RobotModelConstPtr &robot_model, size_t num_points, double discretization, const std::string &group_name) | |
Constructs a trajectory for a given robot model, number of trajectory points, and discretization. More... | |
void | fillInCubicInterpolation () |
Generates a cubic interpolation of the trajectory from the start index to end index. More... | |
bool | fillInFromTrajectory (const robot_trajectory::RobotTrajectory &trajectory) |
Receives the path obtained from a given MotionPlanDetailedResponse res object's trajectory (e.g., trajectory produced by OMPL) and puts it into the appropriate trajectory format required for CHOMP. More... | |
void | fillInLinearInterpolation () |
Generates a linearly interpolated trajectory from the start index to end index. More... | |
void | fillInMinJerk () |
Generates a minimum jerk trajectory from the start index to end index. More... | |
double | getDiscretization () const |
Gets the discretization time interval of the trajectory. More... | |
double | getDuration () const |
size_t | getEndIndex () const |
Gets the end index. More... | |
Eigen::Block< Eigen::MatrixXd, Eigen::Dynamic, Eigen::Dynamic > | getFreeJointTrajectoryBlock (size_t joint) |
Gets the block of free (optimizable) trajectory for a single joint. More... | |
Eigen::Block< Eigen::MatrixXd, Eigen::Dynamic, Eigen::Dynamic > | getFreeTrajectoryBlock () |
Gets the block of the trajectory which can be optimized. More... | |
size_t | getFullTrajectoryIndex (size_t i) const |
Gets the index in the full trajectory which was copied to this group trajectory. More... | |
Eigen::MatrixXd::ColXpr | getJointTrajectory (int joint) |
template<typename Derived > | |
void | getJointVelocities (size_t traj_point, Eigen::MatrixBase< Derived > &velocities) |
Gets the joint velocities at the given trajectory point. More... | |
size_t | getNumFreePoints () const |
Gets the number of points (that are free to be optimized) in the trajectory. More... | |
size_t | getNumJoints () const |
Gets the number of joints in each trajectory point. More... | |
size_t | getNumPoints () const |
Gets the number of points in the trajectory. More... | |
size_t | getStartIndex () const |
Gets the start index. More... | |
Eigen::MatrixXd & | getTrajectory () |
Gets the entire trajectory matrix. More... | |
Eigen::MatrixXd::RowXpr | getTrajectoryPoint (int traj_point) |
double & | operator() (size_t traj_point, size_t joint) |
double | operator() (size_t traj_point, size_t joint) const |
void | setStartEndIndex (size_t start_index, size_t end_index) |
Sets the start and end index for the modifiable part of the trajectory. More... | |
void | updateFromGroupTrajectory (const ChompTrajectory &group_trajectory) |
Updates the full trajectory (*this) from the group trajectory. More... | |
virtual | ~ChompTrajectory ()=default |
Destructor. More... | |
Private Member Functions | |
void | init () |
Allocates memory for the trajectory. More... | |
Private Attributes | |
double | discretization_ |
double | duration_ |
size_t | end_index_ |
std::vector< size_t > | full_trajectory_index_ |
size_t | num_joints_ |
size_t | num_points_ |
std::string | planning_group_name_ |
size_t | start_index_ |
Eigen::MatrixXd | trajectory_ |
Represents a discretized joint-space trajectory for CHOMP.
Definition at line 86 of file chomp_trajectory.h.
chomp::ChompTrajectory::ChompTrajectory | ( | const moveit::core::RobotModelConstPtr & | robot_model, |
double | duration, | ||
double | discretization, | ||
const std::string & | group_name | ||
) |
Constructs a trajectory for a given robot model, trajectory duration, and discretization.
Definition at line 74 of file chomp_trajectory.cpp.
chomp::ChompTrajectory::ChompTrajectory | ( | const moveit::core::RobotModelConstPtr & | robot_model, |
size_t | num_points, | ||
double | discretization, | ||
const std::string & | group_name | ||
) |
Constructs a trajectory for a given robot model, number of trajectory points, and discretization.
Definition at line 80 of file chomp_trajectory.cpp.
chomp::ChompTrajectory::ChompTrajectory | ( | const ChompTrajectory & | source_traj, |
const std::string & | group_name, | ||
int | diff_rule_length | ||
) |
Creates a new containing only the joints of interest, and adds padding to the start and end if needed, to have enough trajectory points for the differentiation rules.
Definition at line 94 of file chomp_trajectory.cpp.
chomp::ChompTrajectory::ChompTrajectory | ( | const moveit::core::RobotModelConstPtr & | robot_model, |
const std::string & | group_name, | ||
const trajectory_msgs::JointTrajectory & | traj | ||
) |
|
virtualdefault |
Destructor.
void chomp::ChompTrajectory::assignCHOMPTrajectoryPointFromRobotState | ( | const moveit::core::RobotState & | source, |
size_t | chomp_trajectory_point, | ||
const moveit::core::JointModelGroup * | group | ||
) |
This function assigns the given source RobotState to the row at index chomp_trajectory_point.
source | The source RobotState |
chomp_trajectory_point | index of the chomp_trajectory's point (row) |
group | JointModelGroup determining the joints to copy |
Definition at line 244 of file chomp_trajectory.cpp.
void chomp::ChompTrajectory::fillInCubicInterpolation | ( | ) |
Generates a cubic interpolation of the trajectory from the start index to end index.
Only modifies points from start_index_ to end_index_, inclusive
Definition at line 153 of file chomp_trajectory.cpp.
bool chomp::ChompTrajectory::fillInFromTrajectory | ( | const robot_trajectory::RobotTrajectory & | trajectory | ) |
Receives the path obtained from a given MotionPlanDetailedResponse res object's trajectory (e.g., trajectory produced by OMPL) and puts it into the appropriate trajectory format required for CHOMP.
res |
Definition at line 221 of file chomp_trajectory.cpp.
void chomp::ChompTrajectory::fillInLinearInterpolation | ( | ) |
Generates a linearly interpolated trajectory from the start index to end index.
Only modifies points from start_index_ to end_index_, inclusive
Definition at line 139 of file chomp_trajectory.cpp.
void chomp::ChompTrajectory::fillInMinJerk | ( | ) |
Generates a minimum jerk trajectory from the start index to end index.
Only modifies points from start_index_ to end_index_, inclusive.
Definition at line 175 of file chomp_trajectory.cpp.
|
inline |
Gets the discretization time interval of the trajectory.
Definition at line 283 of file chomp_trajectory.h.
|
inline |
Definition at line 337 of file chomp_trajectory.h.
|
inline |
Gets the end index.
Definition at line 299 of file chomp_trajectory.h.
|
inline |
Gets the block of free (optimizable) trajectory for a single joint.
Definition at line 315 of file chomp_trajectory.h.
|
inline |
Gets the block of the trajectory which can be optimized.
Definition at line 309 of file chomp_trajectory.h.
|
inline |
Gets the index in the full trajectory which was copied to this group trajectory.
Definition at line 320 of file chomp_trajectory.h.
|
inline |
Definition at line 263 of file chomp_trajectory.h.
void chomp::ChompTrajectory::getJointVelocities | ( | size_t | traj_point, |
Eigen::MatrixBase< Derived > & | velocities | ||
) |
Gets the joint velocities at the given trajectory point.
Definition at line 326 of file chomp_trajectory.h.
|
inline |
Gets the number of points (that are free to be optimized) in the trajectory.
Definition at line 273 of file chomp_trajectory.h.
|
inline |
Gets the number of joints in each trajectory point.
Definition at line 278 of file chomp_trajectory.h.
|
inline |
Gets the number of points in the trajectory.
Definition at line 268 of file chomp_trajectory.h.
|
inline |
Gets the start index.
Definition at line 294 of file chomp_trajectory.h.
|
inline |
Gets the entire trajectory matrix.
Definition at line 304 of file chomp_trajectory.h.
|
inline |
Definition at line 258 of file chomp_trajectory.h.
|
private |
Allocates memory for the trajectory.
Definition at line 127 of file chomp_trajectory.cpp.
|
inline |
Definition at line 248 of file chomp_trajectory.h.
|
inline |
Definition at line 253 of file chomp_trajectory.h.
|
inline |
Sets the start and end index for the modifiable part of the trajectory.
(Everything before the start and after the end index is considered fixed) The values default to 1 and getNumPoints()-2
Definition at line 288 of file chomp_trajectory.h.
void chomp::ChompTrajectory::updateFromGroupTrajectory | ( | const ChompTrajectory & | group_trajectory | ) |
Updates the full trajectory (*this) from the group trajectory.
Definition at line 132 of file chomp_trajectory.cpp.
|
private |
Definition at line 270 of file chomp_trajectory.h.
|
private |
Definition at line 271 of file chomp_trajectory.h.
|
private |
Definition at line 274 of file chomp_trajectory.h.
|
private |
Definition at line 275 of file chomp_trajectory.h.
|
private |
Definition at line 269 of file chomp_trajectory.h.
|
private |
Definition at line 268 of file chomp_trajectory.h.
|
private |
Definition at line 267 of file chomp_trajectory.h.
|
private |
Definition at line 273 of file chomp_trajectory.h.
|
private |
Definition at line 272 of file chomp_trajectory.h.