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

Minor fixes for Cartographer from ROS #1705

Merged
merged 3 commits into from
Oct 23, 2020

Conversation

clalancette
Copy link
Contributor

@clalancette clalancette commented Jun 17, 2020

This PR is a "port" of the Cartographer code to ROS 2. I put the words port in quotes because the port doesn't require very much; it is mostly changes to compile on Ubuntu 20.04, plus some changes to the package.xml to make it a pure cmake package rather than a catkin one.

As-is, this PR doesn't apply to master. That's because this "port" was originally done against the 1.0.0 tag of this repository. However, given the rather simple nature of this PR, it should be pretty easy to move forward.

I'm opening this PR as a starting point for the discussion on how to move this code into the upstream. Some steps that seem obvious to me:

  • Update this to apply against master. This is now done.
  • Create a ros2 branch for this to target We decided to try to merge this all into master.

Some steps that are less obvious, and/or need discussion:

  • Do we want to try to support ROS 1 and ROS 2 on the same branch? It might be possible here, but I'm not sure. We decided we do.
  • Is the cartographer project willing to take over maintenance of this branch and release it into newer ROS 2 versions as they come along?

Finally, I'll note that I don't have too much of time to devote to this. I'm doing this on discretionary time, so while I'm glad to do some simple work here, I won't have the time to do any major refactoring.

Comments, questions, thoughts all welcome!

This was originally PR #1701, but I had to close that one and move it to a new source branch. Below are comments from that PR.


@wohe said:

@clalancette I opened #1704 for the remaining focal related fixes. Some of the changes in this PR have already been fixed. I'll send a PR which adds focal to CI later.

Since this is the library without a dependency on ROS it should be possible to have one version for both ROS 1 and 2. The only ROS related file is the package.xml which to my understanding allows configuring dependencies differently based on the ROS version. Should we do this? Can you have a look? I dont't think anything would speak against merging a PR which just fixes up the package.xml for ROS 2 support.


@clalancette said:

@clalancette I opened #1704 for the remaining focal related fixes. Some of the changes in this PR have already been fixed. I'll send a PR which adds focal to CI later.

Great, thanks!

Since this is the library without a dependency on ROS it should be possible to have one version for both ROS 1 and 2. The only ROS related file is the package.xml which to my understanding allows configuring dependencies differently based on the ROS version. Should we do this? Can you have a look? I dont't think anything would speak against merging a PR which just fixes up the package.xml for ROS 2 support.

Yep, in theory we should be able to do that. I'm going to rebase this on top of master, and then see if I can get that working.

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@clalancette
Copy link
Contributor Author

I've now rebased this on top of master, and done some additional fixes to make this compatible with both ROS 1 and ROS 2. At this point, I think it is ready for review.

@wohe
Copy link
Member

wohe commented Jun 18, 2020

Could you rebase again? I added some changes for Ubuntu 20.04 support in #1706 and it is now also included in CI.

@clalancette
Copy link
Contributor Author

Rebased again now.

cmake/functions.cmake Outdated Show resolved Hide resolved
package.xml Outdated Show resolved Hide resolved
@MichaelGrupp
Copy link
Contributor

Can we just use python3-sphinx in all cases? It's available also for previous Ubuntu distros and we just need its executable as a build dependency for documentation. It doesn't interfere with the actual ROS stuff in Cartographer.

@clalancette
Copy link
Contributor Author

Can we just use python3-sphinx in all cases? It's available also for previous Ubuntu distros and we just need its executable as a build dependency for documentation. It doesn't interfere with the actual ROS stuff in Cartographer.

Sure, that works for me. See e1e5212

@@ -77,6 +77,7 @@ if(NOT GMock_FOUND)
EXCLUDE_FROM_ALL)
endif()
set(GMOCK_LIBRARIES gmock_main)
set(GMOCK_INCLUDE_DIRS ${GMOCK_SRC_DIR}/include)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1
I'm working on migrating our fork to Noetic, this was needed there too.

Copy link
Member

Choose a reason for hiding this comment

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

Did you try installing the libgmock-dev package? I added Ubuntu Focal (which Noetic is primarily targeted at) to CI recently and it passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So installing libgmock-dev does make it work. But I actually still think this is a bug, and installing libgmock-dev just works around it.

