0
$\begingroup$

Rosanswers logo

i am trying to run ros2 laucnh ./test.launch My test launch file looks likes this:

<launch>
  <node pkg="lalosoft_robot_drive_host" exec="drive_host" output="screen" />
  <node pkg="lalosoft_robot_ptz_host" exec="ptz_host" output="screen" />
  <node pkg="lalosoft_robot_jazzy_drive_host" exec="drive_host" output="screen" />
</launch>

The output is this:

[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /root/.ros/log/2021-06-26-18-24-46-457671-cotsbotrott-19643
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xb61b2c50>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xb61b2c50>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0xb69f7790>'
Executing <Task finished coro=<LaunchService._process_one_event() done, defined at /opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py:179> result=None created at /opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py:222> took 0.230 seconds
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xb298bf30>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xb298bf30>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0xb69f7790>'
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py", line 354, in run
    self.__loop_from_run_thread.run_until_complete(run_loop_task)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py", line 244, in __run_loop
    await process_one_event_task
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 126, in send
    return self.gen.send(value)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py", line 181, in _process_one_event
    await self.__process_event(next_event)
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py", line 201, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/dashing/lib/python3.6/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/dashing/lib/python3.6/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/dashing/lib/python3.6/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/dashing/lib/python3.6/site-packages/launch/action.py", line 59, in visit
    return self.execute(context)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/actions/include_launch_description.py", line 103, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 62, in get_launch_description_from_python_launch_file
    launch_file_module = load_python_launch_file_as_module(python_launch_file_path)
  File "/opt/ros/dashing/lib/python3.6/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 37, in load_python_launch_file_as_module
    loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./test.launch", line 1
    <launch>
    ^
SyntaxError: invalid syntax

[ERROR] [launch]: Caught exception in launch (see debug for traceback): invalid syntax (test.launch, line 1)
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0xb298b2b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0xb298b2b0>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0xaf2908f0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0xb298b2b0>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0xb49f3310>'
Executing <Task finished coro=<LaunchService._process_one_event() done, defined at /opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py:179> result=None created at /opt/ros/dashing/lib/python3.6/site-packages/launch/launch_service.py:222> took 0.996 seconds

Originally posted by Casmer on ROS Answers with karma: 11 on 2021-06-26

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

it seems to have changed significantly since Dashing, but renaming the file to test.launch.xml should work in Dashing. Otherwise, since Dashing is end-of-life, the other solution is to use a non-EOL distro


Originally posted by christophebedard with karma: 641 on 2021-06-29

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.