Skip to content

Commit 5357d95

Browse files
authored
Fix linter errors (#15)
1 parent b96e3e4 commit 5357d95

22 files changed

+336
-285
lines changed

mir_description/launch/mir_display_launch.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,30 @@
1111
def generate_launch_description():
1212

1313
mir_description_dir = get_package_share_directory('mir_description')
14-
rviz_config_file = os.path.join(mir_description_dir, 'rviz', 'mir_description.rviz')
14+
rviz_config_file = os.path.join(
15+
mir_description_dir, 'rviz', 'mir_description.rviz')
1516

1617
return LaunchDescription([
1718

18-
DeclareLaunchArgument(
19-
'joint_state_publisher_enabled',
20-
default_value='true',
21-
description='Enable to publish joint states using joint state publisher'),
22-
23-
IncludeLaunchDescription(
24-
PythonLaunchDescriptionSource(
25-
os.path.join(mir_description_dir, 'launch', 'mir_launch.py')),
26-
launch_arguments={
27-
'joint_state_publisher_enabled': LaunchConfiguration('joint_state_publisher_enabled'),
28-
}.items()
29-
),
30-
31-
Node(
32-
package='rviz2',
33-
executable='rviz2',
34-
arguments=['-d', rviz_config_file],
35-
parameters=[{'use_sim_time': LaunchConfiguration('use_sim_time')}]
36-
)
19+
DeclareLaunchArgument(
20+
'joint_state_publisher_enabled',
21+
default_value='true',
22+
description='Enable to publish joint states using joint state publisher'),
23+
24+
IncludeLaunchDescription(
25+
PythonLaunchDescriptionSource(
26+
os.path.join(mir_description_dir, 'launch', 'mir_launch.py')),
27+
launch_arguments={
28+
'joint_state_publisher_enabled':
29+
LaunchConfiguration('joint_state_publisher_enabled'),
30+
}.items()
31+
),
32+
33+
Node(
34+
package='rviz2',
35+
executable='rviz2',
36+
arguments=['-d', rviz_config_file],
37+
parameters=[{'use_sim_time': LaunchConfiguration('use_sim_time')}]
38+
)
3739

3840
])

mir_description/launch/mir_launch.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ def generate_launch_description():
1515
mir_description_dir = get_package_share_directory('mir_description')
1616

1717
def create_robot_description(context):
18-
ns = context.launch_configurations['namespace']
19-
if ns.startswith('/'):
20-
ns = ns[1:]
21-
22-
prefix = context.launch_configurations['prefix']
23-
urdf_dir = os.path.join(mir_description_dir, 'urdf')
24-
xacro_file = os.path.join(urdf_dir, 'mir.urdf.xacro')
25-
doc = xacro.process_file(xacro_file, mappings={'tf_prefix' : ns})
26-
robot_desc = doc.toprettyxml(indent=' ')
27-
return [SetLaunchConfiguration('robot_description', robot_desc)]
18+
ns = context.launch_configurations['namespace']
19+
if ns.startswith('/'):
20+
ns = ns[1:]
21+
urdf_dir = os.path.join(mir_description_dir, 'urdf')
22+
xacro_file = os.path.join(urdf_dir, 'mir.urdf.xacro')
23+
doc = xacro.process_file(xacro_file, mappings={'tf_prefix': ns})
24+
robot_desc = doc.toprettyxml(indent=' ')
25+
return [SetLaunchConfiguration('robot_description', robot_desc)]
2826

2927
return LaunchDescription([
3028

@@ -50,8 +48,8 @@ def create_robot_description(context):
5048
executable='robot_state_publisher',
5149
name='robot_state_publisher',
5250
output='both',
53-
parameters=[{'use_sim_time': use_sim_time,
54-
'robot_description': LaunchConfiguration('robot_description')}],
51+
parameters=[{'use_sim_time': use_sim_time,
52+
'robot_description': LaunchConfiguration('robot_description')}],
5553
namespace=LaunchConfiguration('namespace'),
5654
),
5755

mir_driver/launch/additions_launch.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from launch import LaunchDescription
66
from launch.actions import DeclareLaunchArgument
77
from launch.substitutions import LaunchConfiguration
8-
from launch_ros.actions import Node
98

109

1110
def generate_launch_description():
@@ -23,15 +22,15 @@ def generate_launch_description():
2322
),
2423

2524
DeclareLaunchArgument(
26-
'rviz_config_file',
27-
default_value= os.path.join(mir_description_dir, 'rviz', 'mir_visu_full.rviz'),
28-
description='Define rviz config to be used'
25+
'rviz_config_file',
26+
default_value=os.path.join(mir_description_dir, 'rviz', 'mir_visu_full.rviz'),
27+
description='Define rviz config to be used'
2928
),
3029

3130
Node(
3231
package='teleop_twist_keyboard',
3332
executable='teleop_twist_keyboard',
34-
namespace=LaunchConfiguration('namespace'),
33+
namespace=namespace,
3534
prefix='xterm -e'),
3635

3736
Node(

mir_driver/launch/mir_headless_launch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
def generate_launch_description():
1313

1414
mir_description_dir = get_package_share_directory('mir_description')
15-
rviz_config_file = LaunchConfiguration('rviz_config_file')
1615
use_sim_time = LaunchConfiguration('use_sim_time')
1716

1817
return LaunchDescription([
@@ -47,9 +46,10 @@ def generate_launch_description():
4746
os.path.join(mir_description_dir, 'launch', 'mir_launch.py')),
4847
launch_arguments={
4948
'joint_state_publisher_enabled': 'false',
50-
'namespace' : LaunchConfiguration('namespace')
49+
'namespace': LaunchConfiguration('namespace')
5150
}.items(),
52-
condition=IfCondition(LaunchConfiguration('robot_state_publisher_enabled'))
51+
condition=IfCondition(LaunchConfiguration(
52+
'robot_state_publisher_enabled'))
5353
),
5454

5555
Node(
@@ -92,7 +92,8 @@ def generate_launch_description():
9292
'cloud_destination_topic': 'scan_cloud',
9393
'min_height': -0.25,
9494
'max_merge_time_diff': 0.05,
95-
'max_delay_scan_time': 2.5, # driver (msg converter) delay
95+
# driver (msg converter) delay
96+
'max_delay_scan_time': 2.5,
9697
'max_completion_time': 0.1,
9798
'alow_scan_delay': True,
9899
'use_sim_time': use_sim_time,

mir_driver/mir_driver/fake_mir_joint_publisher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self):
1818

1919
pub = self.create_publisher(
2020
msg_type=JointState,
21-
topic = 'joint_states', # no prefix to joint states, just namespace
21+
topic='joint_states', # no prefix to joint states, just namespace
2222
qos_profile=qos_profile_system_default # TODO Check QoS Settings
2323
)
2424

0 commit comments

Comments
 (0)