Migration to cartographer 2.0 library and proper ros2 implementation#59
Migration to cartographer 2.0 library and proper ros2 implementation#59clalancette merged 182 commits intoros2:ros2from
Conversation
…r-project#893) * remove architecture specific definitions exported by PCL This is an issue on PCL 1.8.X causing SIGILL, Illegal instruction crashes: ros-gbp/cartographer_ros-release#10 Should be fixed in future PCL version with PointCloudLibrary/pcl#2100
…-project#891) Fixes the problem of ever-growing memory after `rosbag play --clock` finishes, as discussed in cartographer-project/cartographer#1182 The wall timers caused the timer callback that publishes TF data to be called even if no simulated `/clock` was published anymore. As the TF buffer cache time of the TF listener seems to be based on the ROS time instead of wall clock, it could grow out of bounds. Now, `ros::Timer` plays nicely with both normal (wall) and simulated time and no callbacks are executed if `/clock` stops in simulation.
In cartographer we check for strict ordering, i.e. do not allow subsequent timestamps to be exactly equal. This fixes the rosbag validation tool to do the same.
Prevents confusion with TrajectoryState and GetTrajectoryStates() of the pose graph interface. The affected data is only local.
…apher-project#910) cartographer-project/rfcs#35 - makes use of the trajectory state in `map_builder` and `node` - adds a service to query the trajectory states - follow-up to cartographer-project/cartographer#1214 that takes the deleted state into account in the `/finish_trajectory` service (could crash otherwise)
…project#912) We don't need it after the occupancy grid is drawn. Reduces the memory consumption especially for large maps.
- minimal counter, gauge and histogram implementations - metric family interfaces as defined in libcartographer - serializable to ROS messages RFC: cartographer-project/rfcs#26
…er-project#917) [RFC 24](https://github.com/googlecartographer/rfcs/blob/master/text/0024-monitoring-ros.md) Public API: - adds `cartographer_ros::metrics::FamilyFactory` - compatible with `::cartographer::metrics::RegisterAllMetrics` Public RPC interface: - adds the ROS service `/read_metrics` - response contains the latest values of all available metric families
This PR adds additional bookkeeping for trajectories that we scheduled for finishing. In Node::RunFinalOptimization(...), we were calling FinishTrajectory for every active trajectory (state == ACTIVE). Since the state only gets updated once the corresponding worker for the FinishTrajectory task is scheduled, we were potentially calling FinishTrajectory twice for a single trajectory id. Reproducible on master e.g. with ``` roslaunch cartographer_ros offline_backpack_2d.launch bag_filenames:=b2-2016-02-02-14-01-56.bag no_rviz:=true ```
To compare different SLAM software online, it is necessary to disable tf broadcast. Because we already have a parameter "pose_publish_period_sec", we use a zero value here to turn off tf broadcast.
…rapher-project#927) `DIRECTORY` by itself doesn't work as reliable as expected.
Use mutex locker instead of atomic operations in Gauge. Remove unnecessary constructor overload from Histogram.
This adds a .clang-format file, so that git clang-format uses Google style without the need to remember the commandline flag. Similar to cartographer-project/cartographer#1249.
`std::bind` is bug prone and should be avoided. Lambdas are a more general and safer replacement. Similar to cartographer-project/cartographer#1261.
This is useful for tuning/debugging to rule out (simulated) time issues (because published pose will then only depend on header times). Another use case is when Cartographer runs on a separate machine that has a different system clock than the sensors.
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
|
This compiled for me after installing all dependencies. I do have a few pieces of feedback:
Can you look into cleaning that up, and/or suppressing it?
Can you take a look and fix it? Once we have those cleaned up, I think we can start thinking about merging this. |
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
…UIRED)` Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
COLCON_IGNORE added.
Fixed by changing
Fixed |
|
OK, so this now compiles for me and runs the tests, so I think this is almost ready to go. Thanks for the fixes so far. That said, I can't actually merge this right now, because there are conflicts with the |
I understand the need for keeping this branch ros2 history, but I believe it should be the other way around: hard resetting this repo ros2 branch and cherry picking few commits if needed (I don't believe there is any actually); OR creating a new branch ros2_2.0 (indicating that it is a wrapper for the v2.0 of the cartographer library). |
But I don't want to lose the history, so this isn't an option.
We could do that, but I really don't see the need to. There are already enough branches in these repositories that people get confused as it is, I don't really want to add to that if we don't need to.
That's the beautiful thing about merge commits; all of that history will be preserved on one "side" of the merge. The other side of the merge will contain all of the development that happened here in this fork, so we don't need to lose any of that. |
|
Ok, I am trying to do a merge (43+ conflicts for now), but I am a bit reluctant as it won't be as rigorously tested as the non merged version (but yes, always taking the newest version should do the trick) |
I found a good trick to greatly increase confidence in it. Checkout your current, well-tested code to another branch (I'll just call it |
Signed-off-by: Guillaume Doisy <guillaume.doisy@wyca.fr>
|
It should be all right since my last push ed85808 |
Yep, it looks good to me! Thanks for the hard work here. I'm going to go ahead and merge this, and then do a separate PR to setup release-related things (like update the package.xml versions and such). |
|
@doisyg Hm, while looking at what version number to call this, I realized that upstream https://github.com/cartographer-project/cartographer_ros hasn't done a tag since 1.0 in 2018 . So I'm not quite sure what I should tag this as. My initial thought is to tag it as something like 2.0.9000 (to go along with the version scheme in https://github.com/ros2/cartographer), but since there is no upstream 2.0.0 tag the same rules don't apply. What are your thoughts on versioning this? |
|
Hm I don't really, the whole situation is super confusing. We want to point out that this wrapper is for ros2 (as opposite to ros1) AND that it is targeting the version 2.0 of the cartographer library (as opposite to the current released ros2 foxy/galactic wrapper that is targeting the version 1.0 of the cartographer library AND in a similar way as the released ros1 noetic wrapper that is targeting the version 2.0 of the cartographer library). |
|
Yeah, it's a tough call. Since we don't really have any movement upstream, I'm going to go ahead and make the assumption that the 1.x series of tags upstream is for ROS 1, and the 2.x series of tags will be for ROS 2. That leads me to use 2.0.9000 for these changes. If upstream comes alive again and chooses something different, we can always re-evaluate the situation. I'll add a copious comment in the package.xml explaining this decision. |
|
That sounds like a good compromise, thanks for facilitating this ! |
|
This pull request has been mentioned on ROS Discourse. There might be relevant details there: |
As discussed in length here: cartographer-project#1622