diff --git a/mep3_driver/launch/driver_launch.py b/mep3_driver/launch/driver_launch.py index 951ea9fbc..4d61095d0 100644 --- a/mep3_driver/launch/driver_launch.py +++ b/mep3_driver/launch/driver_launch.py @@ -8,8 +8,10 @@ def generate_launch_description(): package_dir = get_package_share_directory('mep3_driver') - robot_description = pathlib.Path(os.path.join(package_dir, 'resource', 'mep3_big_config.urdf')).read_text() - ros2_control_params = os.path.join(package_dir, 'resource', 'mep3_big_ros2_control.yaml') + robot_description = pathlib.Path(os.path.join( + package_dir, 'resource', 'mep3_big_config.urdf')).read_text() + ros2_control_params = os.path.join( + package_dir, 'resource', 'mep3_big_ros2_control.yaml') controller_manager_node = Node( package="controller_manager", diff --git a/mep3_simulation/launch/robot_launch.py b/mep3_simulation/launch/robot_launch.py index 6ce7cc32c..2733261c7 100644 --- a/mep3_simulation/launch/robot_launch.py +++ b/mep3_simulation/launch/robot_launch.py @@ -1,12 +1,14 @@ import os import pathlib -import launch + +from ament_index_python.packages import get_package_share_directory from launch_ros.actions import Node -from launch.substitutions import LaunchConfiguration +from webots_ros2_core.webots_launcher import WebotsLauncher + +import launch from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource -from ament_index_python.packages import get_package_share_directory -from webots_ros2_core.webots_launcher import WebotsLauncher +from launch.substitutions import LaunchConfiguration def generate_launch_description(): @@ -41,11 +43,12 @@ def generate_launch_description(): arguments=['joint_state_broadcaster'] + controller_manager_timeout, ) - # The node which interacts with a robot in the Webots simulation is located in the - # `webots_ros2_driver` package under name `driver`. + # The node which interacts with a robot in the Webots simulation is located + # in the `webots_ros2_driver` package under name `driver`. # It is necessary to run such a node for each robot in the simulation. - # Typically, we provide it the `robot_description` parameters from a URDF file and - # `ros2_control_params` from the `ros2_control` configuration file. + # Typically, we provide it the `robot_description` parameters from a URDF + # file and `ros2_control_params` from the `ros2_control` + # configuration file. webots_robot_driver = Node( package='webots_ros2_driver', executable='driver', @@ -58,13 +61,13 @@ def generate_launch_description(): ] ) - # Often we want to publish robot transforms, so we use the `robot_state_publisher` - # node for that. - # If robot model is not specified in the URDF file then Webots can help us with the - # URDF exportation feature. - # Since the exportation feature is available only once the simulation has started and - # the `robot_state_publisher` node requires a `robot_description` parameter before we - # have to specify a dummy robot. + # Often we want to publish robot transforms, so we use the + # `robot_state_publisher` node for that. + # If robot model is not specified in the URDF file then Webots can help + # us with the URDF exportation feature. + # Since the exportation feature is available only once the simulation has + # started and the `robot_state_publisher` node requires a + # `robot_description` parameter before we have to specify a dummy robot. robot_state_publisher = Node( package='robot_state_publisher', executable='robot_state_publisher', diff --git a/mep3_simulation/setup.py b/mep3_simulation/setup.py index 2bf16c7c8..0941ec838 100644 --- a/mep3_simulation/setup.py +++ b/mep3_simulation/setup.py @@ -1,6 +1,7 @@ -from setuptools import setup -from glob import glob import os +from glob import glob + +from setuptools import setup package_name = 'mep3_simulation' @@ -18,11 +19,12 @@ } -def files_in_directory(dir, extension=None): +def files_in_directory(path, extension=None): files = [] - for i in os.listdir(dir): - if not os.path.isdir(f'{dir}/{i}') and (extension is None or i.endswith(extension)): - files.append(f'{dir}/{i}') + for i in os.listdir(path): + if not os.path.isdir(f'{path}/{i}') and \ + (extension is None or i.endswith(extension)): + files.append(f'{path}/{i}') return files