Skip to content

Commit

Permalink
Updates setup.py to use setup_utils package
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasweihing committed Nov 25, 2024
1 parent 7e83753 commit 6caa7ef
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 35 deletions.
2 changes: 1 addition & 1 deletion camera_preprocessing/camera_calibration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self):
)
chessboard_path = self.declare_parameter("chessboard_path", "none").value
subscriber_topic = self.declare_parameter(
"subscriber_topic", "/camera/image_raw"
"image_topic", "/camera/image_raw"
).value
self.bridge = CvBridge()
self.lock = False
Expand Down
2 changes: 1 addition & 1 deletion camera_preprocessing/camera_preprocessing_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self):
)
num_skip_frames = self.declare_parameter("num_skip_frames", 1).value
subscriber_topic = self.declare_parameter(
"subscriber_topic", "/camera/image_raw"
"image_topic", "/camera/image_raw"
).value
undistorted_publisher_topic = self.declare_parameter(
"undistorted_publisher_topic", "/camera/undistorted"
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<depend>rclpy</depend>
<depend>sensor_msgs</depend>
<depend>cv_bridge</depend>
<depend>timing</depend>
<depend>setup_utils</depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
Expand Down
48 changes: 15 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,35 @@
import os

from setup_utils import include_directory
from setuptools import find_packages, setup

package_name = "camera_preprocessing"


# ToDo: Add this to the utils package and import it here
def package_files(directory_list):
"""
Collect all files in the given directories.
Arguments:
directory_list -- List of directories to search for files.
Returns:
List of paths to all files in the given directories
"""
paths = []
for directory in directory_list:
for path, directories, filenames in os.walk(directory):
for filename in filenames:
if filename.endswith(".pdf"):
continue
paths.append(os.path.join(path, filename))
return paths


setup(
name=package_name,
version="1.0.0",
packages=find_packages(exclude=["test"]),
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
("share/" + package_name, ["package.xml"]),
(
os.path.join("share", package_name, "img/calib/Neue_3MP_Kamera"),
package_files(["img/calib/Neue_3MP_Kamera"]),
*include_directory(
install_path=os.path.join("share", package_name, "img/calib"),
source_path="img/calib",
exclude=[".pdf"],
),
(
os.path.join("share", package_name, "img/position"),
package_files(["img/position"]),
*include_directory(
install_path=os.path.join("share", package_name, "img/position"),
source_path="img/position",
exclude=[".pdf"],
),
(
os.path.join("share", package_name, "config"),
package_files(["config"]),
*include_directory(
install_path=os.path.join("share", package_name, "config"),
source_path="config",
),
(
os.path.join("share", package_name, "launch"),
package_files(["launch"]),
*include_directory(
install_path=os.path.join("share", package_name, "launch"),
source_path="launch",
),
],
install_requires=["setuptools"],
Expand Down

0 comments on commit 6caa7ef

Please sign in to comment.