Skip to content

Commit

Permalink
Fix flake8 (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Apr 4, 2024
1 parent 9853c08 commit f553c42
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 26 deletions.
15 changes: 10 additions & 5 deletions gz_ros2_control_demos/launch/cart_example_effort.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -33,7 +33,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_cart_effort.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_cart_effort.xacro.urdf"]
),
]
)
Expand All @@ -50,7 +51,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "cart", "-allow_renaming", "true"],
arguments=["-topic", "robot_description",
"-name", "cart", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand All @@ -60,15 +62,18 @@ def generate_launch_description():
)

load_joint_effort_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'effort_controller'],
cmd=['ros2', 'control', 'load_controller',
'--set-state', 'active', 'effort_controller'],
output='screen'
)

return LaunchDescription([
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 3 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down
12 changes: 8 additions & 4 deletions gz_ros2_control_demos/launch/cart_example_position.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -33,7 +33,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_cart_position.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_cart_position.xacro.urdf"]
),
]
)
Expand All @@ -50,7 +51,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "cart", "-allow_renaming", "true"],
arguments=["-topic", "robot_description",
"-name", "cart", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand All @@ -69,7 +71,9 @@ def generate_launch_description():
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down
15 changes: 10 additions & 5 deletions gz_ros2_control_demos/launch/cart_example_velocity.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -33,7 +33,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_cart_velocity.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_cart_velocity.xacro.urdf"]
),
]
)
Expand All @@ -50,7 +51,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "cart", "-allow_renaming", "true"],
arguments=["-topic", "robot_description",
"-name", "cart", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand All @@ -60,15 +62,18 @@ def generate_launch_description():
)

load_joint_velocity_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'velocity_controller'],
cmd=['ros2', 'control', 'load_controller',
'--set-state', 'active', 'velocity_controller'],
output='screen'
)

return LaunchDescription([
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 3 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down
12 changes: 8 additions & 4 deletions gz_ros2_control_demos/launch/diff_drive_example.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -33,7 +33,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_diff_drive.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_diff_drive.xacro.urdf"]
),
]
)
Expand All @@ -50,7 +51,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "diff_drive", "-allow_renaming", "true"],
arguments=["-topic", "robot_description", "-name",
"diff_drive", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand All @@ -69,7 +71,9 @@ def generate_launch_description():
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -36,7 +36,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_gripper_mimic_joint.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_gripper_mimic_joint.xacro.urdf"]
),
]
)
Expand All @@ -53,7 +54,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "gripper", "-allow_renaming", "true"],
arguments=["-topic", "robot_description", "-name",
"gripper", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand All @@ -72,7 +74,9 @@ def generate_launch_description():
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down
12 changes: 8 additions & 4 deletions gz_ros2_control_demos/launch/tricycle_drive_example.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution, LaunchConfiguration
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand All @@ -33,7 +33,8 @@ def generate_launch_description():
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("gz_ros2_control_demos"), "urdf", "test_tricycle_drive.xacro.urdf"]
[FindPackageShare("gz_ros2_control_demos"),
"urdf", "test_tricycle_drive.xacro.urdf"]
),
]
)
Expand All @@ -50,7 +51,8 @@ def generate_launch_description():
package='ros_gz_sim',
executable='create',
output='screen',
arguments=["-topic", "robot_description", "-name", "tricyle", "-allow_renaming", "true"],
arguments=["-topic", "robot_description", "-name",
"tricyle", "-allow_renaming", "true"],
)

load_joint_state_broadcaster = ExecuteProcess(
Expand Down Expand Up @@ -78,7 +80,9 @@ def generate_launch_description():
# Launch gazebo environment
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'), 'launch', 'gz_sim.launch.py'])]),
[PathJoinSubstitution([FindPackageShare('ros_gz_sim'),
'launch',
'gz_sim.launch.py'])]),
launch_arguments=[('gz_args', [' -r -v 4 empty.sdf'])]),
RegisterEventHandler(
event_handler=OnProcessExit(
Expand Down

0 comments on commit f553c42

Please sign in to comment.