Create new ROS 2 package with proper structure, build files, and test scaffolding. Use when creating a new ROS 2 package from scratch, setting up package.xml, CMakeLists.txt, setup.py, or need C++, Python, or mixed package structure following colcon conventions.
Generate a complete ROS 2 package with proper structure, build configuration, and test scaffolding following project conventions.
drqp_my_package)cpppythonmixedpackages/runtime)rclcpp,std_msgs,sensor_msgs)drqp_ prefix for this project; no hyphens or special characterspackages/runtime/ or provided path{workspaceFolder}/{packagePath}/{packageName}C++ packages:
<package_name>/
├── CMakeLists.txt
├── package.xml
├── README.md
├── include/<package_name>/
├── src/
├── test/
├── launch/
└── config/
Python packages:
<package_name>/
├── package.xml
├── setup.py
├── setup.cfg
├── README.md
├── resource/<package_name>
├── <package_name>/__init__.py
├── test/__init__.py
├── launch/
└── .coveragerc
Mixed: Combine both structures.
Include: project metadata, C++20, compiler warnings, include(../../cmake/ClangCoverage.cmake), dependency finding via ament_package_xml(), library/executable targets, installation, ament_lint_auto, drqp_lint_common. Reference: packages/runtime/drqp_control/CMakeLists.txt.
Package format 3, name, version 0.0.0, description, maintainer, license. Build tool: ament_cmake or ament_python. Runtime and test dependencies. Test deps: C++ — ament_lint_auto, drqp_lint_common, ament_cmake_gmock, ament_cmake_pytest; Python — ament_copyright, ament_flake8, ament_pep257, python3-pytest.
find_packages(exclude=['test']), data files, entry points, and for ament_python packages set tests_require=['pytest'] so colcon test runs Python tests. Reference: packages/runtime/drqp_brain/setup.py.
Create with install options and coverage configuration.
Basic sections: Overview, Dependencies, Building (colcon build --packages-up-to <pkg>), Testing (colcon test --packages-select <pkg>, colcon test-result --verbose), Usage.
C++: test/test_<package_name>.cpp with GTest, ament_add_gmock. Python: test/__init__.py, test/test_<package_name>.py with pytest.
launch/.gitkeep, config/.gitkeep (C++), resource/ marker (Python).
colcon build --packages-select <package_name> and colcon testcpp, python, mixedpackages/runtime/drqp_control/, packages/runtime/drqp_brain/