Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
luis-camero committed Apr 10, 2024
1 parent 898a712 commit 7db41cc
Showing 13 changed files with 35 additions and 33 deletions.
8 changes: 4 additions & 4 deletions clearpath_diagnostics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ find_package(ament_cmake_python REQUIRED)

ament_python_install_package(${PROJECT_NAME})

install(
PROGRAMS ${PROJECT_NAME}/diagnostics_updater
${PROJECT_NAME}/battery_state/battery_state_estimator
${PROJECT_NAME}/battery_state/battery_state_control
install(PROGRAMS
${PROJECT_NAME}/diagnostics_updater
${PROJECT_NAME}/battery_state/battery_state_estimator
${PROJECT_NAME}/battery_state/battery_state_control
DESTINATION lib/${PROJECT_NAME}
)

Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@

class Battery:
class BaseBattery:
""" Base Battery class. """
"""Base Battery class."""

"""Battery configuration. Represents number of battery cells in series and parallel."""
CONFIGURATIONS = {
@@ -189,6 +189,7 @@ def update_cells(self):

class LiION(BaseBattery):
"""Base Lithium ION battery."""

LUT = []

def __init__(
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@

from clearpath_config.platform.battery import BatteryConfig
from clearpath_generator_common.common import LaunchFile, Package
from clearpath_generator_common.launch.writer import LaunchWriter
from clearpath_generator_common.launch.generator import LaunchGenerator
from clearpath_generator_common.launch.writer import LaunchWriter
from clearpath_generator_robot.launch.sensors import SensorLaunch

from clearpath_config.common.types.platform import Platform
Original file line number Diff line number Diff line change
@@ -29,9 +29,8 @@
# Redistribution and use in source and binary forms, with or without
# modification, is not permitted without the express permission
# of Clearpath Robotics.

from clearpath_config.sensors.types.sensor import BaseSensor
from clearpath_config.sensors.types.cameras import BaseCamera
from clearpath_config.sensors.types.sensor import BaseSensor

from clearpath_generator_common.common import LaunchFile, Package, ParamFile
from clearpath_generator_common.launch.writer import LaunchWriter
@@ -84,7 +83,7 @@ def generate(self):
if self.sensor.get_sensor_type() == BaseCamera.get_sensor_type():
for republihser in self.sensor._republishers:
sensor_writer.add(LaunchFile(
"image_%s" % republihser.TYPE,
'image_%s' % republihser.TYPE,
package=self.CLEARPATH_SENSORS_PACKAGE,
args=[
(self.NAMESPACE, self.namespace),
9 changes: 5 additions & 4 deletions clearpath_generator_robot/test/test_generator_launch.py
Original file line number Diff line number Diff line change
@@ -25,11 +25,12 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from clearpath_generator_robot.launch.generator import RobotLaunchGenerator
import os
import shutil

SAMPLE_DIR = "/opt/ros/humble/share/clearpath_config/sample/"
from clearpath_generator_robot.launch.generator import RobotLaunchGenerator

SAMPLE_DIR = '/opt/ros/humble/share/clearpath_config/sample/'


class TestRobotLaunchGenerator:
@@ -39,7 +40,7 @@ def test_samples(self):
for sample in os.listdir(SAMPLE_DIR):
# Create Clearpath Directory
src = os.path.join(SAMPLE_DIR, sample)
dst = os.path.join(os.environ["HOME"], ".clearpath", "robot.yaml")
dst = os.path.join(os.environ['HOME'], '.clearpath', 'robot.yaml')
shutil.rmtree(os.path.dirname(dst))
os.makedirs(os.path.dirname(dst), exist_ok=True)
shutil.copy(src, dst)
@@ -52,4 +53,4 @@ def test_samples(self):
sample,
e.args[0],
))
assert not errors, "Errors: %s" % "\n".join(errors)
assert not errors, 'Errors: %s' % '\n'.join(errors)
9 changes: 5 additions & 4 deletions clearpath_generator_robot/test/test_generator_param.py
Original file line number Diff line number Diff line change
@@ -25,11 +25,12 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from clearpath_generator_robot.param.generator import RobotParamGenerator
import os
import shutil

SAMPLE_DIR = "/opt/ros/humble/share/clearpath_config/sample/"
from clearpath_generator_robot.param.generator import RobotParamGenerator

SAMPLE_DIR = '/opt/ros/humble/share/clearpath_config/sample/'


class TestRobotLaunchGenerator:
@@ -39,7 +40,7 @@ def test_samples(self):
for sample in os.listdir(SAMPLE_DIR):
# Create Clearpath Directory
src = os.path.join(SAMPLE_DIR, sample)
dst = os.path.join(os.environ["HOME"], ".clearpath", "robot.yaml")
dst = os.path.join(os.environ['HOME'], '.clearpath', 'robot.yaml')
shutil.rmtree(os.path.dirname(dst))
os.makedirs(os.path.dirname(dst), exist_ok=True)
shutil.copy(src, dst)
@@ -52,4 +53,4 @@ def test_samples(self):
sample,
e.args[0],
))
assert not errors, "Errors: %s" % "\n".join(errors)
assert not errors, 'Errors: %s' % '\n'.join(errors)
4 changes: 2 additions & 2 deletions clearpath_sensors/launch/flir_blackfly.launch.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node, ComposableNodeContainer
from launch_ros.actions import ComposableNodeContainer, Node
from launch_ros.descriptions import ComposableNode
from launch_ros.substitutions import FindPackageShare

@@ -58,7 +58,7 @@ def generate_launch_description():
'namespace',
default_value='sensors/camera_0')

name = "flir_blackfly"
name = 'flir_blackfly'
blackfly_camera_node = Node(
package='spinnaker_camera_driver',
namespace=namespace,
6 changes: 3 additions & 3 deletions clearpath_sensors/launch/image_compressed_to_raw.launch.py
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ def generate_launch_description():
)

compressed_transport_node = Node(
name="image_compressed_to_raw",
name='image_compressed_to_raw',
namespace=namespace,
package="image_transport",
executable="republish",
package='image_transport',
executable='republish',
remappings=[
('in/compressed', in_compressed),
('out', out_raw),
6 changes: 3 additions & 3 deletions clearpath_sensors/launch/image_raw_to_compressed.launch.py
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ def generate_launch_description():
)

compressed_transport_node = Node(
name="image_raw_to_compressed",
name='image_raw_to_compressed',
namespace=namespace,
package="image_transport",
executable="republish",
package='image_transport',
executable='republish',
remappings=[
('in', in_raw),
('out/compressed', out_compressed),
6 changes: 3 additions & 3 deletions clearpath_sensors/launch/image_raw_to_theora.launch.py
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ def generate_launch_description():
)

theora_transport_node = Node(
name="image_raw_to_theora",
name='image_raw_to_theora',
namespace=namespace,
package="image_transport",
executable="republish",
package='image_transport',
executable='republish',
remappings=[
('in', in_raw),
('out/theora', out_theora),
2 changes: 1 addition & 1 deletion clearpath_sensors/launch/image_rectify.launch.py
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ def generate_launch_description():
load_composable_nodes = LoadComposableNodes(
condition=LaunchConfigurationNotEquals('container', ''),
composable_node_descriptions=composable_nodes,
target_container=PythonExpression(["'", namespace, "/", container, "'"])
target_container=PythonExpression(["'", namespace, '/', container, "'"])
)

ld = LaunchDescription()
2 changes: 1 addition & 1 deletion clearpath_sensors/launch/image_resize.launch.py
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ def generate_launch_description():
load_composable_nodes = LoadComposableNodes(
condition=LaunchConfigurationNotEquals('container', ''),
composable_node_descriptions=composable_nodes,
target_container=PythonExpression(["'", namespace, "/", container, "'"])
target_container=PythonExpression(["'", namespace, '/', container, "'"])
)

ld = LaunchDescription()
6 changes: 3 additions & 3 deletions clearpath_sensors/launch/image_theora_to_raw.launch.py
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ def generate_launch_description():
)

theora_transport_node = Node(
name="image_theora_to_raw",
name='image_theora_to_raw',
namespace=namespace,
package="image_transport",
executable="republish",
package='image_transport',
executable='republish',
remappings=[
('in/theora', in_theora),
('out', out_raw),

0 comments on commit 7db41cc

Please sign in to comment.