1. Activate ROS
source /opt/ros/jazzy/setup.bash
2. Check
printenv ROS_DISTRO
# jazzy
3. Create a package
ros2 pkg create dron_sim --build-type ament_cmake --dependencies rclpy std_msgs sensor_msgs
4. Workspace tree
simulation/src
└── drone_sim
├── CMakeLists.txt
├── config
├── drone_sim
│ └── __init__.py
├── include
│ └── drone_sim
├── launch
├── models
├── package.xml
├── src
└── worlds
5. Create a test node
nano /home/aleks/git/proj/claudedrone/simulation/src/drone_sim/drone_sim/hello.py
6. Build
cd /home/aleks/git/proj/claudedrone/simulation
# Build everything
colcon build
# Build with symlinks — no rebuild needed on Python-file changes
colcon build --symlink-install
# Build just one package
colcon build --packages-select drone_sim
After every build, always:
source install/setup.bash
Running the test node
ros2 run drone_sim hello
List nodes:
ros2 node list
Info on a specific node:
ros2 node info /hello_drone