diff --git a/CMakeLists.txt b/CMakeLists.txt index d47ad6c..491217f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ install( ) if(BUILD_TESTING) + set(ament_cmake_flake8_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ament_flake8.ini") find_package(ament_cmake_pytest REQUIRED) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() diff --git a/ament_flake8.ini b/ament_flake8.ini new file mode 100644 index 0000000..9761898 --- /dev/null +++ b/ament_flake8.ini @@ -0,0 +1,6 @@ +[flake8] +extend-ignore = B902,C816,D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404,I100,I202,Q000 +import-order-style = google +max-line-length = 99 +show-source = true +statistics = true diff --git a/launch/gazebo.launch.py b/launch/gazebo.launch.py index 2f30a76..165204e 100644 --- a/launch/gazebo.launch.py +++ b/launch/gazebo.launch.py @@ -24,8 +24,8 @@ import os from pathlib import Path -import yaml from ament_index_python.packages import get_package_prefix, get_package_share_directory +from launch import LaunchDescription from launch.actions import ( DeclareLaunchArgument, IncludeLaunchDescription, @@ -40,8 +40,8 @@ ) from launch_ros.actions import Node from lucy_control_supervisor.controllers_spawn import controllers_to_spawn +import yaml -from launch import LaunchDescription def _gz_ros2_control_plugin_path(): @@ -199,24 +199,23 @@ def _camera_compressor(topic: str, compressed_topic: str) -> Node: parameters=[{"use_sim_time": True}], output="screen", ) - else: - return Node( - package="image_transport", - executable="republish", - name="camera_compressor_" + safe, - remappings=[ - ("in", topic), - ("out/compressed", compressed_topic), - ], - parameters=[ - { - "use_sim_time": True, - "in_transport": "raw", - "out_transport": "compressed", - } - ], - output="screen", - ) + return Node( + package="image_transport", + executable="republish", + name="camera_compressor_" + safe, + remappings=[ + ("in", topic), + ("out/compressed", compressed_topic), + ], + parameters=[ + { + "use_sim_time": True, + "in_transport": "raw", + "out_transport": "compressed", + } + ], + output="screen", + ) camera_compressors = [ _camera_compressor(topic, compressed_topic) diff --git a/scripts/autocalibrate_joint_limits.py b/scripts/autocalibrate_joint_limits.py index 1adad30..52adea4 100644 --- a/scripts/autocalibrate_joint_limits.py +++ b/scripts/autocalibrate_joint_limits.py @@ -191,7 +191,8 @@ def setup(self, p, body, name_to_idx, cid) -> None: self._idxs = [name_to_idx[n] for n in self._joint_names] print( f"[--view rviz] publishing /joint_states for {len(self._joint_names)} joints. " - "Make sure `ros2 launch inmoov_urdf joint_preview.launch.py jsp_gui:=false` is running." + "Make sure `ros2 launch inmoov_urdf joint_preview.launch.py " + "jsp_gui:=false` is running." ) def step(self, p, body, name_to_idx, cid) -> None: diff --git a/test/test_hardware_yaml.py b/test/test_hardware_yaml.py index 934c3ea..1bd9059 100644 --- a/test/test_hardware_yaml.py +++ b/test/test_hardware_yaml.py @@ -87,7 +87,8 @@ def _active_yaml_path() -> Path: try: from ament_index_python.packages import get_package_share_directory - p = Path(get_package_share_directory("inmoov_urdf")) / "config" / "hardware" / "active.yaml" + share = get_package_share_directory("inmoov_urdf") + p = Path(share) / "config" / "hardware" / "active.yaml" if p.is_file(): return p except Exception: