|
16 | 16 |
|
17 | 17 | import os
|
18 | 18 |
|
19 |
| -from ament_index_python.packages import get_package_prefix, get_package_share_directory |
| 19 | +from ament_index_python.packages import get_package_share_directory |
20 | 20 |
|
21 | 21 | from launch import LaunchDescription
|
22 | 22 | from launch.actions import (DeclareLaunchArgument, EmitEvent, ExecuteProcess,
|
@@ -152,37 +152,19 @@ def generate_launch_description():
|
152 | 152 | remappings=remappings,
|
153 | 153 | arguments=[urdf])
|
154 | 154 |
|
155 |
| - # TODO(orduno) RVIZ crashing if launched as a node: https://github.com/ros2/rviz/issues/442 |
156 |
| - # Launching as node works after applying the change described on the github issue. |
157 |
| - # Once fixed, launch by providing the remappings: |
158 |
| - # rviz_remappings = [('/tf', 'tf'), |
159 |
| - # ('/tf_static', 'tf_static'), |
160 |
| - # ('goal_pose', 'goal_pose'), |
161 |
| - # ('/clicked_point', 'clicked_point'), |
162 |
| - # ('/initialpose', 'initialpose'), |
163 |
| - # ('/parameter_events', 'parameter_events'), |
164 |
| - # ('/rosout', 'rosout')] |
165 |
| - |
166 |
| - # start_rviz_cmd = Node( |
167 |
| - # package='rviz2', |
168 |
| - # node_executable='rviz2', |
169 |
| - # node_name='rviz2', |
170 |
| - # arguments=['-d', rviz_config_file], |
171 |
| - # output='screen', |
172 |
| - # use_remappings=IfCondition(use_remappings), |
173 |
| - # remappings=rviz_remappings) |
174 |
| - |
175 |
| - start_rviz_cmd = ExecuteProcess( |
| 155 | + start_rviz_cmd = Node( |
176 | 156 | condition=IfCondition(use_rviz),
|
177 |
| - cmd=[os.path.join(get_package_prefix('rviz2'), 'lib/rviz2/rviz2'), |
178 |
| - ['-d', rviz_config_file], |
179 |
| - ['__ns:=/', namespace], |
180 |
| - '/tf:=tf', |
181 |
| - '/tf_static:=tf_static', |
182 |
| - '/goal_pose:=goal_pose', |
183 |
| - '/clicked_point:=clicked_point', |
184 |
| - '/initialpose:=initialpose'], |
185 |
| - cwd=[launch_dir], output='screen') |
| 157 | + package='rviz2', |
| 158 | + node_executable='rviz2', |
| 159 | + node_name='rviz2', |
| 160 | + arguments=['-d', rviz_config_file], |
| 161 | + output='screen', |
| 162 | + use_remappings=IfCondition(use_remappings), |
| 163 | + remappings=[('/tf', 'tf'), |
| 164 | + ('/tf_static', 'tf_static'), |
| 165 | + ('goal_pose', 'goal_pose'), |
| 166 | + ('/clicked_point', 'clicked_point'), |
| 167 | + ('/initialpose', 'initialpose')]) |
186 | 168 |
|
187 | 169 | exit_event_handler = RegisterEventHandler(
|
188 | 170 | event_handler=OnProcessExit(
|
|
0 commit comments