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

Use fuse_core::getPositiveParam for all ros::Duration parameters #212

Merged

Conversation

efernandez
Copy link
Collaborator

When I tried to use fuse_core::getPositiveParam for all ros::Duration parameters before, I searched for _sec, so I missed a few spots where we use _double instead. Now all ros::Duration parameters make use of the new fuse_core::getPositiveParam that supports ros::Duration.

@efernandez efernandez self-assigned this Nov 30, 2020
@efernandez efernandez added the enhancement New feature or request label Nov 30, 2020
double tf_timeout_double = tf_timeout.toSec();
nh.getParam("tf_timeout", tf_timeout_double);
tf_timeout.fromSec(tf_timeout_double);
fuse_core::getPositiveParam(nh, "tf_cache_time", tf_cache_time, false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've also used fuse_core::getPositiveParam for these two, that didn't required the input to be positive.

I believe they must be positive, and I've allowed 0.0 because:

  • tf_cache_time: A TF buffer with a time cache that only spans for 0.0 seconds probably doesn't make much sense. I believe in this case only the latest transform is kept in the buffer.
  • tf_timeout: A lookupTransform with 0.0 timeout will simply not wait for the transform to be available.

If you don't agree with any of this, I'm happy to change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

double tf_timeout_double = tf_timeout.toSec();
nh.getParam("tf_timeout", tf_timeout_double);
tf_timeout.fromSec(tf_timeout_double);
fuse_core::getPositiveParam(nh, "tf_cache_time", tf_cache_time, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@svwilliams
Copy link
Contributor

Looks like this needs a rebase.

@efernandez
Copy link
Collaborator Author

Rebased

@svwilliams svwilliams merged commit 41abdd8 into locusrobotics:devel Dec 5, 2020
@efernandez efernandez deleted the get-positive-duration-param branch December 10, 2020 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants