Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxi-scut committed Jan 5, 2025
2 parents 01a9b8a + b316311 commit 6498bd3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 81 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/linux-1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
- 1.x

jobs:
cmake-support-x86_64:
name: CMake support for x86_64
uses: cv-rmvl/ci-workflow/.github/workflows/rmvl-install-u22.yml@main
minimal-support-x86_64:
name: Minimal support for x86_64
uses: cv-rmvl/ci-workflow/.github/workflows/rmvl-lowest.yml@main
Expand Down
25 changes: 5 additions & 20 deletions extra/combo/include/rmvl/combo/rune.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ namespace rm

/**
* @brief 神符(能量机关)
* @note
* - `at(0)`: 神符靶心,`at(1)`: 神符旋转中心(R 标)
* - `angle()` 获取的角度范围是 `[-180,180)`
* - `corners()`
* - `[0]`: 靶心环最靠近神符中心的点
* - `[1]`: 靶心环与角点 `[0][2]` 的中垂线的交点(顺时针)
* - `[2]`: 靶心环最远离神符中心的点
* - `[3]`: 靶心环与角点 `[0][2]` 的中垂线的交点(顺时针)
* - `[4]`: 神符中心点
* - `extrinsics` 数据仅直线距离 `distance` 有效
* - `center` 为神符靶心的中心点,要获取神符旋转中心请访问对应特征 `at(1)`
* - 特征信息 `[0]`: 神符靶心,`[1]`: 神符旋转中心(R 标)
* - 角度信息 `angle()` 获取的角度范围是 `[-180,180)`
* - 角点信息 `corners()` 获取的内容是 `[0]`: 神符靶心特征中心点,`[1]`: 神符中心特征中心点
* - 相机外参 `extrinsic()` 数据仅直线距离 `distance` 有效
* - 中心点 `center()` 为神符靶心的中心点,要获取神符旋转中心请访问对应特征,例如使用 `at(1)`
*/
class RMVL_EXPORTS_W_DES Rune final : public combo
{
Expand Down Expand Up @@ -100,15 +94,6 @@ class RMVL_EXPORTS_W_DES Rune final : public combo
RMVL_W inline bool isActive() { return _is_active; }

private:
/**
* @brief 计算神符装甲板的四个角点
*
* @param[in] p_target 神符靶心
* @param[in] p_center 神符中心
* @return 按照左下,左上,右上,右下的顺序排列的角点向量
*/
static std::vector<cv::Point2f> calculatePoints(RuneTarget::ptr p_target, RuneCenter::ptr p_center);

float _feature_dis{}; //!< 特征间距
bool _is_active{}; //!< 是否激活
};
Expand Down
20 changes: 8 additions & 12 deletions extra/combo/src/rune/rune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,25 @@ Rune::ptr Rune::make_combo(RuneTarget::ptr p_target, RuneCenter::ptr p_center,

Rune::Rune(RuneTarget::ptr p_target, RuneCenter::ptr p_center, const ImuData &imu_data, double tick)
{
// 通用信息
_imu_data = imu_data;
_width = p_target->width() + p_center->width() + getDistance(p_target->center(), p_center->center());
_height = p_target->height();
// ------------- 获取神符中心 -------------
_center = p_target->center();
// ------------- 获取激活信息 -------------
_is_active = p_target->isActive();
// ----------- 计算相对目标转角 -----------
_relative_angle = calculateRelativeAngle(para::camera_param.cameraMatrix, _center);
// ------------- 计算直线距离 -------------
// 计算 pitch 的绝对目标转角
double absolute_angle = _relative_angle.y + _imu_data.rotation.pitch;
// 计算距离
_extrinsic.distance(para::rune_param.RUNE_DISTANCE * sec(deg2rad(absolute_angle)));
// ------------- 更新神符角度 -------------
auto angle_vec = Rune::cameraConvertToVertical(p_target->center() - p_center->center(),
imu_data.rotation.pitch);
// 神符角度
auto angle_vec = Rune::cameraConvertToVertical(p_target->center() - p_center->center(), imu_data.rotation.pitch);
_angle = getHAngle(p_center->center(), cv::Point2f(angle_vec) + p_center->center(), DEG);
// ----------- 更新神符特征间距 -----------
_feature_dis = getDistance(angle_vec, cv::Vec2f{});
// ---------- 设置组合体特征指针 ----------
_features = {p_target, p_center};
// ---------- 更新组合体类型信息 ----------
_corners = {p_target->center(), p_center->center()};

// 专属信息
_is_active = p_target->isActive();
_feature_dis = getDistance(angle_vec, cv::Vec2f{});
_state["rune"] = _is_active ? "active" : "inactive";
_tick = tick;
}
Expand Down
46 changes: 0 additions & 46 deletions extra/combo/src/rune/rune_cal.cpp

This file was deleted.

0 comments on commit 6498bd3

Please sign in to comment.