Skip to content

Commit

Permalink
Fixing Lint in all packages (#2)
Browse files Browse the repository at this point in the history
* new linter test

* fix github actions on push on autonav_2.0

* removed interface backup files

* fixed unrustify

* fixed uncrustify

* fix uncrustify

* fixed cpplint

* fixed cpplint

* fixed cpplint

* fixed flake8 percpt

* fix flake8 localization

* fix flake firmware

* fix flake navigation

* fix flake description

* Changed double quotes to single in all files

* fix flake controller and bringup

* fix flake remaining

* fix flake remaining
  • Loading branch information
JatinPatil2003 authored Aug 17, 2024
1 parent 1198226 commit 6aac2e0
Show file tree
Hide file tree
Showing 35 changed files with 638 additions and 1,141 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/linter,yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Lint
on:
pull_request:
push:
branches:
- autonav_2.0
workflow_dispatch:

jobs:
Expand All @@ -20,4 +22,4 @@ jobs:
with:
linter: ${{ matrix.linter }}
distribution: rolling
package-name: "*"
package-name: "autonav_bringup autonav_controller autonav_description autonav_firmware autonav_localization autonav_navigation autonav_perception autonav_utils"
110 changes: 53 additions & 57 deletions autonav_bringup/launch/autonav_bringup.launch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import os
from ament_index_python.packages import get_package_share_directory

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, TimerAction, IncludeLaunchDescription
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
RegisterEventHandler,
TimerAction,
)
from launch.conditions import IfCondition
from launch.event_handlers import OnProcessStart
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import (
Command,
FindExecutable,
Expand All @@ -11,88 +19,83 @@
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch_ros.parameter_descriptions import ParameterValue
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessStart
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource


def generate_launch_description():
autonav_description_dir = get_package_share_directory("autonav_description")
autonav_localization_dir = get_package_share_directory("autonav_localization")
autonav_description_dir = get_package_share_directory('autonav_description')
autonav_localization_dir = get_package_share_directory('autonav_localization')
pkg_bno055 = get_package_share_directory('bno055')
pkg_ydlidar = get_package_share_directory('ydlidar_ros2_driver')

use_rviz_arg = DeclareLaunchArgument(
"rviz",
default_value="False",
'rviz',
default_value='False',
)

rviz = LaunchConfiguration("rviz")
rviz = LaunchConfiguration('rviz')

robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution([FindExecutable(name='xacro')]),
' ',
PathJoinSubstitution(
[
FindPackageShare("autonav_description"),
"urdf",
"autonav.xacro",
FindPackageShare('autonav_description'),
'urdf',
'autonav.xacro',
]
),
]
)
robot_description = {"robot_description": robot_description_content}
robot_description = {'robot_description': robot_description_content}

robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[robot_description],
)

rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="screen",
arguments=["-d", os.path.join(autonav_description_dir, "rviz", "display.rviz")],
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d', os.path.join(autonav_description_dir, 'rviz', 'display.rviz')],
condition=IfCondition(rviz),
)

imu = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_bno055, 'launch', 'bno055.launch.py'),
os.path.join(pkg_bno055, 'launch', 'bno055.launch.py'),
)
)
)

lidar = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ydlidar, 'launch', 'ydlidar_launch.py'),
os.path.join(pkg_ydlidar, 'launch', 'ydlidar_launch.py'),
)
)

controller_params_file = os.path.join(
get_package_share_directory("autonav_controller"),
"config",
"autonav_controllers.yaml",
get_package_share_directory('autonav_controller'),
'config',
'autonav_controllers.yaml',
)

controller_manager = Node(
package="controller_manager",
executable="ros2_control_node",
package='controller_manager',
executable='ros2_control_node',
parameters=[robot_description, controller_params_file],
)

delayed_controller_manager = TimerAction(period=3.0, actions=[controller_manager])

