Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 28, 2023
1 parent efb5d4f commit d2979ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion include/hpp/core/continuous-validation.hh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ class HPP_CORE_DLLAPI ContinuousValidation : public PathValidation,
void breakDistance(value_type distance);

/// TODO
value_type distanceLowerBoundThreshold() const { return distanceLowerBoundThr_; }
value_type distanceLowerBoundThreshold() const {
return distanceLowerBoundThr_;
}

/// TODO
void distanceLowerBoundThreshold(value_type distance);
Expand Down
6 changes: 4 additions & 2 deletions src/continuous-validation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ void ContinuousValidation::removeObstacleFromJoint(
void ContinuousValidation::breakDistance(value_type distance) {
assert(distance >= 0);
if (distance <= distanceLowerBoundThr_) {
throw std::invalid_argument("Break distance must be strictly greater than "
throw std::invalid_argument(
"Break distance must be strictly greater than "
"the distance lower bound threshold.");
}
breakDistance_ = distance;
Expand All @@ -272,7 +273,8 @@ void ContinuousValidation::breakDistance(value_type distance) {
void ContinuousValidation::distanceLowerBoundThreshold(value_type distance) {
assert(distance >= 0);
if (distance >= breakDistance_) {
throw std::invalid_argument("Distance lower bound threshold must be "
throw std::invalid_argument(
"Distance lower bound threshold must be "
"strictly smaller than the break distance.");
}
distanceLowerBoundThr_ = distance;
Expand Down
12 changes: 6 additions & 6 deletions tests/test-continuous-validation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ using hpp::core::CollisionValidation;
using hpp::core::Configuration_t;
using hpp::core::ConfigurationShooterPtr_t;
using hpp::core::ConfigValidationPtr_t;
using hpp::core::value_type;
using hpp::core::matrix_t;
using hpp::core::PathPtr_t;
using hpp::core::PathValidationPtr_t;
Expand All @@ -70,11 +69,12 @@ using hpp::core::ProblemPtr_t;
using hpp::core::size_type;
using hpp::core::SteeringMethodPtr_t;
using hpp::core::ValidationReportPtr_t;
using hpp::core::value_type;
using hpp::core::vector_t;
using hpp::core::configurationShooter::Uniform;
using hpp::core::continuousCollisionChecking::Progressive;
using hpp::core::continuousValidation::Dichotomy;
using hpp::core::continuousValidation::DichotomyPtr_t;
using hpp::core::continuousCollisionChecking::Progressive;
using hpp::core::pathValidation::createDiscretizedCollisionChecking;
using hpp::core::steeringMethod::Straight;

Expand Down Expand Up @@ -497,22 +497,22 @@ BOOST_AUTO_TEST_CASE(avoid_infinite_loop_spline) {
// create steering method
ProblemPtr_t problem = Problem::create(robot);
typedef steeringMethod::Spline<hpp::core::path::BernsteinBasis, 3> SMSpline_t;
SMSpline_t::Ptr_t sm (SMSpline_t::create(problem));
SMSpline_t::Ptr_t sm(SMSpline_t::create(problem));
Configuration_t q1(robot->configSize()), q2(robot->configSize());
PathPtr_t path;
bool ok;

// Calculate shift
std::vector<int> order = { 1 };
std::vector<int> order = {1};
matrix_t D1(robot->numberDof(), 1), D2(robot->numberDof(), 1);

q1 << -1, 0;
q2 << 1.1, 0;
D1 << 0, -1;
D2 << 0, 1;
D2 << 0, 1;
path = sm->steer(q1, order, D1, q2, order, D2, 1.0);
BOOST_REQUIRE_EQUAL(path->length(), 1.0);
value_type shift = - path->eval(0.5, ok)[1];
value_type shift = -path->eval(0.5, ok)[1];

// create path validation objects
DichotomyPtr_t dichotomy(Dichotomy::create(robot, 0));
Expand Down

0 comments on commit d2979ac

Please sign in to comment.