Skip to content
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
21 changes: 21 additions & 0 deletions src/lane_path_detection/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ROS2工作空间临时文件(核心忽略项)
build/
install/
log/
.colcon*
.ros/

# Python缓存文件
__pycache__/
*.pyc
*.pyo
*.pyd

# Windows系统文件
Thumbs.db
Desktop.ini

# IDE/编辑器配置(可选,根据自己使用的工具加)
.vscode/
.idea/
*.sublime-*
28 changes: 28 additions & 0 deletions src/lane_path_detection/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<!-- 功能包名称:必须和lane_path_detection一致 -->
<name>lane_path_detection</name>
<version>0.0.0</version>
<description>ROS2 package for lane path detection</description>
<!-- 自定义信息:可改自己的名字/邮箱,也可保留默认 -->
<maintainer email="rosli@example.com">rosli</maintainer>
<license>Apache-2.0</license>

<!-- ROS2 Python核心依赖(必须) -->
<buildtool_depend>ament_python</buildtool_depend>
<build_depend>rclpy</build_depend>
<exec_depend>rclpy</exec_depend>

<!-- 车道检测常用依赖(建议保留,适配图像/可视化) -->
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>visualization_msgs</exec_depend>

<!-- 测试依赖(保留默认即可) -->
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file.
4 changes: 4 additions & 0 deletions src/lane_path_detection/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script-dir=$base/lib/lane_path_detection
[install]
install-scripts=$base/lib/lane_path_detection
34 changes: 34 additions & 0 deletions src/lane_path_detection/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from setuptools import setup, find_packages
import os
from glob import glob

package_name = 'lane_path_detection'

setup(
name=package_name,
version='0.0.0',
# 自动查找所有子模块(适配你的目录结构)
packages=find_packages(exclude=['test']),
# 声明源码目录为当前目录
package_dir={'': '.'},
# 资源文件配置(保留你的原有逻辑)
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
(os.path.join('share', package_name, 'resource'), glob('resource/*')),
],
# ROS2节点入口点(关键:关联main.py的main函数)
entry_points={
'console_scripts': [
'lane_path_detection_node = lane_path_detection.main:main',
],
},
install_requires=['setuptools'],
zip_safe=True,
maintainer='rosli',
maintainer_email='rosli@todo.todo',
description='Lane path detection node for ROS2',
license='Apache-2.0',
tests_require=['pytest'],
)
23 changes: 23 additions & 0 deletions src/lane_path_detection/test/test_copyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest


@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found errors'
25 changes: 25 additions & 0 deletions src/lane_path_detection/test/test_flake8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main_with_errors
import pytest


@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
assert rc == 0, \
'Found %d code style errors / warnings:\n' % len(errors) + \
'\n'.join(errors)
23 changes: 23 additions & 0 deletions src/lane_path_detection/test/test_pep257.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest


@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found code style errors / warnings'
Loading