Skip to content

Commit 81b2237

Browse files
authored
Merge pull request #528 from JdeRobot/ci-setup
CI: update python lint workflow and reformat python code
2 parents 456562f + ff470b5 commit 81b2237

File tree

104 files changed

+559
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+559
-583
lines changed

.github/workflows/python_lint.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Ensure Python code is linted and formatted, matching the style guide
2+
name: Python Linting
3+
4+
on: [push]
5+
6+
jobs:
7+
black-lint:
8+
runs-on: ubuntu-latest
9+
name: Python black Lint
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: psf/black@stable
13+
with:
14+
version: "22.3.0"
15+
# flake8-lint:
16+
# runs-on: ubuntu-latest
17+
# name: Python flake8 Lint
18+
# steps:
19+
# - name: Check out source repository
20+
# uses: actions/checkout@v3
21+
22+
# - name: Set up Python environment
23+
# uses: actions/setup-python@v4
24+
# with:
25+
# python-version: "3.11"
26+
27+
# - name: flake8 Lint
28+
# uses: py-actions/flake8@v2
29+
# with:
30+
# ignore: "E701,W503,E203"
31+
# exclude: "docs,.idea"
32+
# max-line-length: "88"
33+
# path: "."
34+
# plugins: "flake8-docstrings flake8-black"

.github/workflows/python_lint.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

CustomRobots/CMakeLists.txt

Lines changed: 90 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,21 @@ endif()
1818
# ===========================================================================
1919
# find dependencies
2020
set(PROJECT_DEPENDENCIES
21-
ament_cmake
22-
sensor_msgs
23-
rclcpp
24-
rclpy
25-
urdf
26-
xacro
27-
ament_cmake_ros
28-
gazebo
29-
pluginlib
30-
Threads
31-
)
32-
33-
foreach(DEPENDENCY ${PROJECT_DEPENDENCIES})
34-
find_package(${DEPENDENCY} REQUIRED)
21+
ament_cmake
22+
sensor_msgs
23+
rclcpp
24+
rclpy
25+
urdf
26+
xacro
27+
ament_cmake_ros
28+
gazebo
29+
pluginlib
30+
Threads)
31+
32+
foreach(dependency ${PROJECT_DEPENDENCIES})
33+
find_package(${dependency} REQUIRED)
3534
endforeach()
3635

37-
3836
# ============================================================================
3937
# Person plugin
4038
if(CMAKE_USE_PTHREADS_INIT)
@@ -44,28 +42,23 @@ endif()
4442
include_directories(${GAZEBO_INCLUDE_DIRS})
4543

4644
add_library(personplugin amazon_hospital/src/person.cpp)
47-
target_include_directories(personplugin PUBLIC
48-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
49-
$<INSTALL_INTERFACE:include>)
50-
51-
ament_target_dependencies(
45+
target_include_directories(
5246
personplugin
53-
"rclcpp"
54-
"gazebo"
55-
"pluginlib"
56-
)
47+
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
48+
$<INSTALL_INTERFACE:include>)
49+
50+
ament_target_dependencies(personplugin "rclcpp" "gazebo" "pluginlib")
5751

58-
# Causes the visibility macros to use dllexport rather than dllimport,
59-
# which is appropriate when building the dll but not consuming it.
52+
# Causes the visibility macros to use dllexport rather than dllimport, which is
53+
# appropriate when building the dll but not consuming it.
6054
target_compile_definitions(personplugin PRIVATE "PERSONPLUGIN_BUILDING_LIBRARY")
6155

6256
install(
6357
TARGETS personplugin
6458
EXPORT export_${PROJECT_NAME}
6559
ARCHIVE DESTINATION lib
6660
LIBRARY DESTINATION lib
67-
RUNTIME DESTINATION bin
68-
)
61+
RUNTIME DESTINATION bin)
6962

7063
# ============================================================================
7164
# Hooks
@@ -75,103 +68,81 @@ ament_environment_hooks("hooks/resource_paths.sh")
7568
# ============================================================================
7669
# Resources
7770

