Python

cd /ros2_ws/src

ros2 pkg create {pkg_name} —build-type ament_python —dependencies rclpy

colcon build (—packages-select {pkg_name})

C++

cd /ros2_ws/src

ros2 pkg create {pkg_name} —build-type ament_cmake —dependencies rclcpp

colcon build (—packages-select {pkg_name})