-
Notifications
You must be signed in to change notification settings - Fork 50
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
Yet Another filters port to ROS 2 #32
Conversation
c457d5e
to
6752d63
Compare
Signed-off-by: Shane Loretz <[email protected]> include .h -> include .hpp Signed-off-by: Shane Loretz <[email protected]> Port FilterBase, MultiChannelFilterBase, and all filters to ROS 2 Signed-off-by: Shane Loretz <[email protected]> Fix compile warning Signed-off-by: Shane Loretz <[email protected]> don't concatenate if prefix is empty Signed-off-by: Shane Loretz <[email protected]> Prefix param only once Signed-off-by: Shane Loretz <[email protected]> Don't install test_param plugin Signed-off-by: Shane Loretz <[email protected]> Build type ament_cmake Signed-off-by: Shane Loretz <[email protected]> Port single channel filter chain Signed-off-by: Shane Loretz <[email protected]> Factor out parameter parsing Signed-off-by: Shane Loretz <[email protected]> move load_chain_config to free function Signed-off-by: Shane Loretz <[email protected]> Port MultiChannelFilterChain to ROS 2 Signed-off-by: Shane Loretz <[email protected]> Delete unused files from ROS 1 Signed-off-by: Shane Loretz <[email protected]>
6752d63
to
49c133a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, mostly small things. I'll do another pass later that is more thorough.
Signed-off-by: Shane Loretz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of legacy stuff in here. I've left specific comments inline, but some overall comments:
- We should open an issue to follow-up and cleanup the style everywhere, including removing trailing whitespace.
- We should mark all of the methods that are overriding the parent methods as
override
to give the compiler a hint. - The types in some of these classes are a bit loose. Comparing
unsigned int
/uint32_t
tosize_t
, for instance, may be a problem on some architectures. Probably should make an issue to clean that up.
package.xml
Outdated
<run_depend>boost</run_depend> | ||
<depend>pluginlib</depend> | ||
<depend>rclcpp</depend> | ||
<depend>boost</depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bah. We could almost make the boost dependency a build_depend
; we only use circular_buffer, which is header only. The only problem is that it is used in an exported header (include/filters/realtime_circular_buffer.hpp
), so downstream consumers still need to know about it. I'll suggest that we either remove boost completely, or change this to a PIMPL pattern so we can do that. But feel free to punt on that and just open an issue to follow-up in the future.
(also nit: alphabetize)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started the port by trying to eliminate the dependency on boost in ROS 1, but I wasn't able to find a good replacement for realtime_circular_buffer
:( . #30
I'll punt on the pimpl pattern for now.
CMakeLists.txt
Outdated
) | ||
|
||
if(BUILD_TESTING) | ||
# TODO(sloretz) this disables ROS 2 style tests; reenable and fix style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open an issue to follow-up on this.
return true; | ||
} | ||
|
||
protected: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we collapse all of the protected sections into one? And then put the private section after that?
include/filters/filter_chain.hpp
Outdated
const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr & node_params, | ||
std::vector<struct FoundFilter> & found_filters) | ||
{ | ||
// TODO(sloretz) error if someone tries to do filter0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an issue for this?
include/filters/filter_chain.hpp
Outdated
// Make prefix be an empty string or a string ending in '.' | ||
std::string norm_param_prefix = param_prefix; | ||
if (!norm_param_prefix.empty()) { | ||
if ('.' != norm_param_prefix.back()) { | ||
norm_param_prefix += '.'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like common code, at least it is duplicated here with FilterBase
. Maybe make a utility? Feel free to open an issue to followup.
Co-Authored-By: Chris Lalancette <[email protected]>
Co-Authored-By: Chris Lalancette <[email protected]>
Co-Authored-By: Chris Lalancette <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
All right, with the latest changes this is getting closer. I think there are a few open problems that would be nice to fix now, and a few to punt until later. The ones I think we can do now without too much work:
And then here are ones I think we can punt on until a later PR:
|
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
@sloretz @clalancette I've opened sloretz#1 against this PR's branch. I believe I've addressed most pain points, except:
Which is somewhat tricky as
As I think that should be entirely handled by |
Signed-off-by: Michel Hidalgo <[email protected]>
Clean up ROS 2 port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also backwards compatible with Eloquent's uncrustify. Signed-off-by: Chris Lalancette <[email protected]>
Only shows up in Foxy, but it is definitely a bug. Signed-off-by: Chris Lalancette <[email protected]>
All right, this is relatively happy on both Eloquent and Foxy now. With blessing from @tfoote , merging this in and doing some releases for Eloquent and Foxy. Thanks to @swatifulzele for the initial work, @sloretz for this port, and @hidmic for the updates. |
Alternative to #19 and #24. The parameter specification of
filter1..filterN
@swatifulzele came up with in #24 is used here, but implemented a bit differently.I've been working on this a while. Here's a package where I was playing with porting laser filters with very similar code to this port: https://github.com/sloretz/ros2_laser_filters
TODO
@tfoote May I fast-forward merge theedit: doneros2
branch up tonoetic-devel
?There's some dead code removal (seed_rand and generate_rand_vectors()) that could be moved to a separate PR and done inedit opened [noetic] Delete unused code #33noetic-devel
tooThere are some commented tests inedit opened [noetic] Delete unused code #33test_chain.cpp
that were deleted and could be done in a separate PR innoetic-devel
too*
This PR moves headers fromedit opened [noetic] deprecate h for hpp #34.h
to.hpp
, so it should not be squash merged because then the history of that move is lost. Instead it should be squashed to two commits where the first renames the files and the second is all the changes and thenrebase and merged
.Differences from #24:
rclcpp::Node
so it works with lifecycle nodesgetParam()
functions so downstream filter changes are lessgetParam()