Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
40fafa1
refactor(utils): rename transform.hpp to coordinate.hpp
heyeuu Sep 1, 2025
83751c5
feat(classifier): add classifier
heyeuu Sep 2, 2025
477a35f
fix(classifier): resolve issues in classifier class implementation
heyeuu Sep 2, 2025
cd95986
添加注释
fans963 Sep 2, 2025
879682b
feat(logging): add logger module
heyeuu Sep 2, 2025
0e7e505
fix(build): correct CMakeLists.txt include directory configuration
heyeuu Sep 3, 2025
78f16f9
feat(logging): add logger module
heyeuu Sep 3, 2025
7e477e6
feat(debug): add stringifier utility for ID string conversion
heyeuu Sep 3, 2025
1586caf
feat(identifier): add identifier module for armor identification
heyeuu Sep 3, 2025
541f531
fix(utils): correct incomplete namespace in stringifier module
heyeuu Sep 3, 2025
4304b8c
refactor(solver): rewrite interface implementation and add index-to-i…
heyeuu Sep 4, 2025
43109dc
add comment
fans963 Sep 4, 2025
cbff1ad
Merge remote-tracking branch 'upstream/main' into tongji-dev
heyeuu Sep 4, 2025
ac59b59
Merge remote-tracking branch 'upstream/with_comment' into tongji-dev
heyeuu Sep 4, 2025
8b24d98
fix(identifier):enhance identifier debug output and change target col…
heyeuu Sep 4, 2025
2bc4e9d
fix(identifier):enhance identifier debug output
heyeuu Sep 5, 2025
99a4bc7
fix(identifier):add internal recording flag
heyeuu Sep 5, 2025
53fd55a
添加了接口的注释
AlrayQiu Sep 7, 2025
570d100
修复错误的函数签名
AlrayQiu Sep 12, 2025
7fe53df
feat: add state machine
heyeuu Sep 14, 2025
244d7c5
feat: Add predictor module
heyeuu Sep 15, 2025
af9017c
feat(env): Add libfmt-dev and libspdlog-dev dependencies
heyeuu Sep 15, 2025
399aa78
Merge branch 'main' into tongji-dev
AlrayQiu Sep 15, 2025
d024183
refactor(interface): Rename the file of armors and change the armor i…
heyeuu Sep 17, 2025
deef680
WIP: partially implement ITargetPredictor interface
heyeuu Sep 17, 2025
00fdd5e
WIP: partially implement ITargetPredictor interface
heyeuu Sep 18, 2025
9596d7a
WIP: partially implement ITargetPredictor interface
heyeuu Sep 18, 2025
dc596de
refactor(prediction): refactor IPredictor and ITargetPredictor implem…
heyeuu Sep 20, 2025
0dcffbf
refactor(predictor): overhaul predictor implementation
heyeuu Sep 22, 2025
eeb09ae
Merge branch 'main' into tongji-dev
AlrayQiu Sep 22, 2025
b873347
feat: add state machine
heyeuu Sep 14, 2025
e746464
merge: fix conflicts from git merge
heyeuu Sep 23, 2025
2d7eb52
fix(targeting): correct armor target acquisition logic
heyeuu Sep 25, 2025
30235d2
refactor(predict, utils): move Extended Kalman Filter from utils to p…
heyeuu Sep 26, 2025
1538095
feat: add trajectory
heyeuu Sep 28, 2025
442f366
[Add] 添加火控实现的头文件
AlrayQiu Oct 1, 2025
da83d40
Merge remote-tracking branch 'origin/main' into tongji-dev
heyeuu Oct 1, 2025
337fc34
Merge remote-tracking branch 'origin/tongji-dev' into tongji-dev
heyeuu Oct 1, 2025
ba1f6fb
[Add] 添加Tracker实现
AlrayQiu Oct 2, 2025
e38116e
Merge branch 'tongji-dev' of github.com:Alliance-Algorithm/alliance_a…
heyeuu Oct 2, 2025
3e0fe3d
fix(tracker): fix data structure in tracker.hpp
heyeuu Oct 2, 2025
64e372a
fix(tracker): fix data structure in tracker.hpp
heyeuu Oct 2, 2025
44a79ff
feat(fire_controller): add aim point selection and trajectory classes
heyeuu Oct 3, 2025
2dc6cd8
feat(fire_control): add fire command validation class fire_judge
heyeuu Oct 3, 2025
c44607a
refactor(control): rename classes and refine fire logic
heyeuu Oct 4, 2025
3aa3c9d
feat(fire_control): implement basic module interfaces
heyeuu Oct 4, 2025
890a40a
fix(tracking): improve live_target convergence logic
heyeuu Oct 6, 2025
e599cb4
feat: complete core logic across multiple modules
heyeuu Oct 6, 2025
b11971e
chore(state_machine):refactor StateMachine to PIMPL pattern and do so…
heyeuu Oct 7, 2025
faaa5b1
feat(tracking): complete LiveTargetManager update logic
heyeuu Oct 7, 2025
08b7ebd
feat(fire_control):enhance CalculateTarget logic and add miss public …
heyeuu Oct 8, 2025
7e3b743
refactor(state_machine): complete state machine update logic
heyeuu Oct 8, 2025
010b466
perf(filter): make Kalman filter type inference compile-time
heyeuu Oct 8, 2025
ab6f47a
feat(decider): implement priority assessment logic
heyeuu Oct 9, 2025
344ee50
chore(state): remove redundant logic from state machine
heyeuu Oct 9, 2025
6b29508
chore: remove miscellaneous trivial cruft
heyeuu Oct 9, 2025
919cae3
chore(fire controller): remove redundant timestamp setter function
heyeuu Oct 10, 2025
5111275
refactor: complete initial architectural restructuring
heyeuu Oct 13, 2025
7b15810
refactor(project): reorganize directory structure to match new archit…
heyeuu Oct 13, 2025
9ccbf65
refactor(namespace): update namespaces to align with new architecture
heyeuu Oct 13, 2025
3bfab35
fix(initialization): repair incomplete constructor implementations
heyeuu Oct 13, 2025
50f1976
refactor(filter): rewrite Kalman filter with template implementation
heyeuu Oct 21, 2025
c760351
merge: sync with latest main branch updates
heyeuu Oct 21, 2025
94e19fc
fix(pimpl): correct PIMPL implementation issues
heyeuu Oct 23, 2025
3e50b68
fix(pimpl): correct modern C++ PIMPL implementation
heyeuu Oct 23, 2025
499be08
Merge remote-tracking branch 'origin/main' into tongji-dev
heyeuu Oct 23, 2025
3d6ce85
refactor(config): load identifier parameters from YAML configuration
heyeuu Oct 23, 2025
b95cf4c
refactor(config):Convert fire_controller and predictor constructor to…
heyeuu Oct 23, 2025
5793805
refactor(api): return timestamp by value instead of reference
heyeuu Oct 25, 2025
892f37c
refactor(coordinates): define explicit coordinate systems and update …
heyeuu Oct 26, 2025
adea28e
refactor(solver): extract common logic for better code reuse
heyeuu Oct 27, 2025
e982df8
fix(pimpl): correct PIMPL implementation errors
heyeuu Oct 27, 2025
2b7f997
fix: resolve solver redundancies and predictor timestamp issues
heyeuu Oct 28, 2025
e027f88
Merge remote-tracking branch 'origin/main' into tongji-dev
heyeuu Oct 28, 2025
1798e33
WIP: initial implementation of auto_aim_system with design questions
heyeuu Oct 28, 2025
10e685a
[V1] identifier设置图片时间戳
AlrayQiu Oct 28, 2025
8aead8f
[Tongji] PnpSolver 修正输出的时间戳
AlrayQiu Oct 28, 2025
797750d
[Tongji] TargetManager 修复卡尔曼滤波器更新所传入时间的错误
AlrayQiu Oct 28, 2025
86c7c61
[Tongji] 把内部的指针转换变为传入参数的约束,维持状态机原始实现
AlrayQiu Oct 28, 2025
83167b6
[Tongji] Firecontrol 修复时间
AlrayQiu Oct 28, 2025
ea3ee96
[Tongji] 修复Solve的时序错误
AlrayQiu Oct 28, 2025
e383c64
[Framework]: 将内容单一重复的接口提取为DTO
AlrayQiu Oct 28, 2025
af9f8af
[V1] 补充火控的预测器设置
AlrayQiu Oct 31, 2025
a9d79d5
fix(fire_control): correct logical issues in fire controller
heyeuu Oct 31, 2025
c408908
Merge branch 'tongji-dev' of github.com:Alliance-Algorithm/alliance_a…
heyeuu Oct 31, 2025
b0705c5
chore(config): clean up redundant parameters and fix timestamp config…
heyeuu Oct 31, 2025
3b880b5
chore(predictor): remove redundant Snapshot classes and related code
heyeuu Oct 31, 2025
1f3bb95
[CI] 添加子仓库recursive update
AlrayQiu Nov 1, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/test-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ build
install
log
.cache
.devcontainer
.devcontainer
docker-compose.yml
Dockerfile
.env
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"gruntfuggly.todo-tree"
]
}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ target_link_libraries(alliance_auto_aim PUBLIC
TBB::tbb
openvino::runtime
Ceres::ceres
yaml-cpp
)

# 安装规则
Expand Down
44 changes: 44 additions & 0 deletions configs/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#####-----classfier parameters-----#####
# classify_model:
# model_image_width:
# model_image_height:
#
#####-----identifier parameters-----#####
threshold: 150
max_angle_error: 45 #degree
min_lightbar_ratio: 1.5
max_lightbar_ratio: 20
min_lightbar_length: 8
max_armor_ratio: 5
min_armor_ratio: 1
max_side_ratio: 1.5
min_confidence: 0.8
max_rectangular_error: 25 #degree

#####-----target_snapshot_manager parameters-----#####
decision_speed: 7 # rad/s
high_speed_delay_time: 0.050 # s
low_speed_delay_time: 0.015 # s

#####-----fire_decision parameters-----#####
auto_fire: true
first_tolerance: 100 # 近距离射击容差,degree
second_tolerance: 100 # 远距离射击容差,degree
judge_distance: 2 #距离判断阈值

#####-----fire_controller parameters-----#####
control_delay_s: 0.1

#####-----aiming_solver parameters-----#####
yaw_offset: 1.5 # degree
pitch_offset: -0.5 # degree
bullet_speed: 26

#####-----aime_point_chooser parameters-----#####
comming_angle: 60 # degree
leaving_angle: 20 # degree

