-
Notifications
You must be signed in to change notification settings - Fork 337
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
Updated ROS2 PR: pcl_conversion only to ROS2 (dashing) #244
Updated ROS2 PR: pcl_conversion only to ROS2 (dashing) #244
Conversation
Perhaps someone can take a quick look at the updated travis config: It seems it's just picking up the old master-branch (aka ros1). Haven't used travis much so not sure where and how the code is fetched. |
There is currently a version of As mentioned here ros2/pcl_conversions#5, the opinion from the creator @clalancette of that version is that, that version can be somehow merged with this PR and deprecated, before this repo can be released into Dashing. We can continue to port the rest of this repo ( |
I made a PR to merge the ros2/pcl_conversions that is officially released into Dashing but a bit dated, into this PR. |
Merge with pcl_conversions officially released in Dashing
Awesome thanks! I merged that one without any review so we can keep the review here (or wherever the final review takes place) |
{ | ||
fromPCL(pcl_header.stamp, header.stamp); | ||
header.seq = pcl_header.seq; | ||
auto time_stamp = std::make_shared<rclcpp::Time>(header.stamp); |
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.
You make a shared pointer to deference it, you just need the object. If for some reason you need a pointer, use the unique_ptr
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 was thinking just to make sure it gets freed when we go out of the scope. Is there another way without using new
and delete
?
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.
Why do you need a pointer at all? You just dereference it soon after
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.
No probably not. I was just thinking that if I use a smart pointer, it will automatically delete the object after the function scope is gone, no ?
Constructing a new object would mean I need to do something like:
auto time_stamp = new rclcpp::Time(header.stamp);
fromPCL(pcl_header.stamp, time_stamp);
delete time_stamp;
But maybe that is not the way smart ptrs are intended to be used. Do you have any other recommendations on how to write this or is the code sample above an OK approach?
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.
You can just make a stack variable:
fromPCL(pcl_header.stamp, rclcpp::Time(header.stamp));
No smart pointers, pointers, or heap allocations required, and a single line of code :).
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 number of reasons to do one versus the other, but that is one reason, yes.
There's a real performance downside with using heap memory so its best to not do it unless you require it. Plus if you look at what you actually ended up doing:
- create pointer
- dereference pointer to pass to a method
There wasn't anything that used it in pointer format, so there wasn't anything to be derived from the allocation
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.
Typically, if you are only going to use it in this function (i.e. this stack frame), you do a stack allocation. If it needs to live beyond this function, then you do a heap allocation (either with a "raw" pointer or a smart pointer). Size can also come into it, as on Linux the default stack size is limited by default (8MB if I remember correctly, but don't quote me).
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.
Not to pile on, but also if you're concerned about real-time or software certifications, heap allocations are the devil
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.
Thanks for all elaborate examples and explanations, really valuable!
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.
Stack variable worked, however couldn't get it to compile using the one-liner
fromPCL(pcl_header.stamp, rclcpp::Time(header.stamp));
} // namespace ros::serialization | ||
|
||
} // namespace ros | ||
// template<> |
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.
This is for type masquerading?
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.
Hm good question, I don't have an answer to that.
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.
@clalancette that's what this is for, correct?
I'm going to assume all the time conversions with ns / us / s were done correctly or my brain will start hurting from looking at docs... |
I'll point out that CI is failing here, because of this message:
It looks like someone needs to release |
@clalancette this is sounding a whole lot like my I dont like the idea of blocking process for |
So I'm trying to understand where things are at right now and I'm a bit confused. @mabelzhang you did some work to update @klintan branch, which as been merged and is represented in this PR, correct? @mabelzhang your PR homologates the ros2/pcl_conversions repository, correct? So now if we merge this (into what needs to be a new ros2/dashing branch, not crystal) and release it, we can nuke the ros2 fork (IMO not even archive it, delete it from existence since Is that a correct assessment? Action item I can take
|
Just FYI, I'll do with the old |
When's crystals cut off date? Fair enough |
I will leave that for @klintan to answer. The only changes I made to time were the
That explains why I had to check out the
Yes.
Yes.
The test script,
We might be able to do this. That's my next thing to do.
Looks like Crystal EOL is Dec 2019 https://index.ros.org/doc/ros2/Releases/ |
@mabelzhang I'll take your word on the porting, everything I saw in this composite PR looks fine to me except for the things I pointed out, I just wanted to know if that was still a pending item on top of this PR or not. I assume you ran those tests and they came out clean? With December 2019 being the cut off, and its essentially October 1 before this gets merged it, I'd even say we can just delete the |
Yes, those tests in |
I've been super busy this week, but will fix all the outstanding issue on Saturday. |
I won't be able to get back to this till next week if there are things specific to my merge. |
Which ones are you referring to? I think the rest should be addressed except for the few follow up question I posed. (Namespace question and if everything looks OK in the CMakelists.txt file) Let me know if there is still something outstanding on this. |
Releasing PCL msgs to https://github.com/ros2-gbp/pcl_msgs-release @clalancette @wjwwood can you add me to the pcl_msgs repo so I can cut a new release on the ROS2 branch? Or just do it yourself if you have access |
@paulbovbel @wkentaro This PR is almost ready to go. The |
PCL msgs are released now for dashing and eloquent. Still need a maintainer here to review this |
Created dashing branch and retargeted PR to it, @klintan I see another draft PR, is that necessary? I have write access to this repo now to help get this over the line |
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.
nice nice, we're super close!
pcl_conversions/CMakeLists.txt
Outdated
std_msgs | ||
) | ||
|
||
set(includes |
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 dont think you require this with the dependencies variable and the ament depends call
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.
Had to include the non-ROS package here (PCL) otherwise I got an error, couldn't find the header.
Maybe I'm missing something ? since I had the same issue for the navsat_transform_node
in the robot_localization
package.
We could close that one, that one contains some changes to pcl_ros as well to try to convert to ROS2, but the effort stalled a bit (mostly because of the type masquerading not being available yet). My c++ skills are not on the level yet to be able to workaround that. |
Got it, I guess just leave it there for now and I can close the draft PR when there's motion to getting pcl ros ported. An example still have alot of value |
namespace message_traits | ||
{ | ||
template<> |
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.
Sorry maybe I was too non-specific, can you add ALL of this stuff back in, but then just comment it ALL out since there is no type masquerading yet? Revert to namespace ros {...}
and just block comment it all out with a TODO
on type masquerading.
pcl_conversions/package.xml
Outdated
|
||
<build_export_depend>eigen</build_export_depend> | ||
<build_depend>eigen3</build_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.
Oops this should be eigen
please change back :-)
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.
You can always check here https://github.com/ros/rosdistro/blob/master/rosdep/base.yaml
Last few things to dot our 'I' and cross out 't' |
Yeah thanks for hanging in there, I think I got most of the kinks ironed out now, but if you find something new or if I missed something let me know. |
This looks good to me. Let me look at this on Monday and play with on my machine. CI is failing, which seems related to switching to industrial ci. If you could make that pass that’d be great but I’ll also look into it |
Yeah I saw that |
I know alot of repos use the industrial CI so there must be a way to stop that. Otherwise everyone would be broken, those ament cmake packages are super low dependencies. For right now just targeting ubuntu is fine |
@klintan just remove |
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.
Just remove the matrix build for debian and make the matrix builds expandable, and we can merge this guy
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.
@clalancette want to give this another once over? I'm happy with it
Honestly, I'm not going to have time this week with ROSCon. I've verified that cartographer_ros still builds with it, so that's going to have to be good enough. Anything else we can fix in a follow-up. |
@LucidOne I made another branch on my fork for (dashing compatible) which only contains the pcl_conversion part and not pcl_ros (COLCON_IGNORE added).
Maybe this could be a first step to a ROS2 version, before the type masquerading etc is implemented in ROS2 ?
Would love some feedback on this,