Skip to content

Commit

Permalink
lintering
Browse files Browse the repository at this point in the history
Signed-off-by: stevedan <[email protected]>
  • Loading branch information
stevedanomodolor committed Sep 18, 2024
1 parent c61bfac commit 2dea810
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions nav2_system_tests/src/gps_navigation/test_case_py.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
IncludeLaunchDescription,
SetEnvironmentVariable,
)
from launch.launch_context import LaunchContext
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch_testing.legacy import LaunchTestService
Expand All @@ -36,83 +35,83 @@


def generate_launch_description():
sim_dir = get_package_share_directory("nav2_minimal_tb3_sim")
nav2_bringup_dir = get_package_share_directory("nav2_bringup")
sim_dir = get_package_share_directory('nav2_minimal_tb3_sim')
nav2_bringup_dir = get_package_share_directory('nav2_bringup')

world_sdf_xacro = os.path.join(sim_dir, "worlds", "tb3_gps.sdf.xacro")
robot_sdf = os.path.join(sim_dir, "urdf", "gz_waffle_gps.sdf.xacro")
world_sdf_xacro = os.path.join(sim_dir, 'worlds', 'tb3_gps.sdf.xacro')
robot_sdf = os.path.join(sim_dir, 'urdf', 'gz_waffle_gps.sdf.xacro')

urdf = os.path.join(sim_dir, "urdf", "turtlebot3_waffle_gps.urdf")
urdf = os.path.join(sim_dir, 'urdf', 'turtlebot3_waffle_gps.urdf')

with open(urdf, "r") as infp:
with open(urdf, 'r') as infp:
robot_description = infp.read()

# use local param file
launch_dir = os.path.dirname(os.path.realpath(__file__))
params_file = os.path.join(launch_dir, "nav2_no_map_params.yaml")
params_file = os.path.join(launch_dir, 'nav2_no_map_params.yaml')

configured_params = RewrittenYaml(
source_file=params_file,
root_key="",
param_rewrites="",
root_key='',
param_rewrites='',
convert_types=True,
)

return LaunchDescription(
[
SetEnvironmentVariable("RCUTILS_LOGGING_BUFFERED_STREAM", "1"),
SetEnvironmentVariable("RCUTILS_LOGGING_USE_STDOUT", "1"),
SetEnvironmentVariable('RCUTILS_LOGGING_BUFFERED_STREAM', '1'),
SetEnvironmentVariable('RCUTILS_LOGGING_USE_STDOUT', '1'),
AppendEnvironmentVariable(
"GZ_SIM_RESOURCE_PATH", os.path.join(sim_dir, "models")
'GZ_SIM_RESOURCE_PATH', os.path.join(sim_dir, 'models')
),
AppendEnvironmentVariable(
"GZ_SIM_RESOURCE_PATH",
'GZ_SIM_RESOURCE_PATH',
str(Path(os.path.join(sim_dir)).parent.resolve()),
),
ExecuteProcess(
cmd=["gz", "sim", "-r", "-s", world_sdf_xacro],
output="screen",
cmd=['gz', 'sim', '-r', '-s', world_sdf_xacro],
output='screen',
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(sim_dir, "launch", "spawn_tb3_gps.launch.py")
os.path.join(sim_dir, 'launch', 'spawn_tb3_gps.launch.py')
),
launch_arguments={
"use_sim_time": "True",
"robot_sdf": robot_sdf,
"x_pose": "0.0",
"y_pose": "0.0",
"z_pose": "0.0",
"roll": "0.0",
"pitch": "0.0",
"yaw": "0.0",
'use_sim_time': 'True',
'robot_sdf': robot_sdf,
'x_pose': '0.0',
'y_pose': '0.0',
'z_pose': '0.0',
'roll': '0.0',
'pitch': '0.0',
'yaw': '0.0',
}.items(),
),
Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
output="screen",
package='robot_state_publisher',
executable='robot_state_publisher',
name='robot_state_publisher',
output='screen',
parameters=[
{"use_sim_time": True, "robot_description": robot_description}
{'use_sim_time': True, 'robot_description': robot_description}
],
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(nav2_bringup_dir, "launch", "navigation_launch.py")
os.path.join(nav2_bringup_dir, 'launch', 'navigation_launch.py')
),
launch_arguments={
"namespace": "",
"use_namespace": "False",
"use_sim_time": "True",
"params_file": configured_params,
"use_composition": "False",
"autostart": "True",
'namespace': '',
'use_namespace': 'False',
'use_sim_time': 'True',
'params_file': configured_params,
'use_composition': 'False',
'autostart': 'True',
}.items(),
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, "dual_ekf_navsat.launch.py")
os.path.join(launch_dir, 'dual_ekf_navsat.launch.py')
),
),
]
Expand All @@ -123,9 +122,9 @@ def main(argv=sys.argv[1:]):
ld = generate_launch_description()

test1_action = ExecuteProcess(
cmd=[os.path.join(os.getenv("TEST_DIR"), "tester.py")],
name="tester_node",
output="screen",
cmd=[os.path.join(os.getenv('TEST_DIR'), 'tester.py')],
name='tester_node',
output='screen',
)

lts = LaunchTestService()
Expand All @@ -136,5 +135,5 @@ def main(argv=sys.argv[1:]):
return return_code


if __name__ == "__main__":
if __name__ == '__main__':
sys.exit(main())

0 comments on commit 2dea810

Please sign in to comment.