Skip to content
Merged

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Local scripts
liner.py
TODO.md
tests/control_tests
.build/
review/
Expand Down
17 changes: 0 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
set(PROBOT_SRCS
src/core/runtime.cpp
src/core/scheduler.cpp
src/core/wdt.cpp
src/io/ui_input.cpp
src/platform/esp32s3/drivers/builtin_led_ws2812.cpp
src/probot/devices/motors/Boardoza_BA6208.cpp
src/probot/devices/motors/boardoza_ba6208_driver.cpp
src/probot/devices/motors/boardoza_vnh_motor_driver.cpp
src/probot/logging/logger.cpp
src/probot/logging/telemetry_profiles.cpp
src/probot/logging/wifi_transport_esp32.cpp
src/probot/robot/system.cpp
src/probot/sensors/imu/mpu6050.cpp
)

idf_component_register(
SRCS ${PROBOT_SRCS}
INCLUDE_DIRS "src"
REQUIRES arduino
)
Expand Down
4 changes: 2 additions & 2 deletions FUTURE_WORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Boardoza motor kontrolcüsü desteğini entegre et (donanım ekibinden gelecek PWM/CAN detayları bekleniyor).
- ESP32-S3 için donanımsal quadrature encoder sürücüsü ekle (temel örnek: PCNT + 1024 CPR tekerlek).
- IMotorController arayüzünü PIDF + feedforward slotları ve isteğe bağlı motion profile zamanlaması (trapez/S-eğrisi) ile genişlet.
- NFR örneklerinde kullanılan NullMotorController yer tutucularını gerçek IMotorController uygulamalarıyla değiştir.
- NFR örneklerinde kullanılan NullIMotorController yer tutucularını gerçek IMotorController uygulamalarıyla değiştir.
- Her aktarma için motor motion profile ve feedforward ön ayarlarını yapılandıracak şasi seviyesinde yardımcı fonksiyonlar sun.
- MPU6050 entegrasyonunu sağlamlaştır (kalibrasyon akışı, hata yönetimi) ve ilerideki MPU9050/BNO varyantlarına hazırlık yap.
- Robotlar hazır olduğunda joystick hattını donanım üzerinde 10 ms örnekleme + 20 ms kontrol döngüsü ile doğrula.
Expand All @@ -24,7 +24,7 @@
- Integrate Boardoza motor controller support (PWM/CAN specifics pending from hardware team).
- Add hardware quadrature encoder driver implementation for ESP32-S3 (baseline example: PCNT + 1024 CPR wheel).
- Extend IMotorController to PIDF + feedforward slots and optional motion profile scheduling (trapezoid/S-curve).
- Swap placeholder NullMotorController usages with real IMotorController implementations in NFR examples.
- Swap placeholder NullIMotorController usages with real IMotorController implementations in NFR examples.
- Expose chassis-level helpers to configure motor motion profiles and feedforward presets per drivetrain.
- Harden MPU6050 integration (calibration flow, failure handling) and prepare for future MPU9050/BNO variants.
- Validate joystick pipeline at 10 ms sampling + 20 ms control loop on hardware once robots are available.
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ VERSION_SYNC_SCRIPT := $(CURDIR)/tools/sync_version.py

