Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix number of terms trajopt requires #333

Merged
Merged
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
12 changes: 6 additions & 6 deletions tesseract_motion_planners/trajopt/src/trajopt_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ trajopt::TermInfo::Ptr createCollisionTermInfo(int start_index,
trajopt::TermInfo::Ptr
createSmoothVelocityTermInfo(int start_index, int end_index, int n_joints, double coeff, trajopt::TermType type)
{
if ((end_index - start_index) < 2)
if ((end_index - start_index) < 1)
throw std::runtime_error("TrajOpt JointVelTermInfo requires at least two states!");

std::shared_ptr<trajopt::JointVelTermInfo> jv = std::make_shared<trajopt::JointVelTermInfo>();
Expand All @@ -208,7 +208,7 @@ trajopt::TermInfo::Ptr createSmoothVelocityTermInfo(int start_index,
const Eigen::Ref<const Eigen::VectorXd>& coeff,
trajopt::TermType type)
{
if ((end_index - start_index) < 2)
if ((end_index - start_index) < 1)
throw std::runtime_error("TrajOpt JointVelTermInfo requires at least two states!");

std::shared_ptr<trajopt::JointVelTermInfo> jv = std::make_shared<trajopt::JointVelTermInfo>();
Expand All @@ -224,7 +224,7 @@ trajopt::TermInfo::Ptr createSmoothVelocityTermInfo(int start_index,
trajopt::TermInfo::Ptr
createSmoothAccelerationTermInfo(int start_index, int end_index, int n_joints, double coeff, trajopt::TermType type)
{
if ((end_index - start_index) < 3)
if ((end_index - start_index) < 2)
throw std::runtime_error("TrajOpt JointAccTermInfo requires at least three states!");

std::shared_ptr<trajopt::JointAccTermInfo> ja = std::make_shared<trajopt::JointAccTermInfo>();
Expand All @@ -242,7 +242,7 @@ trajopt::TermInfo::Ptr createSmoothAccelerationTermInfo(int start_index,
const Eigen::Ref<const Eigen::VectorXd>& coeff,
trajopt::TermType type)
{
if ((end_index - start_index) < 3)
if ((end_index - start_index) < 2)
throw std::runtime_error("TrajOpt JointAccTermInfo requires at least three states!");

std::shared_ptr<trajopt::JointAccTermInfo> ja = std::make_shared<trajopt::JointAccTermInfo>();
Expand All @@ -258,7 +258,7 @@ trajopt::TermInfo::Ptr createSmoothAccelerationTermInfo(int start_index,
trajopt::TermInfo::Ptr
createSmoothJerkTermInfo(int start_index, int end_index, int n_joints, double coeff, trajopt::TermType type)
{
if ((end_index - start_index) < 5)
if ((end_index - start_index) < 4)
throw std::runtime_error("TrajOpt JointJerkTermInfo requires at least five states!");

std::shared_ptr<trajopt::JointJerkTermInfo> jj = std::make_shared<trajopt::JointJerkTermInfo>();
Expand All @@ -276,7 +276,7 @@ trajopt::TermInfo::Ptr createSmoothJerkTermInfo(int start_index,
const Eigen::Ref<const Eigen::VectorXd>& coeff,
trajopt::TermType type)
{
if ((end_index - start_index) < 5)
if ((end_index - start_index) < 4)
throw std::runtime_error("TrajOpt JointJerkTermInfo requires at least five states!");

std::shared_ptr<trajopt::JointJerkTermInfo> jj = std::make_shared<trajopt::JointJerkTermInfo>();
Expand Down