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

Code format: planner #167

Merged
merged 11 commits into from Apr 14, 2017
Merged

Code format: planner #167

merged 11 commits into from Apr 14, 2017

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Apr 13, 2017

No description provided.

@jslee02 jslee02 added this to the Aikido 0.1.0 milestone Apr 13, 2017
@jslee02 jslee02 requested a review from mkoval April 13, 2017 02:49
@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 59f3e27 on style/planner into 3139862 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 1f84bbf on style/planner into 3139862 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 1f84bbf on style/planner into 3139862 on master.

Copy link
Member

@mkoval mkoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I caught a few minor issues. I am not sure if these were actually caused by the reformatting - most likely not - but it's hard to tell from the diff.

Feel free to merge as-is or address them.

void interpolate(
const ::ompl::base::State* _from,
const ::ompl::base::State* _to,
const double _t,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary const. It's a bummer that clang-format can't fix this. :(

const double& _maxDistBtwValidityChecks);
MotionValidator(
const ::ompl::base::SpaceInformationPtr& _si,
const double& _maxDistBtwValidityChecks);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: There's no good reason to take a double by const &.

@@ -79,11 +83,12 @@ trajectory::InterpolatedPtr planOMPL(
/// valid bounds defined on the StateSpace
/// \param _maxPlanTime The maximum time to allow the planner to search for a
/// solution
/// \param _maxDistanceBtwValidityChecks The maximum distance (under dmetric) between
/// \param _maxDistanceBtwValidityChecks The maximum distance (under dmetric)
/// between
/// validity checking two successive points on a tree extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funky wrapping.

@@ -121,30 +129,35 @@ trajectory::InterpolatedPtr planOMPL(
/// solution
/// \param _maxExtensionDistance The maximum distance to extend the tree on
/// a single extension
/// \param _maxDistanceBtwProjections The maximum distance (under dmetric) between
/// \param _maxDistanceBtwProjections The maximum distance (under dmetric)
/// between
/// projecting and validity checking two successive points on a tree extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funky wrapping.

Planner::declareParam<double>(
"goal_bias", this, &CRRT::setGoalBias, &CRRT::getGoalBias, "0.:.05:1.");
Planner::declareParam<double>(
"proj_res",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Unrelated to this PR, rename this to projection_resolution. We're not charged by the byte. 😬

mStartTree->list(motions);
for (unsigned int i = 0; i < motions.size(); ++i) {
if (motions[i]->state) {
for (unsigned int i = 0; i < motions.size(); ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: size_t instead of unsigned int?

goal,
false,
bestdist,
foundgoal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here? 😱

Copy link
Member Author

@jslee02 jslee02 Apr 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I strongly prefer placing either all be on the same line or will have one line each for a function declaration's and definition's parameters. However, for a function call's arguments, I still debate myself which style is better. I started to slightly lean towards not to so (allowing multi items on a line) though. After looking at the diff, I prefer taking one line per item (when single line is impossible), and I (want to) believe this function takes too many parameters. 👿

Here is the diff.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deeply understand your point. Well, we have // clang-format on [off] option at least. 😓

::ompl::geometric::PathGeometric *path =
new ::ompl::geometric::PathGeometric(si_);
::ompl::geometric::PathGeometric* path
= new ::ompl::geometric::PathGeometric(si_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will leak memory if constructing the path raises an exception. We should create the PathPtr (or - if necessary - a shared_ptr<PathGeometric> here, instead of several lines below.

mGoalTree->list(motions);
for (unsigned int i = 0; i < motions.size(); ++i) {
for (unsigned int i = 0; i < motions.size(); ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: size_t?

void GeometricStateSpace::interpolate(
const ::ompl::base::State* _from,
const ::ompl::base::State* _to,
const double _t,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Superfluous const.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 1f84bbf on style/planner into 3139862 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 034b9fe on style/planner into 3139862 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.204% when pulling 034b9fe on style/planner into 3139862 on master.

}
}
}
} // ompl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be namespace ompl?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.974% when pulling 5334389 on style/planner into 65d3c23 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.974% when pulling 5334389 on style/planner into 65d3c23 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.974% when pulling 161995d on style/planner into 929dcb6 on master.

@jslee02 jslee02 merged commit 6740dbc into master Apr 14, 2017
@jslee02 jslee02 deleted the style/planner branch April 14, 2017 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants