How ardev1161/amurcore works
Purpose and runtime
Amur Core is a Qt/C++ desktop control application for communicating with an RPi-based robot running AmurClient. It presents operational UI, sends robot commands, and consumes telemetry, navigation/map, video, and sensor data. Build composition is rooted at CMakeLists.txt; application startup is main.cpp.
Application shell and orchestration
The main UI/controller is AmurCore, defined in amurcore.h and implemented in amurcore.cpp, with its Qt Designer layout in AmurCore.ui. It coordinates feature dialogs and subsystem objects, forming the primary boundary between user actions and robot-control services.
Network transport and robot sessions
The network subsystem owns connection lifecycle and robot-facing communication:
• network/networkcontroller.h, network/networkcontroller.cpp
• network/client.h, network/client.cpp
• network/server.h, network/server.cpp
network/connectdialog.* supplies connection UI. network/robotrepository.* and network/robotentry.h model/manage known or active robot endpoints. Client/server support indicates the application can initiate connections and expose a server-side communication role.
Protocol contract
Robot communication is defined through Protocol Buffers under network/protobuf/, including robot.proto, drives.proto, video.proto, map.proto, navigation.proto, imu.proto, and power.proto. network/protobuf/CMakeLists.txt builds generated protocol artifacts. This is the key compatibility boundary with the external AmurClient robot software; CMake gRPC setup is in cmake/grpc.cmake.
Concurrent execution model
Background processing is organized around generic worker/session abstractions:
• threads/worker.h, threads/worker.cpp
• threads/session.h, threads/session.cpp
These isolate long-running connection, input, or processing work from the Qt UI event loop. Feature-specific workers, such as camera/calibratorworker.* and joystick/joystickstateworker.*, likely feed results back through Qt’s signal/slot mechanisms.
Robot control, navigation, and status logic
The logic module translates UI/system state into robot behaviors and displays received state:
• logic/logic.h, logic/logic.cpp
• logic/movements.h, logic/movements.cpp
• logic/system.h, logic/system.cpp
Navigation is mediated by logic/navigation_adapter.h, with map display in logic/map/mapwidget.* and navigation/status dialogs in logic/navdialog.* and logic/robotinfodialog.*. These components sit between protobuf/network payloads and user-visible control/status views.
Camera and joystick input pipelines
Camera support includes calibration UI and calibration processing in camera/camcalibrate.*, camera/calibrator.*, and camera/calibratorworker.*; OpenCV is the material vision dependency. Joystick support wraps SDL-based device input and converts it into control state through joystick/joystick.*, joystick/getstatebyjoy.*, and joystick/v_joystick_adapter.*. Both pipelines ultimately supply robot movement/camera commands through application logic and network transport.
Configuration and external dependencies
config/configprocessor.* loads application configuration, templated by AmurCore.cfg.in. The runtime depends on Qt 5 (including Qt Speech), OpenCV, Protobuf/gRPC, SDL2, and PocketSphinx/SphinxBase. The robot is expected to expose camera, IMU, environmental/power sensors, wheel/hand encoders, drive motors, and camera servos through the protocol contract.
Main entry points: networkcontroller.cpp Network controller · logic.cpp Control logic · amurcore.cpp AmurCore shell · session.cpp Worker sessions
Components 19
Desktop application
- Application startup
main.cpp - AmurCore shell · Primary boundary between operator actions and robot services.
amurcore.cpp - Main window layout
AmurCore.ui - Connection dialog
Control and UI features
- Control logic · Translates application state into robot control and received status.
logic/logic.cpp - Movement control
logic/movements.cpp - Navigation adapter
logic/navigation_adapter.h - Map display
- Navigation and status dialogs
Robot communication
- Network controller · Owns robot-facing connection lifecycle.
network/networkcontroller.cpp - Robot repository · Models known and active robot endpoints.
- Robot client
network/client.cpp - Communication server
network/server.cpp - Robot protobuf contract · Compatibility boundary with external AmurClient.
Input pipelines
- Worker sessions · Keeps connection and processing work off the Qt event loop.
threads/session.cpp - Camera calibration · Calibration UI and background processing.
- Joystick input · Converts device input into control state.
Other components
- CMake build · Build root and dependency composition.
CMakeLists.txt - AmurClient robot · Provides drives, navigation, video, IMU, and power telemetry.
Connections 24
- CMake build → Application startup: builds
- Application startup → AmurCore shell: starts
- AmurCore shell → Main window layout: uses
- AmurCore shell → Connection dialog: opens
- AmurCore shell → Control logic: coordinates
- AmurCore shell → Network controller: manages sessions
- Connection dialog → Robot repository: selects endpoint
- Robot repository → Network controller: supplies endpoint
- Control logic → Movement control: issues controls
- Control logic → Navigation adapter: adapts navigation
- Navigation adapter → Map display: renders map data
- Control logic → Navigation and status dialogs: updates status
- Control logic → Network controller: sends commands
- Network controller → Robot client: initiates connections
- Network controller → Communication server: hosts communication role
- Network controller → Worker sessions: runs work in background
- Robot client → Robot protobuf contract: uses
- Communication server → Robot protobuf contract: uses
- Robot protobuf contract → AmurClient robot: defines robot API
- AmurClient robot → Network controller: telemetry and media
- Camera calibration → Worker sessions: calibration worker
- Camera calibration → Control logic: supplies camera commands
- Joystick input → Worker sessions: state worker
- Joystick input → Movement control: supplies control state