78-
install(DIRECTORY
79-
# TURTLEBOT
80-
Turtlebot2/turtlebot2_simulated/kobuki_description/launch
81-
Turtlebot2/turtlebot2_simulated/kobuki_description/meshes
82-
Turtlebot2/turtlebot2_simulated/kobuki_description/rviz
83-
Turtlebot2/turtlebot2_simulated/kobuki_description/urdf
84-
Turtlebot2/turtlebot2_simulated/turtlebot2/launch
85-
Turtlebot2/turtlebot2_simulated/turtlebot2/rviz
86-
Turtlebot2/turtlebot2_simulated/turtlebot2/urdf
87-
88-
# F1
89-
f1/models
90-
f1/launch
91-
f1/worlds
92-
93-
# ROOMBA
94-
roomba_robot/models
95-
roomba_robot/worlds
96-
roomba_robot/launch
97-
98-
# ACKERMAN CAR
99-
ackermann_cars/models
100-
ackermann_cars/worlds
101-
ackermann_cars/launch
102-
103-
# CARS
104-
car_junction/models
105-
car_junction/worlds
106-
car_junction/launch
107-
108-
# AMAZON WAREHOUSE ROBOT
109-
amazon_robot/launch
110-
amazon_robot/models
111-
amazon_robot/worlds
112-
amazon_robot/urdf
113-
amazon_robot/meshes
114-
115-
# AMAZON HOSPITAL
116-
amazon_hospital/models
117-
amazon_hospital/hospital_world/launch
118-
amazon_hospital/hospital_world/worlds
119-
amazon_hospital/worlds
120-
amazon_hospital/launch
121-
122-
# ACKERMANN LOGISTIC ROBOT
123-
ackermann_logistic_robot/launch
124-
ackermann_logistic_robot/models
125-
ackermann_logistic_robot/worlds
126-
127-
# AUTOPARKING CARS
128-
autoparking/launch
129-
autoparking/models
130-
autoparking/worlds
131-
132-
# DRONE_ASSETS
133-
drone_assets/models
134-
drone_assets/worlds
135-
drone_assets/bridges
136-
137-
# GLOBAL_NAVIGATION
138-
taxi_navigator/models
139-
140-
# 3D RECONSTRUCTION
141-
3d_reconstruction/launch
142-
3d_reconstruction/models
143-
3d_reconstruction/worlds
144-
145-
# MARKER VISUAL LOC
146-
marker_visual_loc/models
147-
turtlebot3/models
148-
turtlebot3/urdf
149-
turtlebot3/params
150-
151-
# LASER MAPPING LOC
152-
laser_mapping/models
153-
154-
restaurant/models
155-
156-
pick_place/models
157-
pick_place/urdf
158-
159-
160-
DESTINATION share/${PROJECT_NAME}
161-
)
71+
install(
72+
DIRECTORY
73+
# TURTLEBOT
74+
Turtlebot2/turtlebot2_simulated/kobuki_description/launch
75+
Turtlebot2/turtlebot2_simulated/kobuki_description/meshes
76+
Turtlebot2/turtlebot2_simulated/kobuki_description/rviz
77+
Turtlebot2/turtlebot2_simulated/kobuki_description/urdf
78+
Turtlebot2/turtlebot2_simulated/turtlebot2/launch
79+
Turtlebot2/turtlebot2_simulated/turtlebot2/rviz
80+
Turtlebot2/turtlebot2_simulated/turtlebot2/urdf
81+
# F1
82+
f1/models
83+
f1/launch
84+
f1/worlds
85+
# ROOMBA
86+
roomba_robot/models
87+
roomba_robot/worlds
88+
roomba_robot/launch
89+
# ACKERMAN CAR
90+
ackermann_cars/models
91+
ackermann_cars/worlds
92+
ackermann_cars/launch
93+
# CARS
94+
car_junction/models
95+
car_junction/worlds
96+
car_junction/launch
97+
# AMAZON WAREHOUSE ROBOT
98+
amazon_robot/launch
99+
amazon_robot/models
100+
amazon_robot/worlds
101+
amazon_robot/urdf
102+
amazon_robot/meshes
103+
# AMAZON HOSPITAL
104+
amazon_hospital/models
105+
amazon_hospital/hospital_world/launch
106+
amazon_hospital/hospital_world/worlds
107+
amazon_hospital/worlds
108+
amazon_hospital/launch
109+
# ACKERMANN LOGISTIC ROBOT
110+
ackermann_logistic_robot/launch
111+
ackermann_logistic_robot/models
112+
ackermann_logistic_robot/worlds
113+
# AUTOPARKING CARS
114+
autoparking/launch
115+
autoparking/models
116+
autoparking/worlds
117+
# DRONE_ASSETS
118+
drone_assets/models
119+
drone_assets/worlds
120+
drone_assets/bridges
121+
# GLOBAL_NAVIGATION
122+
taxi_navigator/models
123+
# 3D RECONSTRUCTION
124+
3d_reconstruction/launch
125+
3d_reconstruction/models
126+
3d_reconstruction/worlds
127+
# MARKER VISUAL LOC
128+
marker_visual_loc/models
129+
turtlebot3/models
130+
turtlebot3/urdf
131+
turtlebot3/params
132+
# LASER MAPPING LOC
133+
laser_mapping/models
134+
restaurant/models
135+
pick_place/models
136+
pick_place/urdf
137+
DESTINATION share/${PROJECT_NAME})
162138

163139
if(BUILD_TESTING)
164140
find_package(ament_lint_auto REQUIRED)
165141
ament_lint_auto_find_test_dependencies()
166142
endif()
167143

144+
ament_export_libraries(personplugin)
168145

169-
ament_export_libraries(
170-
personplugin
171-
)
172-
173-
ament_export_targets(
174-
export_${PROJECT_NAME}
175-
)
146+
ament_export_targets(export_${PROJECT_NAME})
176147

177148
ament_package()

CustomRobots/ackermann_cars/launch/autocar_autoparking.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

CustomRobots/ackermann_cars/launch/f1_autoparking.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

CustomRobots/ackermann_cars/launch/lincoln.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

CustomRobots/ackermann_cars/launch/montmelo_circuit_ackermann.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

CustomRobots/ackermann_cars/launch/montmelo_circuit_ackermann_followingcam.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

CustomRobots/ackermann_cars/launch/montreal_circuit_ackermann.launch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def generate_launch_description():
2222

2323
# Set the path to the SDF model files.
2424
gazebo_models_path = os.path.join(pkg_share, "models")
25-
os.environ["GAZEBO_MODEL_PATH"] = (
26-
f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
27-
)
25+
os.environ[
26+
"GAZEBO_MODEL_PATH"
27+
] = f"{os.environ.get('GAZEBO_MODEL_PATH', '')}:{':'.join(gazebo_models_path)}"
2828

2929
########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
3030
# Launch configuration variables specific to simulation

0 commit comments

Comments
 (0)