packwise-skills 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.cursorrules +23 -23
  2. package/CLAUDE.md +25 -25
  3. package/LICENSE +21 -0
  4. package/README.md +404 -295
  5. package/audit.md +224 -224
  6. package/bin/packwise.js +322 -155
  7. package/install.sh +123 -0
  8. package/package.json +32 -31
  9. package/skill.md +944 -719
  10. package/sub-skills/ai/local-llm.md +183 -183
  11. package/sub-skills/ai/python-ml.md +164 -164
  12. package/sub-skills/backend/go-server.md +184 -184
  13. package/sub-skills/backend/java-spring.md +241 -241
  14. package/sub-skills/backend/node-server.md +164 -164
  15. package/sub-skills/backend/php-laravel.md +175 -175
  16. package/sub-skills/backend/python-server.md +164 -164
  17. package/sub-skills/backend/rust-backend.md +118 -118
  18. package/sub-skills/cli/python-cli.md +236 -236
  19. package/sub-skills/cli/sdk-library.md +497 -497
  20. package/sub-skills/cloud/ci-cd-pipelines.md +350 -350
  21. package/sub-skills/cloud/docker.md +191 -191
  22. package/sub-skills/cloud/kubernetes.md +277 -277
  23. package/sub-skills/cloud/payment-integration.md +307 -307
  24. package/sub-skills/cross-platform/multiplatform.md +252 -252
  25. package/sub-skills/desktop/electron.md +783 -783
  26. package/sub-skills/desktop/game-dev.md +443 -443
  27. package/sub-skills/desktop/native-app.md +123 -123
  28. package/sub-skills/desktop/scenarios.md +443 -443
  29. package/sub-skills/desktop/smart-platforms.md +324 -324
  30. package/sub-skills/desktop/tauri.md +428 -428
  31. package/sub-skills/desktop/vr-ar.md +252 -252
  32. package/sub-skills/desktop/web-to-desktop.md +153 -153
  33. package/sub-skills/embedded/car-infotainment.md +129 -129
  34. package/sub-skills/embedded/esp32.md +184 -184
  35. package/sub-skills/embedded/ros.md +150 -150
  36. package/sub-skills/embedded/stm32.md +160 -160
  37. package/sub-skills/mobile/android.md +322 -322
  38. package/sub-skills/mobile/capacitor.md +232 -232
  39. package/sub-skills/mobile/flutter-mobile.md +138 -138
  40. package/sub-skills/mobile/harmonyos.md +150 -150
  41. package/sub-skills/mobile/ios.md +245 -245
  42. package/sub-skills/mobile/react-native.md +443 -443
  43. package/sub-skills/mobile/wearables.md +230 -230
  44. package/sub-skills/plugins/browser-extension.md +308 -308
  45. package/sub-skills/plugins/jetbrains-plugin.md +226 -226
  46. package/sub-skills/plugins/vscode-extension.md +204 -204
  47. package/sub-skills/security/security-tools.md +174 -174
  48. package/sub-skills/web/monorepo.md +274 -274
  49. package/sub-skills/web/pwa.md +220 -220
  50. package/sub-skills/web/serverless-edge.md +295 -295
  51. package/sub-skills/web/spa.md +266 -266
  52. package/sub-skills/web/ssr.md +228 -228
  53. package/sub-skills/web/wasm.md +243 -243
