DaniGarciaLopez / ros2_explorer

In this repo we use Turtlebot 3 along with ROS 2 and Gazebo to explore an unknown csv environment, navigate through it and create a map
88 stars 21 forks source link

running (not) on iron #11

Open Karloveliki opened 4 months ago

Karloveliki commented 4 months ago

Hello,

I am trying explorer on iron. It seems to fail when looking for occupancy grid:

ros2 launch -d explorer_bringup map10.launch.py
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/karlo/.ros/log/2024-05-27-21-53-42-623028-karlo-ros2-2050
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7ba1dc083b20>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7ba1dc083b20>' \u2713 '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7ba1dbeceb90>'
urdf_file_name : turtlebot3_burger.urdf
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_description_source.py", line 68, in try_get_launch_description_without_context
    perform_substitutions(context, self.__location)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_context.py", line 241, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/substitutions/this_launch_file_dir.py", line 57, in perform
    raise SubstitutionFailure(
launch.substitutions.substitution_failure.SubstitutionFailure: ThisLaunchFileDir used outside of a launch file (in a script)

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: ThisLaunchFileDir used outside of a launch file (in a script)
urdf_file_name : turtlebot3_burger.urdf
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_description_source.py", line 68, in try_get_launch_description_without_context
    perform_substitutions(context, self.__location)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_context.py", line 241, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/substitutions/this_launch_file_dir.py", line 57, in perform
    raise SubstitutionFailure(
launch.substitutions.substitution_failure.SubstitutionFailure: ThisLaunchFileDir used outside of a launch file (in a script)

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: ThisLaunchFileDir used outside of a launch file (in a script)
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/iron/lib/python3.10/site-packages/launch/launch_service.py:228> exception=SubstitutionFailure("executable 'occupancy_grid_node' not found on the libexec directory '/opt/ros/iron/lib/cartographer_ros' ") created at /opt/ros/iron/lib/python3.10/site-packages/launch/launch_service.py:319> took 1.746 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_service.py", line 337, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/iron/lib/python3.10/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/iron/lib/python3.10/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/iron/lib/python3.10/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)
  [Previous line repeated 5 more times]
  File "/opt/ros/iron/lib/python3.10/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/iron/lib/python3.10/site-packages/launch/action.py", line 109, in visit
    return self.execute(context)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch_ros/actions/node.py", line 509, in execute
    ret = super().execute(context)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/actions/execute_local.py", line 642, in execute
    self.prepare(context)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/actions/execute_local.py", line 617, in prepare
    self.__process_description.prepare(context, self)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/descriptions/executable.py", line 174, in prepare
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/descriptions/executable.py", line 174, in <listcomp>
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/iron/lib/python3.10/site-packages/launch/launch_context.py", line 241, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/iron/lib/python3.10/site-packages/launch_ros/substitutions/executable_in_package.py", line 84, in perform
    raise SubstitutionFailure(
launch.substitutions.substitution_failure.SubstitutionFailure: executable 'occupancy_grid_node' not found on the libexec directory '/opt/ros/iron/lib/cartographer_ros' 

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable 'occupancy_grid_node' not found on the libexec directory '/opt/ros/iron/lib/cartographer_ros' 
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1d92e2a70>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1d9244d60>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1d93f25c0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1d93f3700>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1d92478e0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7ba1dbeced70>' \u2713 '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7ba1dbecfa60>'
Karloveliki commented 4 months ago

Same issue happened when i tried to launch it in humble.

DaniGarciaLopez commented 4 months ago

The issue states that the executable 'occupancy_grid_node' is missing. Did you install Cartographer?

sudo apt install ros-foxy-cartographer ros-foxy-cartographer-ros

As reported by other users (https://github.com/DaniGarciaLopez/ros2_explorer/issues/5), you will encounter problems running this repository in humble or higher, the last supported version was foxy. It's on my to-do list to make the necessary changes, but I haven't found the time yet. PRs are welcome.

Karloveliki commented 4 months ago

Yes i have installed ros-iron-cartographer and ros-iron-cartographer-ros, but they seem have changed name of the executables and possibly other stuff.

Unfortunately i am too new with ros to be able to help with PR.

DaniGarciaLopez commented 4 months ago

That's right, the executable was renamed from occupancy_grid_node to cartographer_occupancy_grid_node

DaniGarciaLopez commented 4 months ago

I have just pushed the necessary changes to ensure compatibility with Humble and made several other improvements to the installation and launch processes. Here is the new way to launch it:

ros2 launch explorer_bringup explorer.launch.py map_name:=map10
Karloveliki commented 4 months ago

I was able to start with above command in iron and managed to use wanderer explorer and created a map. When i try to use discoverer the robot didnt move. I would probably try in humble as well later. Thank you very much!

DaniGarciaLopez commented 4 months ago

If discoverer is the only component that isn't working, it is likely related to Navigation2. Check for any warnings or errors in the console to identify the cause of the problem. Here is the migration guide to see if anything changed from humble to iron. I have no plans to support iron for now; most likely, I will port the repository to jazzy once all dependencies are updated. You're welcome!