Skip to content

Commit

Permalink
fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
filiparag committed Dec 2, 2021
1 parent e8b9231 commit 85737ba
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
6 changes: 4 additions & 2 deletions mep3_driver/launch/driver_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
33 changes: 18 additions & 15 deletions mep3_simulation/launch/robot_launch.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
14 changes: 8 additions & 6 deletions mep3_simulation/setup.py
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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


Expand Down

0 comments on commit 85737ba

Please sign in to comment.