ros2 / cartographer_ros

Provides ROS integration for Cartographer.
Apache License 2.0
121 stars 59 forks source link

Cartographer won't launch demo bags #49

Open girvenavery2022 opened 3 years ago

girvenavery2022 commented 3 years ago

ubuntu 20.04 focal, ros2 foxy, cloned cartographer from the ros2 branch, cloned cartographer_ros from the ros2 branch as well, added: install(DIRECTORY launch DESTINATION share/${PROJECT_NAME} ) to cartographers_ros cmake file The issue i am having is when i run the command: ros2 launch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag so i can test cartographer on a demo bag i get this error:

[INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:274> exception=InvalidLaunchFileError('')> Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 276, in _process_one_event await self.process_event(next_event) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 296, in process_event visit_all_entities_and_collect_futures(entity, self.context)) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit return self.execute(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 125, in execute launch_description = self.launch_description_source.get_launch_description(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description self._get_launch_description(self.__expanded_location) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description return get_launch_description_from_any_launch_file(location) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file raise InvalidLaunchFileError(extension, likely_errors=exceptions) launch.invalid_launch_file_error.InvalidLaunchFileError: The launch file may have a syntax error, or its format is unknown

i properly source the ROS environment and ran the command "source install/setup.bash" after building it using colcon build

i ran it on this bag: wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag

The github link to the packages is: https://github.com/girvenavery2022/cartographer_help

im not too sure where to go from here on fixing this

clalancette commented 3 years ago

Yeah, we never ported the launch files over to ROS 2 (which is the reason that the CMakeLists.txt doesn't install them). If you'd like to submit a pull request to port them over to ROS 2 Foxy, I'd be happy to review.

girvenavery2022 commented 3 years ago

interesting. so now, would I have to port the launch files over to ROS 2 foxy that are needed to launch cartographer on my robot? or are those already ported over? yeah, I can try to port the demo one over!

clalancette commented 3 years ago

interesting. so now, would I have to port the launch files over to ROS 2 foxy that are needed to launch cartographer on my robot?

None of the launch files stored in https://github.com/ros2/cartographer_ros/tree/dashing/cartographer_ros/launch are ported, so you'd have to port any ones you are interested in.