@@ -1,184 +1,184 @@
1
- # ESP32 Embedded Build Sub-Skill
2
-
3
- Build firmware for ESP32 series using ESP-IDF or Arduino framework.
4
-
5
- **Current versions**: ESP-IDF v5.3+ / Arduino-ESP32 3.x (2025-2026)
6
-
7
- ## When to Use
8
-
9
- - WiFi/Bluetooth IoT devices
10
- - Smart home sensors and controllers
11
- - Wearable devices
12
- - Industrial IoT gateways
13
- - Audio streaming devices (ESP32-S3)
14
- - Low-power battery devices (ESP32-C6, ESP32-H2)
15
-
16
- ## ESP32 Family Overview
17
-
18
- | Chip | Core | WiFi | BT | Flash | Best For |
19
- |------|------|------|-----|-------|----------|
20
- | ESP32 | Xtensa dual-core 240MHz | WiFi 4 | BT 4.2 + BLE | 4-16MB | General IoT, most mature |
21
- | ESP32-S2 | Xtensa single-core 240MHz | WiFi 4 | No BT | 4-16MB | Low-cost WiFi, USB OTG |
22
- | ESP32-S3 | Xtensa dual-core 240MHz | WiFi 4 | BLE 5.0 | 8-16MB | AI acceleration, USB, camera |
23
- | ESP32-C3 | RISC-V single-core 160MHz | WiFi 4 | BLE 5.0 | 4MB | Low-cost, pin-compatible with ESP8266 |
24
- | ESP32-C6 | RISC-V single-core 160MHz | WiFi 6 | BLE 5.0 + 802.15.4 | 4MB | Thread/Zigbee/Matter, WiFi 6 |
25
- | ESP32-H2 | RISC-V single-core 96MHz | No WiFi | BLE 5.0 + 802.15.4 | 4MB | Thread/Zigbee/Matter, ultra-low power |
26
-
27
- ## ESP-IDF Build (Recommended for Production)
28
-
29
- ### Prerequisites
30
-
31
- ```bash
32
- # Install ESP-IDF
33
- # Linux/macOS:
34
- mkdir -p ~/esp && cd ~/esp
35
- git clone --recursive https://github.com/espressif/esp-idf.git
36
- cd esp-idf && ./install.sh esp32 # or esp32s3, esp32c3, esp32c6, etc.
37
- source export.sh
38
-
39
- # Windows:
40
- # Download ESP-IDF Tools Installer from docs.espressif.com
41
-
42
- # Verify
43
- idf.py --version
44
- ```
45
-
46
- ### Build
47
-
48
- ```bash
49
- # Set target chip
50
- idf.py set-target esp32 # or esp32s3, esp32c3, esp32c6, etc.
51
-
52
- # Configure (menuconfig)
53
- idf.py menuconfig
54
-
55
- # Build
56
- idf.py build
57
- # Output: build/myproject.bin, build/myproject.elf
58
-
59
- # Flash (USB connected)
60
- idf.py -p /dev/ttyUSB0 flash # Linux
61
- idf.py -p COM3 flash # Windows
62
-
63
- # Monitor serial output
64
- idf.py -p /dev/ttyUSB0 monitor
65
-
66
- # Flash + monitor in one step
67
- idf.py -p /dev/ttyUSB0 flash monitor
68
- ```
69
-
70
- ### Project Structure
71
-
72
- ```
73
- myproject/
74
- ├── CMakeLists.txt ← Top-level CMake
75
- ├── main/
76
- │ ├── CMakeLists.txt ← Main component CMake
77
- │ ├── main.c ← Entry point (app_main)
78
- │ └── wifi.c ← WiFi management
79
- ├── components/ ← Custom components
80
- │ └── mylib/
81
- │ ├── CMakeLists.txt
82
- │ ├── mylib.c
83
- │ └── include/mylib.h
84
- ├── sdkconfig ← Build configuration
85
- ├── partitions.csv ← Flash partition table
86
- └── managed_components/ ← ESP-IDF component registry deps
87
- ```
88
-
89
- ### Flash Partition Table
90
-
91
- ```csv
92
- # partitions.csv — custom partition layout
93
- # Name, Type, SubType, Offset, Size, Flags
94
- nvs, data, nvs, 0x9000, 0x6000,
95
- phy_init, data, phy, 0xf000, 0x1000,
96
- factory, app, factory, 0x10000, 0x1F0000,
97
- storage, data, spiffs, 0x200000,0x200000,
98
- ```
99
-
100
- ## Arduino-ESP32 Build (Simpler, Faster Prototyping)
101
-
102
- ### PlatformIO Configuration
103
-
104
- ```ini
105
- ; platformio.ini
106
- [env:esp32dev]
107
- platform = espressif32
108
- board = esp32dev
109
- framework = arduino ; or: espidf
110
- monitor_speed = 115200
111
- upload_speed = 921600
112
- board_build.partitions = huge_app.csv
113
- build_flags =
114
- -DARDUINO_USB_CDC_ON_BOOT=1
115
- lib_deps =
116
- bblanchon/ArduinoJson@^7.0.0
117
- knolleary/PubSubClient@^2.8
118
- ```
119
-
120
- ```bash
121
- pio run # Build
122
- pio run -t upload # Flash
123
- pio device monitor # Serial monitor
124
- ```
125
-
126
- ### Arduino Code Example
127
-
128
- ```cpp
129
- #include <WiFi.h>
130
- #include <PubSubClient.h>
131
-
132
- const char* ssid = "MyWiFi";
133
- const char* password = "MyPassword";
134
- const char* mqtt_server = "192.168.1.100";
135
-
136
- WiFiClient espClient;
137
- PubSubClient client(espClient);
138
-
139
- void setup() {
140
- Serial.begin(115200);
141
- WiFi.begin(ssid, password);
142
- while (WiFi.status() != WL_CONNECTED) { delay(500); }
143
- client.setServer(mqtt_server, 1883);
144
- }
145
-
146
- void loop() {
147
- if (!client.connected()) {
148
- client.connect("esp32-client");
149
- }
150
- client.publish("sensor/temperature", "23.5");
151
- delay(5000);
152
- }
153
- ```
154
-
155
- ## Over-the-Air (OTA) Updates
156
-
157
- ```cpp
158
- // Arduino OTA
159
- #include <ArduinoOTA.h>
160
-
161
- void setup() {
162
- ArduinoOTA.setHostname("my-esp32");
163
- ArduinoOTA.setPassword("admin");
164
- ArduinoOTA.begin();
165
- }
166
-
167
- void loop() {
168
- ArduinoOTA.handle();
169
- }
170
- ```
171
-
172
- ## Common Pitfalls
173
-
174
- | Issue | Fix |
175
- |-------|-----|
176
- | WiFi disconnects frequently | Use WiFi event handlers; implement reconnection logic |
177
- | Flash size mismatch | Set correct flash size in menuconfig; check actual chip |
178
- | PSRAM not detected | Enable PSRAM in menuconfig; check board has PSRAM chip |
179
- | BLE connection fails | Check BLE MTU size; ensure correct service/characteristic UUIDs |
180
- | Deep sleep current too high | Disable WiFi/BT before sleep; use RTC GPIO for wake |
181
- | Partition table error | Verify partition sizes fit flash; use `idf.py partition-table` to check |
182
- | Build: "sdkconfig mismatch" | Run `idf.py fullclean` then `idf.py build` |
183
- | Upload fails on Windows | Install CP2102/CH340 USB driver; check COM port |
184
- | Stack overflow crash | Increase task stack size (default 4KB may be too small) |
1
+ # ESP32 Embedded Build Sub-Skill
2
+
3
+ Build firmware for ESP32 series using ESP-IDF or Arduino framework.
4
+
5
+ **Current versions**: ESP-IDF v5.3+ / Arduino-ESP32 3.x (2025-2026)
6
+
7
+ ## When to Use
8
+
9
+ - WiFi/Bluetooth IoT devices
10
+ - Smart home sensors and controllers
11
+ - Wearable devices
12
+ - Industrial IoT gateways
13
+ - Audio streaming devices (ESP32-S3)
14
+ - Low-power battery devices (ESP32-C6, ESP32-H2)
15
+
16
+ ## ESP32 Family Overview
17
+
18
+ | Chip | Core | WiFi | BT | Flash | Best For |
19
+ |------|------|------|-----|-------|----------|
20
+ | ESP32 | Xtensa dual-core 240MHz | WiFi 4 | BT 4.2 + BLE | 4-16MB | General IoT, most mature |
21
+ | ESP32-S2 | Xtensa single-core 240MHz | WiFi 4 | No BT | 4-16MB | Low-cost WiFi, USB OTG |
22
+ | ESP32-S3 | Xtensa dual-core 240MHz | WiFi 4 | BLE 5.0 | 8-16MB | AI acceleration, USB, camera |
23
+ | ESP32-C3 | RISC-V single-core 160MHz | WiFi 4 | BLE 5.0 | 4MB | Low-cost, pin-compatible with ESP8266 |
24
+ | ESP32-C6 | RISC-V single-core 160MHz | WiFi 6 | BLE 5.0 + 802.15.4 | 4MB | Thread/Zigbee/Matter, WiFi 6 |
25
+ | ESP32-H2 | RISC-V single-core 96MHz | No WiFi | BLE 5.0 + 802.15.4 | 4MB | Thread/Zigbee/Matter, ultra-low power |
26
+
27
+ ## ESP-IDF Build (Recommended for Production)
28
+
29
+ ### Prerequisites
30
+
31
+ ```bash
32
+ # Install ESP-IDF
33
+ # Linux/macOS:
34
+ mkdir -p ~/esp && cd ~/esp
35
+ git clone --recursive https://github.com/espressif/esp-idf.git
36
+ cd esp-idf && ./install.sh esp32 # or esp32s3, esp32c3, esp32c6, etc.
37
+ source export.sh
38
+
39
+ # Windows:
40
+ # Download ESP-IDF Tools Installer from docs.espressif.com
41
+
42
+ # Verify
43
+ idf.py --version
44
+ ```
45
+
46
+ ### Build
47
+
48
+ ```bash
49
+ # Set target chip
50
+ idf.py set-target esp32 # or esp32s3, esp32c3, esp32c6, etc.
51
+
52
+ # Configure (menuconfig)
53
+ idf.py menuconfig
54
+
55
+ # Build
56
+ idf.py build
57
+ # Output: build/myproject.bin, build/myproject.elf
58
+
59
+ # Flash (USB connected)
60
+ idf.py -p /dev/ttyUSB0 flash # Linux
61
+ idf.py -p COM3 flash # Windows
62
+
63
+ # Monitor serial output
64
+ idf.py -p /dev/ttyUSB0 monitor
65
+
66
+ # Flash + monitor in one step
67
+ idf.py -p /dev/ttyUSB0 flash monitor
68
+ ```
69
+
70
+ ### Project Structure
71
+
72
+ ```
73
+ myproject/
74
+ ├── CMakeLists.txt ← Top-level CMake
75
+ ├── main/
76
+ │ ├── CMakeLists.txt ← Main component CMake
77
+ │ ├── main.c ← Entry point (app_main)
78
+ │ └── wifi.c ← WiFi management
79
+ ├── components/ ← Custom components
80
+ │ └── mylib/
81
+ │ ├── CMakeLists.txt
82
+ │ ├── mylib.c
83
+ │ └── include/mylib.h
84
+ ├── sdkconfig ← Build configuration
85
+ ├── partitions.csv ← Flash partition table
86
+ └── managed_components/ ← ESP-IDF component registry deps
87
+ ```
88
+
89
+ ### Flash Partition Table
90
+
91
+ ```csv
92
+ # partitions.csv — custom partition layout
93
+ # Name, Type, SubType, Offset, Size, Flags
94
+ nvs, data, nvs, 0x9000, 0x6000,
95
+ phy_init, data, phy, 0xf000, 0x1000,
96
+ factory, app, factory, 0x10000, 0x1F0000,
97
+ storage, data, spiffs, 0x200000,0x200000,
98
+ ```
99
+
100
+ ## Arduino-ESP32 Build (Simpler, Faster Prototyping)
101
+
102
+ ### PlatformIO Configuration
103
+
104
+ ```ini
105
+ ; platformio.ini
106
+ [env:esp32dev]
107
+ platform = espressif32
108
+ board = esp32dev
109
+ framework = arduino ; or: espidf
110
+ monitor_speed = 115200
111
+ upload_speed = 921600
112
+ board_build.partitions = huge_app.csv
113
+ build_flags =
114
+ -DARDUINO_USB_CDC_ON_BOOT=1
115
+ lib_deps =
116
+ bblanchon/ArduinoJson@^7.0.0
117
+ knolleary/PubSubClient@^2.8
118
+ ```
119
+
120
+ ```bash
121
+ pio run # Build
122
+ pio run -t upload # Flash
123
+ pio device monitor # Serial monitor
124
+ ```
125
+
126
+ ### Arduino Code Example
127
+
128
+ ```cpp
129
+ #include <WiFi.h>
130
+ #include <PubSubClient.h>
131
+
132
+ const char* ssid = "MyWiFi";
133
+ const char* password = "MyPassword";
134
+ const char* mqtt_server = "192.168.1.100";
135
+
136
+ WiFiClient espClient;
137
+ PubSubClient client(espClient);
138
+
139
+ void setup() {
140
+ Serial.begin(115200);
141
+ WiFi.begin(ssid, password);
142
+ while (WiFi.status() != WL_CONNECTED) { delay(500); }
143
+ client.setServer(mqtt_server, 1883);
144
+ }
145
+
146
+ void loop() {
147
+ if (!client.connected()) {
148
+ client.connect("esp32-client");
149
+ }
150
+ client.publish("sensor/temperature", "23.5");
151
+ delay(5000);
152
+ }
153
+ ```
154
+
155
+ ## Over-the-Air (OTA) Updates
156
+
157
+ ```cpp
158
+ // Arduino OTA
159
+ #include <ArduinoOTA.h>
160
+
161
+ void setup() {
162
+ ArduinoOTA.setHostname("my-esp32");
163
+ ArduinoOTA.setPassword("admin");
164
+ ArduinoOTA.begin();
165
+ }
166
+
167
+ void loop() {
168
+ ArduinoOTA.handle();
169
+ }
170
+ ```
171
+
172
+ ## Common Pitfalls
173
+
174
+ | Issue | Fix |
175
+ |-------|-----|
176
+ | WiFi disconnects frequently | Use WiFi event handlers; implement reconnection logic |
177
+ | Flash size mismatch | Set correct flash size in menuconfig; check actual chip |
178
+ | PSRAM not detected | Enable PSRAM in menuconfig; check board has PSRAM chip |
179
+ | BLE connection fails | Check BLE MTU size; ensure correct service/characteristic UUIDs |
180
+ | Deep sleep current too high | Disable WiFi/BT before sleep; use RTC GPIO for wake |
181
+ | Partition table error | Verify partition sizes fit flash; use `idf.py partition-table` to check |
182
+ | Build: "sdkconfig mismatch" | Run `idf.py fullclean` then `idf.py build` |
183
+ | Upload fails on Windows | Install CP2102/CH340 USB driver; check COM port |
184
+ | Stack overflow crash | Increase task stack size (default 4KB may be too small) |
@@ -1,150 +1,150 @@
1
- # ROS/ROS2 Robotics Build Sub-Skill
2
-
3
- Build and package robotic applications using ROS (Robot Operating System).
4
-
5
- **Current versions**: ROS 2 Jazzy Jalisco (LTS, 2024-2029) / ROS 1 Noetic (EOL 2025) (2025-2026)
6
-
7
- ## When to Use
8
-
9
- - Robot navigation and SLAM
10
- - Manipulator/arm control
11
- - Multi-robot coordination
12
- - Sensor fusion (LiDAR, camera, IMU)
13
- - Autonomous vehicles (research)
14
- - Industrial automation
15
-
16
- ## ROS 1 vs ROS 2
17
-
18
- | Feature | ROS 1 Noetic | ROS 2 Jazzy |
19
- |---------|-------------|-------------|
20
- | Status | EOL May 2025 | Active LTS (2024-2029) |
21
- | Middleware | Custom TCP/UDP | DDS (Data Distribution Service) |
22
- | Real-time | No | Yes (with RT kernel) |
23
- | Security | None built-in | SROS2 (DDS-Security) |
24
- | Multi-robot | Difficult | First-class support |
25
- | Language | C++ / Python 2.7+3 | C++ / Python 3.10+ |
26
- | OS | Ubuntu 20.04 | Ubuntu 24.04 |
27
- | **Recommendation** | Legacy only | **Use ROS 2 for all new projects** |
28
-
29
- ## ROS 2 Build
30
-
31
- ### Prerequisites
32
-
33
- ```bash
34
- # Ubuntu 24.04 (recommended)
35
- sudo apt update && sudo apt install software-properties-common
36
- sudo add-apt-repository universe
37
- sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
38
- -o /usr/share/keyrings/ros-archive-keyring.gpg
39
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
40
- http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | \
41
- sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
42
- sudo apt update
43
- sudo apt install ros-jazzy-desktop
44
- source /opt/ros/jazzy/setup.bash
45
- ```
46
-
47
- ### Build with colcon
48
-
49
- ```bash
50
- # Create workspace
51
- mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
52
- ros2 pkg create --build-type ament_cmake my_robot
53
-
54
- # Build
55
- cd ~/ros2_ws
56
- colcon build --packages-select my_robot
57
- # Output: install/my_robot/
58
-
59
- # Source the workspace
60
- source install/setup.bash
61
-
62
- # Build with symlink (faster iteration)
63
- colcon build --symlink-install
64
-
65
- # Test
66
- colcon test --packages-select my_robot
67
- ```
68
-
69
- ### Package Structure
70
-
71
- ```
72
- my_robot/
73
- ├── CMakeLists.txt ← Build configuration
74
- ├── package.xml ← Package metadata
75
- ├── include/my_robot/ ← Header files
76
- ├── src/ ← C++ source files
77
- │ └── my_node.cpp
78
- ├── launch/ ← Launch files
79
- │ └── bringup.launch.py
80
- ├── config/ ← Parameter files
81
- │ └── params.yaml
82
- ├── urdf/ ← Robot description
83
- │ └── my_robot.urdf
84
- ├── meshes/ ← 3D models
85
- ├── worlds/ ← Gazebo worlds
86
- └── msg/ ← Custom message types
87
- └── MyMessage.msg
88
- ```
89
-
90
- ### Launch File (Python)
91
-
92
- ```python
93
- # launch/bringup.launch.py
94
- from launch import LaunchDescription
95
- from launch_ros.actions import Node
96
-
97
- def generate_launch_description():
98
- return LaunchDescription([
99
- Node(
100
- package='my_robot',
101
- executable='my_node',
102
- name='my_node',
103
- parameters=[{'param1': 'value1'}],
104
- output='screen'
105
- ),
106
- ])
107
- ```
108
-
109
- ```bash
110
- ros2 launch my_robot bringup.launch.py
111
- ```
112
-
113
- ## Docker Build
114
-
115
- ```dockerfile
116
- FROM ros:jazzy-ros-base
117
- WORKDIR /ros2_ws
118
- RUN apt-get update && apt-get install -y \
119
- ros-jazzy-navigation2 \
120
- ros-jazzy-slam-toolbox \
121
- && rm -rf /var/lib/apt/lists/*
122
- COPY . src/my_robot/
123
- RUN . /opt/ros/jazzy/setup.sh && colcon build --packages-select my_robot
124
- RUN echo "source /ros2_ws/install/setup.bash" >> ~/.bashrc
125
- CMD ["ros2", "launch", "my_robot", "bringup.launch.py"]
126
- ```
127
-
128
- ## Simulation (Gazebo)
129
-
130
- ```bash
131
- # Install Gazebo (Harmonic, recommended for ROS 2 Jazzy)
132
- sudo apt install ros-jazzy-gz-sim
133
-
134
- # Launch Gazebo with robot
135
- ros2 launch my_robot gazebo.launch.py
136
- ```
137
-
138
- ## Common Pitfalls
139
-
140
- | Issue | Fix |
141
- |-------|-----|
142
- | `ros2: command not found` | Source ROS: `source /opt/ros/jazzy/setup.bash` |
143
- | Package not found after build | Source workspace: `source install/setup.bash` |
144
- | DDS discovery issues | Set `ROS_DOMAIN_ID` for network isolation; check firewall |
145
- | Gazebo crash | Check GPU driver; use `LIBGL_ALWAYS_SOFTWARE=1` for headless |
146
- | URDF parsing error | Validate with `check_urdf`; check XML syntax |
147
- | Real-time not working | Use RT kernel (`PREEMPT_RT`); set thread priority with `SCHED_FIFO` |
148
- | Jetson build slow | Cross-compile on x86; use Docker multi-stage build |
149
- | Navigation stack fails | Check map server; verify TF tree with `ros2 run tf2_tools view_frames` |
150
- | Node communication fails | Same `ROS_DOMAIN_ID` on all nodes; check QoS settings |
1
+ # ROS/ROS2 Robotics Build Sub-Skill
2
+
3
+ Build and package robotic applications using ROS (Robot Operating System).
4
+
5
+ **Current versions**: ROS 2 Jazzy Jalisco (LTS, 2024-2029) / ROS 1 Noetic (EOL 2025) (2025-2026)
6
+
7
+ ## When to Use
8
+
9
+ - Robot navigation and SLAM
10
+ - Manipulator/arm control
11
+ - Multi-robot coordination
12
+ - Sensor fusion (LiDAR, camera, IMU)
13
+ - Autonomous vehicles (research)
14
+ - Industrial automation
15
+
16
+ ## ROS 1 vs ROS 2
17
+
18
+ | Feature | ROS 1 Noetic | ROS 2 Jazzy |
19
+ |---------|-------------|-------------|
20
+ | Status | EOL May 2025 | Active LTS (2024-2029) |
21
+ | Middleware | Custom TCP/UDP | DDS (Data Distribution Service) |
22
+ | Real-time | No | Yes (with RT kernel) |
23
+ | Security | None built-in | SROS2 (DDS-Security) |
24
+ | Multi-robot | Difficult | First-class support |
25
+ | Language | C++ / Python 2.7+3 | C++ / Python 3.10+ |
26
+ | OS | Ubuntu 20.04 | Ubuntu 24.04 |
27
+ | **Recommendation** | Legacy only | **Use ROS 2 for all new projects** |
28
+
29
+ ## ROS 2 Build
30
+
31
+ ### Prerequisites
32
+
33
+ ```bash
34
+ # Ubuntu 24.04 (recommended)
35
+ sudo apt update && sudo apt install software-properties-common
36
+ sudo add-apt-repository universe
37
+ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
38
+ -o /usr/share/keyrings/ros-archive-keyring.gpg
39
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
40
+ http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | \
41
+ sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
42
+ sudo apt update
43
+ sudo apt install ros-jazzy-desktop
44
+ source /opt/ros/jazzy/setup.bash
45
+ ```
46
+
47
+ ### Build with colcon
48
+
49
+ ```bash
50
+ # Create workspace
51
+ mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
52
+ ros2 pkg create --build-type ament_cmake my_robot
53
+
54
+ # Build
55
+ cd ~/ros2_ws
56
+ colcon build --packages-select my_robot
57
+ # Output: install/my_robot/
58
+
59
+ # Source the workspace
60
+ source install/setup.bash
61
+
62
+ # Build with symlink (faster iteration)
63
+ colcon build --symlink-install
64
+
65
+ # Test
66
+ colcon test --packages-select my_robot
67
+ ```
68
+
69
+ ### Package Structure
70
+
71
+ ```
72
+ my_robot/
73
+ ├── CMakeLists.txt ← Build configuration
74
+ ├── package.xml ← Package metadata
75
+ ├── include/my_robot/ ← Header files
76
+ ├── src/ ← C++ source files
77
+ │ └── my_node.cpp
78
+ ├── launch/ ← Launch files
79
+ │ └── bringup.launch.py
80
+ ├── config/ ← Parameter files
81
+ │ └── params.yaml
82
+ ├── urdf/ ← Robot description
83
+ │ └── my_robot.urdf
84
+ ├── meshes/ ← 3D models
85
+ ├── worlds/ ← Gazebo worlds
86
+ └── msg/ ← Custom message types
87
+ └── MyMessage.msg
88
+ ```
89
+
90
+ ### Launch File (Python)
91
+
92
+ ```python
93
+ # launch/bringup.launch.py
94
+ from launch import LaunchDescription
95
+ from launch_ros.actions import Node
96
+
97
+ def generate_launch_description():
98
+ return LaunchDescription([
99
+ Node(
100
+ package='my_robot',
101
+ executable='my_node',
102
+ name='my_node',
103
+ parameters=[{'param1': 'value1'}],
104
+ output='screen'
105
+ ),
106
+ ])
107
+ ```
108
+
109
+ ```bash
110
+ ros2 launch my_robot bringup.launch.py
111
+ ```
112
+
113
+ ## Docker Build
114
+
115
+ ```dockerfile
116
+ FROM ros:jazzy-ros-base
117
+ WORKDIR /ros2_ws
118
+ RUN apt-get update && apt-get install -y \
119
+ ros-jazzy-navigation2 \
120
+ ros-jazzy-slam-toolbox \
121
+ && rm -rf /var/lib/apt/lists/*
122
+ COPY . src/my_robot/
123
+ RUN . /opt/ros/jazzy/setup.sh && colcon build --packages-select my_robot
124
+ RUN echo "source /ros2_ws/install/setup.bash" >> ~/.bashrc
125
+ CMD ["ros2", "launch", "my_robot", "bringup.launch.py"]
126
+ ```
127
+
128
+ ## Simulation (Gazebo)
129
+
130
+ ```bash
131
+ # Install Gazebo (Harmonic, recommended for ROS 2 Jazzy)
132
+ sudo apt install ros-jazzy-gz-sim
133
+
134
+ # Launch Gazebo with robot
135
+ ros2 launch my_robot gazebo.launch.py
136
+ ```
137
+
138
+ ## Common Pitfalls
139
+
140
+ | Issue | Fix |
141
+ |-------|-----|
142
+ | `ros2: command not found` | Source ROS: `source /opt/ros/jazzy/setup.bash` |
143
+ | Package not found after build | Source workspace: `source install/setup.bash` |
144
+ | DDS discovery issues | Set `ROS_DOMAIN_ID` for network isolation; check firewall |
145
+ | Gazebo crash | Check GPU driver; use `LIBGL_ALWAYS_SOFTWARE=1` for headless |
146
+ | URDF parsing error | Validate with `check_urdf`; check XML syntax |
147
+ | Real-time not working | Use RT kernel (`PREEMPT_RT`); set thread priority with `SCHED_FIFO` |
148
+ | Jetson build slow | Cross-compile on x86; use Docker multi-stage build |
149
+ | Navigation stack fails | Check map server; verify TF tree with `ros2 run tf2_tools view_frames` |
150
+ | Node communication fails | Same `ROS_DOMAIN_ID` on all nodes; check QoS settings |