#####-----solver parameters-----#####
R_muzzle2camera:
t_muzzle2camera:

2 changes: 1 addition & 1 deletion env/ubuntu22.04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/openvino ubuntu22 main" | sudo tee /etc/apt/sources.list.d/intel-openvino.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BAC6F0C353D04109
sudo apt-get update
sudo apt-get install -y libtbb-dev libeigen3-dev libopencv-dev openvino gcc-13 g++-13 libceres-dev libdwarf-dev libbackward-cpp-dev binutils-dev libdw-dev libunwind-dev libfmt-dev libspdlog-dev
sudo apt-get install -y libtbb-dev libeigen3-dev libopencv-dev openvino gcc-13 g++-13 libceres-dev libdwarf-dev libbackward-cpp-dev binutils-dev libdw-dev libunwind-dev libfmt-dev libspdlog-dev libyaml-cpp-dev

sudo ln -s /usr/include/libdwarf/libdwarf.h /usr/include/libdwarf.h
sudo ln -s /usr/include/libdwarf/dwarf.h /usr/include/dwarf.h
Expand Down
4 changes: 3 additions & 1 deletion include/data/fire_control.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#pragma once

#include "data/time_stamped.hpp"

#include <Eigen/Eigen>
#include <ctime>
#include <opencv2/core/core.hpp>