autonav_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["autonav_controller", "--controller-manager", "/controller_manager"],
package='controller_manager',
executable='spawner',
arguments=['autonav_controller', '--controller-manager', '/controller_manager'],
remappings=[
("/autonav_controller/cmd_vel_unstamped", "/autonav_controller/cmd_vel"),
('/autonav_controller/cmd_vel_unstamped', '/autonav_controller/cmd_vel'),
],
)

Expand All @@ -104,12 +107,12 @@ def generate_launch_description():
)

joint_broad_spawner = Node(
package="controller_manager",
executable="spawner",
package='controller_manager',
executable='spawner',
arguments=[
"joint_state_broadcaster",
"--controller-manager",
"/controller_manager",
'joint_state_broadcaster',
'--controller-manager',
'/controller_manager',
],
)

Expand All @@ -120,27 +123,21 @@ def generate_launch_description():
)
)

pid_controller = Node(
package="autonav_controller",
executable="pid_controller.py",
output="screen",
)

lidar_republisher = Node(
package="autonav_controller",
executable="lidar_republisher.py",
output="screen",
package='autonav_controller',
executable='lidar_republisher.py',
output='screen',
)

velocity_republisher = Node(
package="autonav_controller",
executable="cmd_vel_republisher.py",
output="screen",
package='autonav_controller',
executable='cmd_vel_republisher.py',
output='screen',
)

ekf = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(autonav_localization_dir, 'launch', 'ekf.launch.py'),
os.path.join(autonav_localization_dir, 'launch', 'ekf.launch.py'),
)
)

Expand All @@ -152,7 +149,6 @@ def generate_launch_description():
delayed_controller_manager,
delayed_diff_drive_spawner,
delayed_joint_broad_spawner,
# pid_controller,
imu,
lidar,
ekf,
Expand Down
35 changes: 13 additions & 22 deletions autonav_bringup/launch/view_rviz.launch.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
import os
from ament_index_python.packages import get_package_share_directory

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, TimerAction
from launch.substitutions import (
Command,
FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch_ros.parameter_descriptions import ParameterValue
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessStart
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
autonav_description_dir = get_package_share_directory("autonav_description")
autonav_description_dir = get_package_share_directory('autonav_description')

use_rviz_arg = DeclareLaunchArgument(
"rviz",
default_value="True",
'rviz',
default_value='True',
)

rviz = LaunchConfiguration("rviz")
rviz = LaunchConfiguration('rviz')

rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="screen",
arguments=["-d", os.path.join(autonav_description_dir, "rviz", "display.rviz")],
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d', os.path.join(autonav_description_dir, 'rviz', 'display.rviz')],
condition=IfCondition(rviz),
)

Expand Down
15 changes: 7 additions & 8 deletions autonav_bringup/launch/view_rviz_cartographer.launch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/python3

import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch_ros.substitutions import FindPackageShare
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():

Expand All @@ -17,7 +16,7 @@ def generate_launch_description():

return LaunchDescription([
DeclareLaunchArgument(
name='rviz',
name='rviz',
default_value='true',
description='Run rviz'
),
Expand All @@ -28,6 +27,6 @@ def generate_launch_description():
name='rviz2',
output='screen',
arguments=['-d', rviz_config_path],
condition=IfCondition(LaunchConfiguration("rviz")),
condition=IfCondition(LaunchConfiguration('rviz')),
)
])
])
15 changes: 7 additions & 8 deletions autonav_bringup/launch/view_rviz_navigation.launch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/python3

import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch_ros.substitutions import FindPackageShare
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():

Expand All @@ -17,7 +16,7 @@ def generate_launch_description():

return LaunchDescription([
DeclareLaunchArgument(
name='rviz',
name='rviz',
default_value='true',
description='Run rviz'
),
Expand All @@ -28,6 +27,6 @@ def generate_launch_description():
name='rviz2',
output='screen',
arguments=['-d', rviz_config_path],
condition=IfCondition(LaunchConfiguration("rviz")),
condition=IfCondition(LaunchConfiguration('rviz')),
)
])
])
Loading

0 comments on commit 6aac2e0

Please sign in to comment.