Skip to content

Commit

Permalink
replace deprecated parameter node_name with name
Browse files Browse the repository at this point in the history
  • Loading branch information
augustelalande committed Nov 11, 2022
1 parent 060bf2a commit 24e01f1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions realsense2_description/launch/view_model.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,34 @@
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from launch_utils import to_urdf


def generate_launch_description():
available_urdf_files = [f for f in os.listdir(os.path.join(get_package_share_directory('realsense2_description'), 'urdf')) if f.startswith('test_')]
params = dict([aa for aa in [aa.split(':=') for aa in sys.argv] if len(aa)==2])
params = dict([aa for aa in [aa.split(':=') for aa in sys.argv] if len(aa) == 2])
if ('model' not in params or params['model'] not in available_urdf_files):
print ('USAGE:')
print ('ros2 launch realsense2_description view_model.launch.py model:=<model>')
print ('Available argumants for <model> are as follows:')
print ('\n'.join(available_urdf_files))
print('USAGE:')
print('ros2 launch realsense2_description view_model.launch.py model:=<model>')
print('Available argumants for <model> are as follows:')
print('\n'.join(available_urdf_files))
return launch.LaunchDescription()

rviz_config_dir = os.path.join(get_package_share_directory('realsense2_description'), 'rviz', 'urdf.rviz')
xacro_path = os.path.join(get_package_share_directory('realsense2_description'), 'urdf', params['model'])
urdf = to_urdf(xacro_path, {'use_nominal_extrinsics' : 'true', 'add_plug' : 'true'})
urdf = to_urdf(xacro_path, {'use_nominal_extrinsics': 'true', 'add_plug': 'true'})
rviz_node = Node(
package='rviz2',
executable='rviz2',
node_name='rviz2',
output = 'screen',
name='rviz2',
output='screen',
arguments=['-d', rviz_config_dir],
parameters=[{'use_sim_time': False}]
)
model_node = Node(
node_name='model_node',
name='model_node',
package='robot_state_publisher',
executable='robot_state_publisher',
namespace='',
output='screen',
arguments = [urdf]
arguments=[urdf]
)
return launch.LaunchDescription([rviz_node, model_node])

0 comments on commit 24e01f1

Please sign in to comment.