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

Cartographer does not compile against ROS2 #13

Closed
davidswarbrick opened this issue Dec 24, 2019 · 5 comments
Closed

Cartographer does not compile against ROS2 #13

davidswarbrick opened this issue Dec 24, 2019 · 5 comments

Comments

@davidswarbrick
Copy link

I have been attempting to compile Cartographer against ROS 2: Dashing on Arch Linux, but receive the below error messages. I understand that ROS 2 is not officially supported (shown by the reliance on rviz rather than rviz2 etc., but also in the install instructions), however I have not been able to find any reasoning online about this lack of support or progress towards support in the future. My confusion was further confounded by the presence of cartographer in the ros2 Github repository. Please may I ask if there is a way of using Cartographer with ROS 2? Is it only possible through use of the ROS 1 bridge? And if so, how can I contribute to documenting this usage?

[catkin_ws]$ rosdep install --from-paths src --ignore-src --rosdistro=dashing -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
cartographer_ros_msgs: Cannot locate rosdep definition for [message_runtime]
cartographer: No definition of [lua5.2-dev] for OS [arch]
ceres-solver: No definition of [libgoogle-glog-dev] for OS [arch]
cartographer_rviz: Cannot locate rosdep definition for [rviz]
cartographer_ros: Cannot locate rosdep definition for [rosunit]

(message_runtime, rviz, rosunit are all ROS1 packages, which is why the install fails.)

@davidswarbrick
Copy link
Author

Discussion on this Cartographer upstream issue points to this not being resolved at the moment. I hope this thread can be a useful flagpost for others encountering this issue.

@clalancette
Copy link

Cartographer does indeed work in ROS 2, and we even have buildfarm packages for it; apt-get install ros-{dashing,eloquent}-cartographer-ros should just work for you.

If you still want to build from source, then you are most likely on the incorrect branches or repositories for your cartographer and cartographer_ros repositories. You need to clone both https://github.com/ros2/cartographer and https://github.com/ros2/cartographer_ros, using the default branches (ros2 and dashing, respectively). With that done, you should be able to run your rosdep command and compile the packages; this works locally for me.

I'm going to close this out for now, but feel free to keep commenting or reopen.

@davidswarbrick
Copy link
Author

Thank you for clarifying. As I'm not on Ubuntu these packages don't exist (I'm building on Arch Linux). My build fails when following the install instructions in the Cartographer Docs, I've cloned both correct branches of the repositories but the rosdep output posted above is still looking for ROS1 packages. If you've been able to build them I trust they can be built, however I am still unsure where this build process is documented. Please could you post the commands you run to compile the packages? Apologies in advance if this is a basic question, and thanks again for your response.

@clalancette
Copy link

My commands are fairly straightforward and simple:

mkdir -p cart_ws/src
cd cart_ws/src
git clone https://github.com/ros2/cartographer
git clone https://github.com/ros2/cartographer_ros
cd ..
source /opt/ros/dashing/setup.bash
rosdep install --from-paths src --ignore-src --rosdistro=dashing -y

Looking closer, I'm thinking that the version of rosdep you are using doesn't support COLCON_IGNORE files properly. We have never ported the cartographer_rviz sub-package in this repository, and thus all of the dependencies there are still ROS 1 dependencies. We mark it with a COLCON_IGNORE file, and all of the tools (including rosdep) know to ignore that file. What version of rosdep are you using? Can you run rosdep --version and post the output here?

@davidswarbrick
Copy link
Author

Thanks for posting your commands, I've followed them and now the only error messages are:

 rosdep install --from-paths src --ignore-src --rosdistro=dashing -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
cartographer: No definition of [lua5.2-dev] for OS [arch]
cartographer_ros: No definition of [lua5.2-dev] for OS [arch]

Which is clearly an issue with my system running lua 5.3.5 rather than 5.2, and unrelated to my previous post. I think it is most likely that I was attempting to compile cartographer without the cartographer_ros package source which may have led to the issues.

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

No branches or pull requests

2 participants