# Examples
EXAMPLES_DIR := $(CURDIR)/examples
EXAMPLES_LIST := $(filter-out __library_impl,$(notdir $(wildcard $(EXAMPLES_DIR)/*)))
EXAMPLE_SKETCHES := $(shell find $(EXAMPLES_DIR) -maxdepth 3 -mindepth 1 -name "*.ino")
EXAMPLES_LIST := $(sort $(patsubst %/,%,$(patsubst $(EXAMPLES_DIR)/%,%,$(dir $(EXAMPLE_SKETCHES)))))
EXAMPLES_LIST := $(filter-out __library_impl __library_impl/%,$(EXAMPLES_LIST))
DEFAULT_EXAMPLE := $(firstword $(EXAMPLES_LIST))
EXAMPLE ?= $(DEFAULT_EXAMPLE)
BUILD_DIR_BASE := $(CURDIR)/.build

TEST_STUB_DIR := $(CURDIR)/tests/stubs
TEST_SOURCES := $(filter %.cpp,$(wildcard $(CURDIR)/tests/*.cpp))
TEST_EXTRA_SOURCES := \
$(CURDIR)/src/probot/logging/logger.cpp \
$(CURDIR)/src/probot/logging/telemetry_profiles.cpp
TEST_EXTRA_SOURCES :=

# Common flags
EXTRA_FLAGS_COMMON := -DESP32S3 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1
EXTRA_FLAGS_COMMON := -DESP32S3 -DARDUINO_USB_MODE=1

# Example-specific extra flags (function)
example_flags = $(if $(filter LoopPeriodStress,$(1)),-DPROBOT_CLM_NOLOG=1 -DPROBOT_SCHED_NOLOG=1,)
example_flags = $(if $(filter LoopPeriodStress,$(notdir $(1))),-DPROBOT_CLM_NOLOG=1 -DPROBOT_SCHED_NOLOG=1,)

.PHONY: all build build-all _build_single upload clean boards libs serial list help test tests/control_tests

Expand Down Expand Up @@ -90,7 +90,7 @@ version-sync:
$(PYTHON) $(VERSION_SYNC_SCRIPT)

tests/control_tests: $(TEST_SOURCES)
g++ -std=c++17 -Wall -Wextra -pedantic -I src -I $(TEST_STUB_DIR) -DPROBOT_CLM_NOLOG=1 -DPROBOT_SCHED_NOLOG=1 -DPROBOT_LOGGER_NO_SCHED_ATTACH=1 -o $@ $(TEST_SOURCES) $(TEST_EXTRA_SOURCES)
g++ -std=c++17 -Wall -Wextra -pedantic -I src -I $(TEST_STUB_DIR) -DPROBOT_CLM_NOLOG=1 -DPROBOT_SCHED_NOLOG=1 -DPROBOT_LOGGER_NO_SCHED_ATTACH=1 -DPROBOT_BUILTINLED_EXTERNAL=1 -o $@ $(TEST_SOURCES) $(TEST_EXTRA_SOURCES)

test: build tests/control_tests
./tests/control_tests
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Probot Lib

MEB robot yarışmaları için geliştirilmiş Arduino kütüphanesi. PID kontrolü, motion profiling, WiFi sürücü istasyonu ve ESP32-S3 desteği ile geliyor.
MEB robot yarışmaları için geliştirilmiş Arduino kütüphanesi. PID kontrolü, WiFi sürücü istasyonu ve ESP32-S3 desteği ile geliyor.

**Tüm dokümantasyon için:** https://docs.probotstudio.com/yazilim/

Expand All @@ -12,7 +12,7 @@ MEB robot yarışmaları için geliştirilmiş Arduino kütüphanesi. PID kontro
Arduino IDE'nin Library Manager'ından "Probot Lib" arayıp yükleyin.

**İlk robot kodunuz:**
1. `File → Examples → Probot Lib → BasicTankDrive` açın
1. `File → Examples → Probot Lib → command_based → TankDriveDemo` açın
2. ESP32-S3'e yükleyin
3. `Probot-XXXX` WiFi ağına bağlanın
4. Tarayıcıdan `http://192.168.4.1` adresini açın
Expand All @@ -25,24 +25,24 @@ Arduino IDE'nin Library Manager'ından "Probot Lib" arayıp yükleyin.
Kütüphane seviyelerine göre düzenlenmiş örneklerle geliyor:

**Başlangıç seviyesi:**
- `BasicTankDrive` - Tank sürüş sistemi ve joystick kontrolü
- `MotorTest` - Motor test ve kalibrasyon
- `command_based/TankDriveDemo` - Tank sürüş sistemi ve joystick kontrolü
- `MotorOpenLoopDemo` - Motor kontrolcu test ve kalibrasyonu

**Orta seviye:**
- `ClosedLoopMotorTest` - PID tabanlı hız kontrolü
- `TankDriveAuto` - Otonom hareket (mesafe ve dönüş)
- `MotorControllerDemo` - PID tabanlı hız kontrolü (PidMotorWrapper)
- `command_based/AutonomousDemo` - Otonom hareket (mesafe ve dönüş)

**İleri seviye:**
- `FullRobotDemo` - Tam donanımlı robot (sürüş + mekanizmalar)
- `nfr/AdvancedTankDrive` - Trajectory following ve motion profiling
- `command_based/MecanumDriveDemo` - Mecanum sürüş ve kinematik kontrol
- `ShooterDemo` - Kapalı çevrim atıcı kontrolü

Her örnek doğrudan çalışır durumda ve yorumlarla açıklanmıştır.

---

## Platform Desteği

- **Arduino IDE / arduino-cli:** `library.properties` ve `Makefile` üzerinden doğrudan desteklenir. `make build EXAMPLE=TankDriveDemo` komutu, `arduino-cli` ile örnekleri derler.
- **Arduino IDE / arduino-cli:** `library.properties` ve `Makefile` üzerinden doğrudan desteklenir. `make build EXAMPLE=command_based/TankDriveDemo` komutu, `arduino-cli` ile örnekleri derler.
- **PlatformIO (Arduino framework):** Kütüphaneyi `lib_deps = /path/to/probot-lib` ya da Git URL'siyle ekleyin. `library.json` sürüm bilgisi `VERSION` dosyasından otomatik güncellenir.
- **ESP-IDF + Arduino bileşeni:** Depoyu IDF projenizin `components/` klasörüne yerleştirip `idf.py build` çalıştırabilirsiniz. `idf_component.yml` otomatik olarak Arduino bileşenine bağımlıdır; `app_main` içinde `probot::runtime_setup()` çağırarak Arduino dışındaki uygulamalarda da aynı robot yaşam döngüsünü başlatabilirsiniz.

Expand All @@ -54,7 +54,7 @@ Tüm platformlarda sürüm numarası `VERSION` dosyasından yönetilir; `make ve

Kütüphane şunları sağlar:
- WiFi tabanlı driver station (web arayüzü)
- PID, feedforward ve motion profiling
- PID ve feedforward
- State-space kontrol araçları (Kalman filtre, LQR)
- Tank ve mecanum sürüş soyutlamaları
- Mekanizma yardımcıları (kol, asansör, slider)
Expand All @@ -68,7 +68,7 @@ Detaylı API dokümantasyonu ve kullanım örnekleri için https://docs.probotst

**Önerilen:** [Boardoza Pulse S32-S3](https://boardoza.com/product/boardoza-pulse-s32-s3-breakout-board/)

Kütüphane ESP32-S3 için geliştirilmiştir. Motor sürücü olarak herhangi bir PWM sürücü kullanabilirsiniz (Boardoza BA6208, TB6612, vb.)
Kütüphane ESP32-S3 için geliştirilmiştir. Motor kontrolcusu olarak herhangi bir PWM kontrolcu kullanabilirsiniz (Boardoza VNH5019, BTS7960B, TB6612, vb.)

---

Expand Down Expand Up @@ -108,7 +108,7 @@ Amacımız ekiplerin yarışma gününe hazır robotlarla çıkmasını sağlama

# Probot Lib (EN)

Arduino library built for Ministry of Education robot competitions. Includes PID control, motion profiling, a WiFi driver station, and ESP32-S3 support.
Arduino library built for Ministry of Education robot competitions. Includes PID control, a WiFi driver station, and ESP32-S3 support.

**Full documentation:** https://docs.probotstudio.com/yazilim/

Expand All @@ -120,7 +120,7 @@ Arduino library built for Ministry of Education robot competitions. Includes PID
Open the Arduino IDE Library Manager, search for "Probot Lib", and install it.

**Your first robot code:**
1. Open `File → Examples → Probot Lib → BasicTankDrive`
1. Open `File → Examples → Probot Lib → command_based → TankDriveDemo`
2. Upload it to the ESP32-S3
3. Connect to the `Probot-XXXX` WiFi network
4. Visit `http://192.168.4.1` in your browser
Expand All @@ -133,24 +133,24 @@ Open the Arduino IDE Library Manager, search for "Probot Lib", and install it.
The library ships with examples organized by proficiency level:

**Beginner level:**
- `BasicTankDrive` - Tank drive system with joystick control
- `MotorTest` - Motor testing and calibration
- `command_based/TankDriveDemo` - Tank drive system with joystick control
- `MotorOpenLoopDemo` - Motor controller open-loop test and calibration

**Intermediate:**
- `ClosedLoopMotorTest` - PID-based speed control
- `TankDriveAuto` - Autonomous motion (distance and turn)
- `MotorControllerDemo` - PID-based speed control (PidMotorWrapper)
- `command_based/AutonomousDemo` - Autonomous motion (distance and turn)

**Advanced:**
- `FullRobotDemo` - Full-featured robot (drive + mechanisms)
- `nfr/AdvancedTankDrive` - Trajectory following and motion profiling
- `command_based/MecanumDriveDemo` - Mecanum drive and kinematic control
- `ShooterDemo` - Closed-loop shooter control

Every example runs out of the box and is documented with inline comments.

---

## Platform Support

- **Arduino IDE / arduino-cli:** build examples with `make build EXAMPLE=TankDriveDemo`; metadata comes from `library.properties`.
- **Arduino IDE / arduino-cli:** build examples with `make build EXAMPLE=command_based/TankDriveDemo`; metadata comes from `library.properties`.
- **PlatformIO (Arduino framework):** add `lib_deps = /path/to/probot-lib` or the Git URL; `library.json` stays in sync with `VERSION`.
- **ESP-IDF with the Arduino component:** drop the repository under your project's `components/` directory (or use `idf_component.yml` via the component manager) and call `idf.py build`. Invoke `probot::runtime_setup()` from `app_main()` to reuse the Arduino lifecycle on pure ESP-IDF projects.

Expand All @@ -162,7 +162,7 @@ Every example runs out of the box and is documented with inline comments.

The library provides:
- WiFi-based driver station (web interface)
- PID, feedforward, and motion profiling utilities
- PID and feedforward utilities
- State-space control tools (Kalman filter, LQR)
- Tank and mecanum drive abstractions
- Mechanism helpers (arm, elevator, slider)
Expand All @@ -176,7 +176,7 @@ For in-depth API docs and usage guides, visit https://docs.probotstudio.com/yazi

**Recommended:** [Boardoza Pulse S32-S3](https://boardoza.com/product/boardoza-pulse-s32-s3-breakout-board/)

The library targets the ESP32-S3. You can use any PWM motor driver (Boardoza BA6208, TB6612, etc.).
The library targets the ESP32-S3. You can use any PWM motor controller board (Boardoza VNH5019, BTS7960B, TB6612, etc.).

---

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.4
0.2.0
137 changes: 0 additions & 137 deletions examples/AutonomousDemo/AutonomousDemo.ino

This file was deleted.

Loading