packwise-skills 1.0.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.
- package/.cursorrules +23 -0
- package/CLAUDE.md +25 -0
- package/README.md +295 -0
- package/audit.md +224 -0
- package/bin/packwise.js +155 -0
- package/package.json +31 -0
- package/skill.md +719 -0
- package/sub-skills/ai/local-llm.md +183 -0
- package/sub-skills/ai/python-ml.md +164 -0
- package/sub-skills/backend/go-server.md +184 -0
- package/sub-skills/backend/java-spring.md +241 -0
- package/sub-skills/backend/node-server.md +164 -0
- package/sub-skills/backend/php-laravel.md +175 -0
- package/sub-skills/backend/python-server.md +164 -0
- package/sub-skills/backend/rust-backend.md +118 -0
- package/sub-skills/cli/python-cli.md +236 -0
- package/sub-skills/cli/sdk-library.md +497 -0
- package/sub-skills/cloud/ci-cd-pipelines.md +350 -0
- package/sub-skills/cloud/docker.md +191 -0
- package/sub-skills/cloud/kubernetes.md +277 -0
- package/sub-skills/cloud/payment-integration.md +307 -0
- package/sub-skills/cross-platform/multiplatform.md +252 -0
- package/sub-skills/desktop/electron.md +783 -0
- package/sub-skills/desktop/game-dev.md +443 -0
- package/sub-skills/desktop/native-app.md +123 -0
- package/sub-skills/desktop/scenarios.md +443 -0
- package/sub-skills/desktop/smart-platforms.md +324 -0
- package/sub-skills/desktop/tauri.md +428 -0
- package/sub-skills/desktop/vr-ar.md +252 -0
- package/sub-skills/desktop/web-to-desktop.md +153 -0
- package/sub-skills/embedded/car-infotainment.md +129 -0
- package/sub-skills/embedded/esp32.md +184 -0
- package/sub-skills/embedded/ros.md +150 -0
- package/sub-skills/embedded/stm32.md +160 -0
- package/sub-skills/mobile/android.md +322 -0
- package/sub-skills/mobile/capacitor.md +232 -0
- package/sub-skills/mobile/flutter-mobile.md +138 -0
- package/sub-skills/mobile/harmonyos.md +150 -0
- package/sub-skills/mobile/ios.md +245 -0
- package/sub-skills/mobile/react-native.md +443 -0
- package/sub-skills/mobile/wearables.md +230 -0
- package/sub-skills/plugins/browser-extension.md +308 -0
- package/sub-skills/plugins/jetbrains-plugin.md +226 -0
- package/sub-skills/plugins/vscode-extension.md +204 -0
- package/sub-skills/security/security-tools.md +174 -0
- package/sub-skills/web/monorepo.md +274 -0
- package/sub-skills/web/pwa.md +220 -0
- package/sub-skills/web/serverless-edge.md +295 -0
- package/sub-skills/web/spa.md +266 -0
- package/sub-skills/web/ssr.md +228 -0
- package/sub-skills/web/wasm.md +243 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Web-to-Desktop Build Sub-Skill
|
|
2
|
+
|
|
3
|
+
Quickly wrap existing web applications as desktop clients. For scenarios not requiring complex backends, pursuing minimal footprint.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Solution Comparison
|
|
8
|
+
|
|
9
|
+
| Framework | Language | Size | Engine | Platform | Best For |
|
|
10
|
+
|-----------|---------|------|--------|----------|---------|
|
|
11
|
+
| Pake/PakePlus | Rust (Tauri) | ~3-10MB | System WebView | Win/Mac/Linux/Android | Website → desktop minimal wrapper |
|
|
12
|
+
| Neutralinojs | JS + C++ | ~1-3MB | System WebView | Win/Mac/Linux | Lightweight Electron alternative |
|
|
13
|
+
| Capacitor | JS/TS | ~20MB | Chromium (Electron) | Win/Mac/Linux/iOS/Android | Web → all platforms |
|
|
14
|
+
| Carlo | JS | ~0MB | System Chrome | Win/Mac/Linux | Users with Chrome installed |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Pake / PakePlus (Recommended: Minimal Wrapper)
|
|
19
|
+
|
|
20
|
+
**Version**: PakePlus 2.7.x (2025-2026) — the actively maintained successor to the original Pake project.
|
|
21
|
+
|
|
22
|
+
### When to Use
|
|
23
|
+
- Any website wrapped as desktop app
|
|
24
|
+
- No backend logic needed
|
|
25
|
+
- Minimal size (~3MB)
|
|
26
|
+
- Custom window styling
|
|
27
|
+
|
|
28
|
+
### Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g pake-cli
|
|
32
|
+
|
|
33
|
+
# Basic
|
|
34
|
+
pake https://example.com --name MyApp
|
|
35
|
+
|
|
36
|
+
# Custom window
|
|
37
|
+
pake https://example.com \
|
|
38
|
+
--name MyApp \
|
|
39
|
+
--icon ./icon.png \
|
|
40
|
+
--width 1200 --height 800 \
|
|
41
|
+
--hide-title-bar \
|
|
42
|
+
--fullscreen false \
|
|
43
|
+
--resizable true
|
|
44
|
+
|
|
45
|
+
# Multi-platform
|
|
46
|
+
pake https://example.com --name MyApp --platform all
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Limitations
|
|
50
|
+
- No Node.js backend support
|
|
51
|
+
- No native module support
|
|
52
|
+
- Features limited to WebView capabilities
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Neutralinojs (5.6.x)
|
|
57
|
+
|
|
58
|
+
**Version**: Neutralinojs 5.6.x (2025-2026)
|
|
59
|
+
|
|
60
|
+
### When to Use
|
|
61
|
+
- Need lightweight backend (file system, network)
|
|
62
|
+
- Don't need full Node.js
|
|
63
|
+
- Minimal footprint (~2MB)
|
|
64
|
+
|
|
65
|
+
### Setup
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install -g @nicepkg/neutralino
|
|
69
|
+
neu create myapp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Frontend API
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
// File system
|
|
76
|
+
await Neutralino.filesystem.writeFile('data.txt', 'Hello');
|
|
77
|
+
const data = await Neutralino.filesystem.readFile('data.txt');
|
|
78
|
+
|
|
79
|
+
// Window control
|
|
80
|
+
await Neutralino.window.setTitle('New Title');
|
|
81
|
+
|
|
82
|
+
// System
|
|
83
|
+
await Neutralino.os.open('https://example.com');
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Build
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
neu run # Development
|
|
90
|
+
neu build # Production
|
|
91
|
+
# Output: dist/myapp-win_x64/, dist/myapp-mac_x64/, dist/myapp-linux_x64/
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Capacitor (Web → All Platforms)
|
|
97
|
+
|
|
98
|
+
### When to Use
|
|
99
|
+
- Existing web application
|
|
100
|
+
- Need desktop + mobile support simultaneously
|
|
101
|
+
- Need native API access (camera, filesystem, notifications)
|
|
102
|
+
|
|
103
|
+
### Setup
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm install @capacitor/core @capacitor/cli
|
|
107
|
+
npx cap init MyApp com.example.myapp
|
|
108
|
+
npm install @capacitor/electron
|
|
109
|
+
npx cap add electron
|
|
110
|
+
npx cap copy electron
|
|
111
|
+
npx cap open electron
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Native API Usage
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { Filesystem, Directory } from '@capacitor/filesystem';
|
|
118
|
+
import { LocalNotifications } from '@capacitor/local-notifications';
|
|
119
|
+
|
|
120
|
+
await Filesystem.writeFile({
|
|
121
|
+
path: 'data.txt',
|
|
122
|
+
data: 'Hello World',
|
|
123
|
+
directory: Directory.Documents,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
await LocalNotifications.schedule({
|
|
127
|
+
notifications: [{ title: 'Alert', body: 'New message', id: 1 }],
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Selection Guide
|
|
134
|
+
|
|
135
|
+
| Your Situation | Recommended |
|
|
136
|
+
|---------------|------------|
|
|
137
|
+
| Pure website wrap, minimal size | Pake |
|
|
138
|
+
| Need filesystem/network backend | Neutralinojs |
|
|
139
|
+
| Need desktop + mobile unified | Capacitor |
|
|
140
|
+
| Need full Node.js backend | Electron (see electron.md) |
|
|
141
|
+
| Need Rust backend + minimal size | Tauri (see tauri.md) |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Common Pitfalls
|
|
146
|
+
|
|
147
|
+
| Issue | Fix |
|
|
148
|
+
|-------|-----|
|
|
149
|
+
| WebView display differences | Use standard CSS, avoid experimental features |
|
|
150
|
+
| CORS cross-origin | Configure WebView to allow cross-origin or use proxy |
|
|
151
|
+
| WebView missing (Linux) | Install libwebkit2gtk-4.1-dev |
|
|
152
|
+
| Local storage lost | Use filesystem API instead of localStorage |
|
|
153
|
+
| Keyboard shortcut conflicts | Configure WebView to ignore system shortcuts |
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Car Infotainment Build Sub-Skill
|
|
2
|
+
|
|
3
|
+
Build applications for automotive infotainment systems: Android Automotive OS, QNX, AGL (Automotive Grade Linux), and HarmonyOS Car.
|
|
4
|
+
|
|
5
|
+
**Current versions**: Android Automotive 14 / QNX 8.0 / AGL UCB 16 (2025-2026)
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- In-vehicle infotainment (IVI) systems
|
|
10
|
+
- Digital instrument clusters
|
|
11
|
+
- Heads-up display (HUD) applications
|
|
12
|
+
- Rear-seat entertainment
|
|
13
|
+
- Telematics and fleet management
|
|
14
|
+
- EV charging station UI
|
|
15
|
+
|
|
16
|
+
## Platform Comparison
|
|
17
|
+
|
|
18
|
+
| Platform | Base OS | Language | Market Share | Best For |
|
|
19
|
+
|----------|---------|----------|-------------|---------|
|
|
20
|
+
| Android Automotive OS (AAOS) | Android 14 | Kotlin/Java | Growing fast | Mass-market vehicles (Volvo, GM, Ford, Honda) |
|
|
21
|
+
| QNX | QNX Neutrino RTOS | C/C++ | Largest (safety-critical) | Instrument clusters, safety systems |
|
|
22
|
+
| AGL | Linux | C/C++, HTML5/JS | Growing (open-source) | Custom IVI, fleet vehicles |
|
|
23
|
+
| HarmonyOS Car | HarmonyOS | ArkTS | China market | Huawei ecosystem vehicles |
|
|
24
|
+
| webOS Auto | Linux | JavaScript | Niche | LG-based IVI systems |
|
|
25
|
+
| Custom Linux (Yocto) | Linux | C/C++/Qt/QML | Many | Full control, custom hardware |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Android Automotive OS (AAOS)
|
|
30
|
+
|
|
31
|
+
### Key Differences from Android Mobile
|
|
32
|
+
|
|
33
|
+
| Feature | Android Mobile | Android Automotive |
|
|
34
|
+
|---------|---------------|-------------------|
|
|
35
|
+
| Display | Single screen | Multiple displays (IVI, cluster, HUD) |
|
|
36
|
+
| Input | Touch, voice | Touch, rotary controller, steering wheel, voice |
|
|
37
|
+
| Audio | Single zone | Multi-zone (driver, passenger, rear) |
|
|
38
|
+
| Lifecycle | Phone lifecycle | Vehicle lifecycle (10+ years) |
|
|
39
|
+
|
|
40
|
+
### Build
|
|
41
|
+
|
|
42
|
+
```kotlin
|
|
43
|
+
// build.gradle.kts
|
|
44
|
+
android {
|
|
45
|
+
defaultConfig {
|
|
46
|
+
minSdk = 28
|
|
47
|
+
targetSdk = 34
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation("androidx.car.app:app:1.7.0")
|
|
53
|
+
implementation("androidx.media3:media3-session:1.5.0")
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```xml
|
|
58
|
+
<manifest>
|
|
59
|
+
<uses-feature android:name="android.hardware.type.automotive" android:required="true" />
|
|
60
|
+
<application>
|
|
61
|
+
<service android:name=".MyCarService" android:exported="true">
|
|
62
|
+
<intent-filter>
|
|
63
|
+
<action android:name="android.car.app.CarAppService" />
|
|
64
|
+
</intent-filter>
|
|
65
|
+
</service>
|
|
66
|
+
</application>
|
|
67
|
+
</manifest>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
./gradlew assembleRelease
|
|
72
|
+
# Test with Android Automotive emulator in Android Studio
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## QNX (Safety-Critical)
|
|
78
|
+
|
|
79
|
+
- **Microkernel RTOS** — deterministic real-time behavior
|
|
80
|
+
- **Safety certified** — ISO 26262 ASIL-D, IEC 61508 SIL-3
|
|
81
|
+
- **Used by**: BlackBerry QNX, deployed in 200M+ vehicles
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Cross-compile from Linux/macOS host
|
|
85
|
+
qcc -Vgcc_ntoaarch64le -o myapp myapp.c -lGL -lEGL
|
|
86
|
+
|
|
87
|
+
# Build with CMake
|
|
88
|
+
cmake -DCMAKE_TOOLCHAIN_FILE=qnx-aarch64.cmake ..
|
|
89
|
+
make
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## AGL (Automotive Grade Linux)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# AGL uses Yocto/BitBake build system
|
|
98
|
+
repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
|
|
99
|
+
repo sync
|
|
100
|
+
|
|
101
|
+
source meta-agl/scripts/aglsetup.sh -m qemux86-64 -b build agl-demo agl-appfw-smack
|
|
102
|
+
bitbake agl-demo-platform
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Selection Guide
|
|
108
|
+
|
|
109
|
+
| Project Type | Recommended Platform |
|
|
110
|
+
|-------------|---------------------|
|
|
111
|
+
| Consumer car IVI | Android Automotive |
|
|
112
|
+
| Instrument cluster | QNX |
|
|
113
|
+
| Fleet management | AGL or custom Linux |
|
|
114
|
+
| Chinese market vehicle | HarmonyOS Car |
|
|
115
|
+
| Research/prototype | AGL or Raspberry Pi + custom |
|
|
116
|
+
| Motorcycle/scooter IVI | Custom Linux (Yocto/Buildroot) |
|
|
117
|
+
|
|
118
|
+
## Universal Car Software Packaging Checklist
|
|
119
|
+
|
|
120
|
+
1. **Driver distraction** — no interactive content while vehicle is moving
|
|
121
|
+
2. **Startup time** — must be < 2 seconds
|
|
122
|
+
3. **Temperature range** — test at -40°C to +85°C
|
|
123
|
+
4. **Long lifecycle** — support for 10+ years
|
|
124
|
+
5. **OTA updates** — must support over-the-air updates
|
|
125
|
+
6. **Multi-display** — support IVI + instrument cluster + HUD
|
|
126
|
+
7. **Audio zones** — separate audio for driver vs passenger
|
|
127
|
+
8. **Safety compliance** — ASIL rating if interacting with vehicle systems
|
|
128
|
+
9. **Power management** — handle ignition on/off, sleep/wake gracefully
|
|
129
|
+
10. **CAN bus integration** — vehicle data via CAN
|
|
@@ -0,0 +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) |
|
|
@@ -0,0 +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 |
|