Skip to content

CI: update python lint workflow and reformat python code #528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/python_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Ensure Python code is linted and formatted, matching the style guide
name: Python Linting

on: [push]

jobs:
black-lint:
runs-on: ubuntu-latest
name: Python black Lint
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
version: "22.3.0"
# flake8-lint:
# runs-on: ubuntu-latest
# name: Python flake8 Lint
# steps:
# - name: Check out source repository
# uses: actions/checkout@v3

# - name: Set up Python environment
# uses: actions/setup-python@v4
# with:
# python-version: "3.11"

# - name: flake8 Lint
# uses: py-actions/flake8@v2
# with:
# ignore: "E701,W503,E203"
# exclude: "docs,.idea"
# max-line-length: "88"
# path: "."
# plugins: "flake8-docstrings flake8-black"
32 changes: 0 additions & 32 deletions .github/workflows/python_lint.yml

This file was deleted.

209 changes: 90 additions & 119 deletions CustomRobots/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,21 @@ endif()
# ===========================================================================
# find dependencies
set(PROJECT_DEPENDENCIES
ament_cmake
sensor_msgs
rclcpp
rclpy
urdf
xacro
ament_cmake_ros
gazebo
pluginlib
Threads
)

foreach(DEPENDENCY ${PROJECT_DEPENDENCIES})
find_package(${DEPENDENCY} REQUIRED)
ament_cmake
sensor_msgs
rclcpp
rclpy
urdf
xacro
ament_cmake_ros
gazebo
pluginlib
Threads)

foreach(dependency ${PROJECT_DEPENDENCIES})
find_package(${dependency} REQUIRED)
endforeach()


# ============================================================================
# Person plugin
if(CMAKE_USE_PTHREADS_INIT)
Expand All @@ -44,28 +42,23 @@ endif()
include_directories(${GAZEBO_INCLUDE_DIRS})

add_library(personplugin amazon_hospital/src/person.cpp)
target_include_directories(personplugin PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

ament_target_dependencies(
target_include_directories(
personplugin
"rclcpp"
"gazebo"
"pluginlib"
)
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

ament_target_dependencies(personplugin "rclcpp" "gazebo" "pluginlib")

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
# Causes the visibility macros to use dllexport rather than dllimport, which is
# appropriate when building the dll but not consuming it.
target_compile_definitions(personplugin PRIVATE "PERSONPLUGIN_BUILDING_LIBRARY")

install(
TARGETS personplugin
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
RUNTIME DESTINATION bin)

# ============================================================================
# Hooks
Expand All @@ -75,103 +68,81 @@ ament_environment_hooks("hooks/resource_paths.sh")
# ============================================================================
# Resources

install(DIRECTORY
# TURTLEBOT
Turtlebot2/turtlebot2_simulated/kobuki_description/launch
Turtlebot2/turtlebot2_simulated/kobuki_description/meshes
Turtlebot2/turtlebot2_simulated/kobuki_description/rviz
Turtlebot2/turtlebot2_simulated/kobuki_description/urdf
Turtlebot2/turtlebot2_simulated/turtlebot2/launch
Turtlebot2/turtlebot2_simulated/turtlebot2/rviz
Turtlebot2/turtlebot2_simulated/turtlebot2/urdf

# F1
f1/models
f1/launch
f1/worlds

# ROOMBA
roomba_robot/models
roomba_robot/worlds
roomba_robot/launch

# ACKERMAN CAR
ackermann_cars/models
ackermann_cars/worlds
ackermann_cars/launch

# CARS
car_junction/models
car_junction/worlds
car_junction/launch

# AMAZON WAREHOUSE ROBOT
amazon_robot/launch
amazon_robot/models
amazon_robot/worlds
amazon_robot/urdf
amazon_robot/meshes

# AMAZON HOSPITAL
amazon_hospital/models
amazon_hospital/hospital_world/launch
amazon_hospital/hospital_world/worlds
amazon_hospital/worlds
amazon_hospital/launch

# ACKERMANN LOGISTIC ROBOT
ackermann_logistic_robot/launch
ackermann_logistic_robot/models
ackermann_logistic_robot/worlds

# AUTOPARKING CARS
autoparking/launch
autoparking/models
autoparking/worlds

# DRONE_ASSETS
drone_assets/models
drone_assets/worlds
drone_assets/bridges

# GLOBAL_NAVIGATION
taxi_navigator/models

# 3D RECONSTRUCTION
3d_reconstruction/launch
3d_reconstruction/models
3d_reconstruction/worlds

# MARKER VISUAL LOC
marker_visual_loc/models
turtlebot3/models
turtlebot3/urdf
turtlebot3/params

# LASER MAPPING LOC
laser_mapping/models

restaurant/models

pick_place/models
pick_place/urdf


DESTINATION share/${PROJECT_NAME}
)
install(
DIRECTORY
# TURTLEBOT
Turtlebot2/turtlebot2_simulated/kobuki_description/launch
Turtlebot2/turtlebot2_simulated/kobuki_description/meshes
Turtlebot2/turtlebot2_simulated/kobuki_description/rviz
Turtlebot2/turtlebot2_simulated/kobuki_description/urdf
Turtlebot2/turtlebot2_simulated/turtlebot2/launch
Turtlebot2/turtlebot2_simulated/turtlebot2/rviz
Turtlebot2/turtlebot2_simulated/turtlebot2/urdf
# F1
f1/models
f1/launch
f1/worlds
# ROOMBA
roomba_robot/models
roomba_robot/worlds
roomba_robot/launch
# ACKERMAN CAR
ackermann_cars/models
ackermann_cars/worlds
ackermann_cars/launch
# CARS
car_junction/models
car_junction/worlds
car_junction/launch
# AMAZON WAREHOUSE ROBOT
amazon_robot/launch
amazon_robot/models
amazon_robot/worlds
amazon_robot/urdf
amazon_robot/meshes
# AMAZON HOSPITAL
amazon_hospital/models
amazon_hospital/hospital_world/launch
amazon_hospital/hospital_world/worlds
amazon_hospital/worlds
amazon_hospital/launch
# ACKERMANN LOGISTIC ROBOT
ackermann_logistic_robot/launch
ackermann_logistic_robot/models
ackermann_logistic_robot/worlds
# AUTOPARKING CARS
autoparking/launch
autoparking/models
autoparking/worlds
# DRONE_ASSETS
drone_assets/models
drone_assets/worlds
drone_assets/bridges
# GLOBAL_NAVIGATION
taxi_navigator/models
# 3D RECONSTRUCTION
3d_reconstruction/launch
3d_reconstruction/models
3d_reconstruction/worlds
# MARKER VISUAL LOC
marker_visual_loc/models
turtlebot3/models
turtlebot3/urdf
turtlebot3/params
# LASER MAPPING LOC
laser_mapping/models
restaurant/models
pick_place/models
pick_place/urdf
DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_libraries(personplugin)

ament_export_libraries(
personplugin
)

ament_export_targets(
export_${PROJECT_NAME}
)
ament_export_targets(export_${PROJECT_NAME})

ament_package()
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
6 changes: 3 additions & 3 deletions CustomRobots/ackermann_cars/launch/f1_autoparking.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
6 changes: 3 additions & 3 deletions CustomRobots/ackermann_cars/launch/lincoln.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def generate_launch_description():

# Set the path to the SDF model files.
gazebo_models_path = os.path.join(pkg_share, "models")
os.environ["GAZEBO_MODEL_PATH"] = (
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
)
os.environ[
"GAZEBO_MODEL_PATH"
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
Loading