namespace world_exe::data {
struct FireControl {
time_t time_stamp;
data::TimeStamp time_stamp;
/// 以ROS系,光轴方向为x, 上为z,
/// 四个点为: 1->左上 2->右上 3->右下 4->左下,
/// 点实际坐标为opencv系下的像素坐标
Expand Down
44 changes: 44 additions & 0 deletions include/data/predictor_update_package.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#pragma once

#include "data/sync_data.hpp"
#include "interfaces/armor_in_camera.hpp"

#include "data/time_stamped.hpp"
#include <memory>

namespace world_exe::data {

struct PredictorUpdatePackage final{
public:

/**
* @brief 传感器数据获取时的时间戳
*/
const data::TimeStamp& GetTimeStamp() const{ return data1_.camera_capture_begin_time_stamp; };

/**
* @brief 求解好的装甲板三维信息
*
* @return std::shared_ptr<IArmorInCamera>
*/
std::shared_ptr<world_exe::interfaces::IArmorInCamera> GetArmors() const{return data2_;};

/**
* @brief 相机坐标系到世界坐标系的仿射变换
*
* @return Eigen::Affine3d
*/
Eigen::Affine3d GetCameraToWorld() const {return data1_.camera_to_gimbal;};

// but why?
PredictorUpdatePackage(const data::CameraGimbalMuzzleSyncData& data1, std::shared_ptr<world_exe::interfaces::IArmorInCamera> data2)
: data1_(data1)
, data2_(data2){
}
PredictorUpdatePackage() = delete;
~PredictorUpdatePackage() = default;
private:
const data::CameraGimbalMuzzleSyncData& data1_;
const std::shared_ptr<world_exe::interfaces::IArmorInCamera> data2_;
};
}
3 changes: 2 additions & 1 deletion include/data/sync_data.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once

#include "data/time_stamped.hpp"
#include <Eigen/Eigen>
#include <ctime>
namespace world_exe::data {
struct CameraGimbalMuzzleSyncData {
std::time_t camera_capture_begin_time_stamp;
data::TimeStamp camera_capture_begin_time_stamp;
Eigen::Affine3d camera_to_gimbal;
Eigen::Affine3d gimbal_to_muzzle;
};
Expand Down
36 changes: 36 additions & 0 deletions include/data/time_stamped.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once

#include <chrono>
#include <ctime>
namespace world_exe::data {
/**
* @brief 时间戳,通常是SteadyClock
*/
struct TimeStamp {

public:

inline TimeStamp() : stamp_(){}
inline TimeStamp(const TimeStamp& stamp): stamp_(stamp.stamp_) {}
inline TimeStamp(const std::chrono::nanoseconds& stamp): stamp_(stamp) {}
inline TimeStamp(const std::chrono::seconds& stamp): stamp_(std::chrono::duration_cast<std::chrono::nanoseconds>(stamp)) {}

inline constexpr double to_seconds() const{return stamp_.count() * 1e-9;}
inline constexpr double to_nanosec() const{return stamp_.count();}

auto operator<=>(const TimeStamp& other) const noexcept = default;
inline TimeStamp operator- (const TimeStamp& other) const noexcept {return TimeStamp{stamp_ - other.stamp_};}
inline TimeStamp operator+ (const TimeStamp& other) const noexcept {return TimeStamp{stamp_ + other.stamp_};}
inline TimeStamp operator* (const double& ratio) const noexcept {return from_nanosec(stamp_.count() * ratio);}
inline TimeStamp operator/ (const double& ratio) const noexcept {return from_nanosec(stamp_.count() / ratio);}

template<typename T>
static inline TimeStamp from_seconds(const T time){return TimeStamp{std::chrono::nanoseconds(static_cast<long int>(time * 1e9))};}
template<typename T>
static inline TimeStamp from_nanosec(const T time){return TimeStamp{std::chrono::nanoseconds(static_cast<long int>(time))};}

private:
std::chrono::nanoseconds stamp_;

};
}
6 changes: 4 additions & 2 deletions include/interfaces/armor_in_camera.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#pragma once

#include "data/armor_camera_spacing.hpp"
#include "data/time_stamped.hpp"
#include "enum/armor_id.hpp"
#include "interfaces/time_stamped.hpp"
#include "data/time_stamped.hpp"
#include <opencv2/core/mat.hpp>


namespace world_exe::interfaces {

/**
Expand All @@ -16,7 +18,7 @@ namespace world_exe::interfaces {
class IArmorInCamera {
public:
/// 获取时间戳,标志其内容装甲板的准确时间点
COMBINE_TIME_STAMPED;
virtual const data::TimeStamp& GetTimeStamp() const = 0;

/// 获取某个车辆ID的装甲板集合
virtual const std::vector<data::ArmorCameraSpacing>& GetArmors(
Expand Down
4 changes: 2 additions & 2 deletions include/interfaces/armor_in_gimbal_control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "data/armor_gimbal_control_spacing.hpp"
#include "enum/armor_id.hpp"
#include "time_stamped.hpp"
#include "data/time_stamped.hpp"
#include <opencv2/core/mat.hpp>

namespace world_exe::interfaces {
Expand All @@ -17,7 +17,7 @@ class IArmorInGimbalControl {

public:
/// 获取时间戳,标志其内容装甲板的准确时间点
COMBINE_TIME_STAMPED;
virtual const data::TimeStamp& GetTimeStamp() const = 0;

/// 获取某个车辆ID的装甲板集合
virtual const std::vector<data::ArmorGimbalControlSpacing>& GetArmors(
Expand Down
4 changes: 2 additions & 2 deletions include/interfaces/armor_in_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "data/armor_image_spaceing.hpp"
#include "enum/armor_id.hpp"
#include "time_stamped.hpp"
#include "data/time_stamped.hpp"
#include <opencv2/core/core.hpp>
#include <vector>

Expand All @@ -21,7 +21,7 @@ class IArmorInImage {

public:
/// 获取时间戳,标志其内容装甲板的准确时间点
COMBINE_TIME_STAMPED;
virtual const data::TimeStamp& GetTimeStamp() const = 0;

/**
* @brief 获取某个车辆ID的装甲板集合
Expand Down
3 changes: 2 additions & 1 deletion include/interfaces/fire_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "data/fire_control.hpp"
#include "enum/car_id.hpp"
#include <chrono>
#include <ctime>

namespace world_exe::interfaces {
Expand All @@ -17,7 +18,7 @@ class IFireControl {
* @param time_duration 额外时间差 典型值:当前时刻到当前帧传感器传入内容的时间差
* @return const data::FireControl
*/
virtual const data::FireControl CalculateTarget(const std::time_t& time_duration) const = 0;
virtual const data::FireControl CalculateTarget(const std::chrono::seconds& time_duration) const = 0;

/**
* @brief 获取当前火控系统锁定的车辆ID
Expand Down
3 changes: 2 additions & 1 deletion include/interfaces/predictor.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "armor_in_gimbal_control.hpp"
#include "data/time_stamped.hpp"
#include "enum/armor_id.hpp"
#include <ctime>

Expand All @@ -24,7 +25,7 @@ class IPredictor {
* @return const IArmorInGimbalControl&
*/
virtual std::shared_ptr<IArmorInGimbalControl> Predictor(
const std::time_t& time_stamp) const = 0;
const data::TimeStamp& time_stamp) const = 0;

virtual ~IPredictor() = default;
};
Expand Down
36 changes: 0 additions & 36 deletions include/interfaces/predictor_update_package.hpp

This file was deleted.

6 changes: 3 additions & 3 deletions include/interfaces/sync_block.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <opencv2/core/mat.hpp>
#include "data/time_stamped.hpp"

namespace world_exe::interfaces {
/**
Expand All @@ -12,9 +12,9 @@ template <class T> class ISyncBlock {

public:

virtual void set_data(const T& camera_data);
virtual void set_data(const T& camera_data) = 0;

virtual std::tuple<T, bool> get_data(time_t timestamp);
virtual std::tuple<T, bool> get_data(const data::TimeStamp& timestamp) = 0;

virtual ~ISyncBlock() = default;
};
Expand Down
3 changes: 2 additions & 1 deletion include/interfaces/target_predictor.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "armor_in_gimbal_control.hpp"
#include "data/time_stamped.hpp"
#include "enum/armor_id.hpp"
#include "interfaces/predictor.hpp"
#include <ctime>
Expand All @@ -22,7 +23,7 @@ class ITargetPredictor {
* @return std::shared_ptr<interfaces::IArmorInGimbalControl>
*/
virtual std::shared_ptr<interfaces::IArmorInGimbalControl> Predict(
const enumeration::ArmorIdFlag& id, const std::time_t& time_stamp) = 0;
const enumeration::ArmorIdFlag& id, const data::TimeStamp& time_stamp) = 0;

/**
* @brief 按照传入的id生成IPredictor
Expand Down
17 changes: 0 additions & 17 deletions include/interfaces/time_stamped.hpp

This file was deleted.

Loading