ZERO Notificatons

NO Feedback yet!!

okay

xparo
X.P.A.R.O



ROS 2 Package Generator

Fill in a name, pick ament_python or ament_cmake, list your nodes, and download a ready-to-build ROS 2 package as a zip.

Package

Files

    Preview

    
      

    How to use the ROS 2 package generator

    1. Name the package. ROS 2 package names use lowercase letters, digits and underscores and start with a letter, such as my_robot_driver. The generator cleans up anything else you type.
    2. Choose the build type. ament_python for nodes written in Python with rclpy, ament_cmake for C++ nodes with rclcpp.
    3. List dependencies and nodes. Add the message packages you will use (for example std_msgs sensor_msgs geometry_msgs) and one name per node. Every node gets a source file, a build entry and a line in the launch file.
    4. Preview, then download. Click any file to inspect it, then download the zip, unpack it into the src folder of your workspace and build.
    cd ~/ros2_ws/src
    unzip ~/Downloads/my_robot_pkg.zip
    cd ~/ros2_ws
    colcon build --packages-select my_robot_pkg
    source install/setup.bash
    ros2 launch my_robot_pkg my_robot_pkg_launch.py

    What the generator writes

    FileBuild typePurpose
    package.xmlbothPackage name, version, maintainer, licence, dependencies and the build type, in package format 3.
    setup.py, setup.cfgament_pythonInstalls the Python module, the launch file and a console_scripts entry point per node, so ros2 run can find it.
    resource/<package>ament_pythonAn empty marker file that registers the package in the ament index.
    CMakeLists.txtament_cmakeFinds dependencies, builds one executable per node and installs the executables and launch folder.
    src/*.cpp or <package>/*.pybothA minimal node class with a one-second timer, ready for your code.
    launch/<package>_launch.pybothA Python launch file that starts every node with screen output.

    We test the output by building both package types with colcon build on ROS 2 Jazzy and starting their launch files. The same layout works on Humble and Rolling.

    After generating: next steps

    Frequently asked questions

    Should I choose ament_python or ament_cmake?

    Use ament_python for pure Python nodes and ament_cmake for C++ nodes, custom messages, or packages that mix languages. The guide below explains the trade-offs.

    Where do I put the generated package?

    Unzip it into the src folder of a colcon workspace (for example ~/ros2_ws/src), then run colcon build and source install/setup.bash.

    Why does colcon not find my new node?

    For Python packages the node must be listed under console_scripts in setup.py, and you must re-source install/setup.bash after building. The generator writes the entry points for you.

    Can I add dependencies later?

    Yes. Add a <depend> line to package.xml, and for C++ also add find_package and ament_target_dependencies in CMakeLists.txt.

    Guides for this tool

    In-depth articles that explain the ideas behind the ROS 2 Package Generator, with worked examples.

    ROS 2 Package Generator has its own project page with the story behind the tool, a gallery and every guide in one place.

    Visit the project page →

    More free tools

    Every tool runs in your browser. Nothing you enter is uploaded.