When you install libgmock-dev, it means you actually don't come in the if(NOT GMOCK_LIBRARIES) block at all, and hence don't build gmock from source. If for some reason you do need to build gmock from source, then this block still doesn't export the GMOCK_INCLUDE_DIRS properly.

Thus, I think we should either keep this fix, or we should remove the fallback to build from source completely.

cmake/functions.cmake Outdated Show resolved Hide resolved
@@ -77,6 +77,7 @@ if(NOT GMock_FOUND)
EXCLUDE_FROM_ALL)
endif()
set(GMOCK_LIBRARIES gmock_main)
set(GMOCK_INCLUDE_DIRS ${GMOCK_SRC_DIR}/include)
Copy link
Member

Choose a reason for hiding this comment

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

Did you try installing the libgmock-dev package? I added Ubuntu Focal (which Noetic is primarily targeted at) to CI recently and it passes.

package.xml Show resolved Hide resolved
wohe added a commit to wohe/cartographer that referenced this pull request Sep 24, 2020
This changes cartographer_ros to no longer build
Ceres and instead uses libceres-dev for which a
suitable version is provided by ROS for Kinetic.

Related to cartographer-project#1705.

Signed-off-by: Wolfgang Hess <[email protected]>
wohe added a commit that referenced this pull request Sep 24, 2020
This changes cartographer_ros to no longer build
Ceres and instead uses libceres-dev for which a
suitable version is provided by ROS for Kinetic.

Related to #1705.

Signed-off-by: Wolfgang Hess <[email protected]>
@clalancette
Copy link
Contributor Author

Thanks for pushing forward with this. I've now rebased this branch. This still has a few fixes that would be good to get in, so I'll still suggest that we look into merging this as well.

@clalancette
Copy link
Contributor Author

Friendly ping on this one; can we get the fixes in this PR reviewed? Thanks.

Copy link
Contributor

@MichaelGrupp MichaelGrupp left a comment

Choose a reason for hiding this comment

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

So, we now have 3 lines left to review. One big discussion about libceres-dev is already resolved. Everything else looks fine to me, so I would prefer to merge. Since he was more involved into the discussion, I would ask @wohe to take a look please.

@MichaelGrupp
Copy link
Contributor

Please rebase / update branch and then let's get this merged. This patch is also needed for users that are building ROS1 from source, see my experiment in cartographer-project/cartographer_ros#1531. As we can see from the reply I got there it really affects users.

So unless @wohe has strong objections I would proceed to get things fixed.

@wohe
Copy link
Member

wohe commented Oct 23, 2020

@MichaelGrupp I will have a look today. We need to make sure that this does not break anything ROS1 related.

mikaelarguedas and others added 3 commits October 23, 2020 12:08
* restrict boost dependencies to the ones used

Signed-off-by: Mikael Arguedas <[email protected]>
@clalancette clalancette changed the title ROS 2 Cartographer port Minor fixes for Cartographer from ROS Oct 23, 2020
@clalancette
Copy link
Contributor Author

Please rebase / update branch and then let's get this merged. This patch is also needed for users that are building ROS1 from source, see my experiment in cartographer-project/cartographer_ros#1531. As we can see from the reply I got there it really affects users.

I've rebased onto the latest.

@MichaelGrupp I will have a look today. We need to make sure that this does not break anything ROS1 related.

Agreed. I think that CI should show this, however.

@wohe
Copy link
Member

wohe commented Oct 23, 2020

@clalancette Unfortunately, CI for this repo is unaffected by the file you changed. All ROS related code is in cartographer_ros. There, CI of course would fail when we introduce issues, but only after we merged the PR. I now ran this CI manually with your branch and it all succeeded.

@wohe wohe merged commit 1f69b83 into cartographer-project:master Oct 23, 2020
@clalancette clalancette deleted the ros2-upstream branch October 23, 2020 15:20
@clalancette
Copy link
Contributor Author

@clalancette Unfortunately, CI for this repo is unaffected by the file you changed. All ROS related code is in cartographer_ros. There, CI of course would fail when we introduce issues, but only after we merged the PR. I now ran this CI manually with your branch and it all succeeded.

Ah, good call. Thanks for kicking off the tests and merging!

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.

6 participants