Skip to content

Commit

Permalink
Fix incorrect evaluator type check in LVSDiscrete collision evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jan 19, 2025
1 parent 99986e8 commit f9d0bdd
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ LVSContinuousCollisionEvaluator::LVSContinuousCollisionEvaluator(
, collision_config_(std::move(collision_config))
, dynamic_environment_(dynamic_environment)
{
assert(collision_config_->type == tesseract_collision::CollisionEvaluatorType::CONTINUOUS ||
collision_config_->type == tesseract_collision::CollisionEvaluatorType::LVS_CONTINUOUS);
if (collision_config_->type == tesseract_collision::CollisionEvaluatorType::DISCRETE ||
collision_config_->type == tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE)
{
throw std::runtime_error("LVSContinuousCollisionEvaluator, has been configured with "
"CollisionEvaluatorType::DISCRETE or CollisionEvaluatorType::LVS_DISCRETE");
}

manip_active_link_names_ = manip_->getActiveLinkNames();

Expand Down Expand Up @@ -290,6 +294,13 @@ LVSDiscreteCollisionEvaluator::LVSDiscreteCollisionEvaluator(
, collision_config_(std::move(collision_config))
, dynamic_environment_(dynamic_environment)
{
if (collision_config_->type == tesseract_collision::CollisionEvaluatorType::CONTINUOUS ||
collision_config_->type == tesseract_collision::CollisionEvaluatorType::LVS_CONTINUOUS)
{
throw std::runtime_error("LVSDiscreteCollisionEvaluator, has been configured with "
"CollisionEvaluatorType::CONTINUOUS or CollisionEvaluatorType::LVS_CONTINUOUS");
}

manip_active_link_names_ = manip_->getActiveLinkNames();

// If the environment is not expected to change, then the cloned state solver may be used each time.
Expand Down Expand Up @@ -453,7 +464,7 @@ void LVSDiscreteCollisionEvaluator::CalcCollisionsHelper(tesseract_collision::Co
// the longest valid segment length.
const double dist = (dof_vals1 - dof_vals0).norm();
long cnt = 2;
if (collision_config_->type == tesseract_collision::CollisionEvaluatorType::LVS_CONTINUOUS &&
if (collision_config_->type == tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE &&
dist > collision_config_->longest_valid_segment_length)
{
// Calculate the number state to interpolate
Expand Down

0 comments on commit f9d0bdd

Please sign in to comment.