0
$\begingroup$

Rosanswers logo

Hi,
I am trying to understand the folder struct that's created ros2 pkg create --build-type ament_python robot_pkg. Here is the folder structure

robot_pkg
        ├── package.xml
        ├── resource
        │   └── robot_pkg
        ├── setup.cfg
        ├── setup.py
        ├── test
        │   ├── __pycache__
        │   │   ├── test_copyright.cpython-38-PYTEST.pyc
        │   │   ├── test_flake8.cpython-38-PYTEST.pyc
        │   │   └── test_pep257.cpython-38-PYTEST.pyc
        │   ├── test_copyright.py
        │   ├── test_flake8.py
        │   └── test_pep257.py
        └── robot_pkg
            ├── __init__.py
            ├── mqtt_subscriber.py
            ├── __pycache__
            │   └── __init__.cpython-38.pyc
            └── robot.py

I am more interested in test, resource and __init__.py. Thanks.


Originally posted by Flash on ROS Answers with karma: 126 on 2022-05-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

resource/robot_pkg - In order to detect that a package is installed, ROS2 needs to install a marker file. Similar to installing the packages manifest in ROS 1.

You can read more about colcon File System Index Layout there:

https://github.com/ament/ament_cmake/blob/master/ament_cmake_core/doc/resource_index.md

test - I put there non-ROS-node specific unit tests, use them like there:

https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html#run-tests

Source about colcon:

https://colcon.readthedocs.io/en/released/index.html


Originally posted by ljaniec with karma: 3064 on 2022-05-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.