Skip to content

implemented angle wrap - #261

Open
kymadogg wants to merge 3 commits into
ros-perception:ros2from
kymadogg:kh/angle-wrap-bounds-filter
Open

implemented angle wrap #261
kymadogg wants to merge 3 commits into
ros-perception:ros2from
kymadogg:kh/angle-wrap-bounds-filter

Conversation

@kymadogg

Copy link
Copy Markdown

Added handling angle wrapping as suggested in issue #260. Also added test cases in the same style as other test cases.

@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@kymadogg

kymadogg commented Jul 15, 2026

Copy link
Copy Markdown
Author

I think this probably could also be merged into rolling but I chose ros2 for now since I mainly use Jazzy.

@jonbinney

Copy link
Copy Markdown
Contributor

I think we have to be pretty careful here since, if I understand correctly, this could change the behavior of existing robots who expect the old, non-wrapped version.

For example if we had the params set to lower_angle=5.0, upper_angle=8.0, then before this PR a laser beam with angle=7.0 would have been filtered out, but now it wouldn't, right?

@kymadogg

Copy link
Copy Markdown
Author

yeah I could see that potentially being a problem. There could maybe be a parameter that toggles wrapping vs non-wrapping behavior and the default is false to prevent older robot's laser filtering from breaking?

I am also totally open to ideas if you have any potential solutions you think would be a better fit.

On another note, I have been working on fixing the test cases since I believe I messed something up with setting parameters and had some configuration error on my local machine. I do not use GTest too often if you couldn't tell already.

@kymadogg
kymadogg force-pushed the kh/angle-wrap-bounds-filter branch from 20a648c to 9c891a6 Compare July 28, 2026 04:07
@jonbinney

Copy link
Copy Markdown
Contributor

Yes, I think that having a parameter for "wrap angles" that defaults to false is the way to go. Tests look like they are passing now, thanks for that. gtest is never fun :-P

One other request - could you add a comment just above the class definition that describes what the filter does when wrapping is on, and what the filter does when wrapping is off, with a couple of numeric examples? Then I'll do a quick code review for any last details.

@kymadogg

kymadogg commented Jul 29, 2026

Copy link
Copy Markdown
Author

Sounds good, I'll add the wrap_angle parameter and maybe throw in a few more tests. Also, in addition to adding docs/explanation of the math to the comments, are you ever planning to add a repo level readme or repo wiki pages?

I would be happy to make another PR with a draft readme and/or some wiki pages that have a blurb for each filter, lists its parameters, and contains install / setup instructions.

@jonbinney

Copy link
Copy Markdown
Contributor

Adding documentation would be great; I have to admit I haven't looked into best practices for documentation for ROS2 packages too much. A top level README.md sounds like a good approach. I'm torn on how much detail should be included - I do like having class level documentation in the header file - it's close to the implementation and we're less likely to forget to update it when changes are made. Not sure how to separate what goes in the README from what goes in the header file. A fair amount of info for the README.md could be pulled from the ROS1 wiki page: https://wiki.ros.org/laser_filters

I'll look at your updated changes in the next few days.

@kymadogg

kymadogg commented Aug 3, 2026

Copy link
Copy Markdown
Author

I was thinking of making another PR for that since it going to take a while to make sure everything is documented correctly. I also should probably look into some other documentation examples for ROS packages that share a similar structure. I think it's also a little off topic from this current PR.

I'm also moving back for my final year of college soon so it might be a while.

added parameter that toggles wrapping angle behavior in order to maintain backward compatibility
added example yaml and launch file for AngularFilterInPlace since one did not exist
@kymadogg
kymadogg force-pushed the kh/angle-wrap-bounds-filter branch from fc12334 to 364f329 Compare August 3, 2026 05:44
@kymadogg

kymadogg commented Aug 3, 2026

Copy link
Copy Markdown
Author

Also this last update was to remove a file that shouldn't have been added to one commit (test_detail.xml).

@jonbinney

Copy link
Copy Markdown
Contributor

Sounds good - no worries if you don't get around to looking at documentation improvements - I should also look into it at some point.

@kymadogg

kymadogg commented Aug 3, 2026

Copy link
Copy Markdown
Author

Sounds good, let me know if anything filter related needs to change so this PR can get merged/closed. Also thanks for reviewing this!

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.

2 participants