Skip to content

Commit

Permalink
Update README.md and fix error handling in core module
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxi-scut committed Jan 5, 2024
1 parent 533d618 commit fe1d73f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## RMVL: Robotic Manipulation and Vision Library

**机器人操纵与视觉库**
**机器人控制与视觉库**

| 构建配置 | 编译器 | 状态 |
| :------: | :--------: | :----------------------------------------------------------: |
| CMake | GCC 12.3.0 | [![1.x in Linux](https://github.com/cv-rmvl/rmvl/actions/workflows/linux-1.x.yml/badge.svg)](https://github.com/cv-rmvl/rmvl/actions/workflows/linux-1.x.yml) |
| 构建配置 | 编译器/环境 | Github Actions 工作流状态 |
| :------: | :---------: | :----------------------------------------------------------: |
| CMake | GCC 12.3.0 | [![1.x in Linux](https://github.com/cv-rmvl/rmvl/actions/workflows/linux-1.x.yml/badge.svg)](https://github.com/cv-rmvl/rmvl/actions/workflows/linux-1.x.yml) |

RMVL 最初是面向 RoboMaster 赛事的视觉库,因此称为 RoboMaster Vision Library,现计划并逐步完善与机器人相关的视觉、控制、通信的功能,旨在打造适用范围最广、使用简洁、架构统一、功能强大的视觉控制一体库。
RMVL 最初是面向 RoboMaster 赛事的视觉库,因此称为 RoboMaster Vision Library,现计划并逐步完善与机器人相关的视觉、控制、通信的功能,旨在打造适用范围广、使用简洁、架构统一、功能强大的视觉控制一体库。

### 项目资源

Expand All @@ -17,3 +17,4 @@ RMVL 最初是面向 RoboMaster 赛事的视觉库,因此称为 RoboMaster Vis
### 贡献

* 在发起合并请求之前,请先阅读[贡献指南](https://github.com/cv-rmvl/rmvl/wiki/How_to_contribute)
* 交流群:![QQ](https://img.shields.io/badge/QQ-902646082-red?logo=tencentqq)
2 changes: 1 addition & 1 deletion doc/tutorials/modules/core/aggregate_reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void init()

**性质 2** 可以知道,对于元素个数为 \f$n\f$ 的任意聚合体类型 `T`,在 `T` 类实例化对象的时候,初始化列表元素个数 \f$m\f$ 需要满足 \f$m\le n\f$ ,如果 \f$m>n\f$ 则程序非良构。

我们可以有这样一个基本想法,可以给定一个比较大的 \f$m\f$ 作为初值进行构造尝试,如果构造不成功则继续构造 \f$m-1\f$ 的,直到成功构造为止,此时就满足 \f$m=n\f$,因此返回此时的 \f$m\f$ 值即可作为当前聚合体的元素个数 \f$n\f$。
我们可以有这样一个基本想法,<span style="color: red">可以给定一个比较大的 \f$m\f$ 作为初值进行构造尝试</span>,如果构造不成功则继续构造 \f$m-1\f$ 的,直到成功构造为止,此时就满足 \f$m=n\f$,因此返回此时的 \f$m\f$ 值即可作为当前聚合体的元素个数 \f$n\f$。

由于 C++17 缺乏概念机制,因此我们需要通过人为制造具有若干重载版本的函数,并利用模板函数返回类型、形参类型的替换失败来实现该功能,一个最经典的做法是 [SFINAE](https://zh.cppreference.com/w/cpp/language/sfinae)。可以通过函数模板形参在发生替换时非良构,从而删除该函数的其中之一个特化版本。

Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/rmvl/core/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
typedef int RMVLErrorCode; //!< 重定义 `int` 为 RMVLErrorCode

//! @brief RMVL 错误码
enum : RMVLErrorCode
enum RMVLErrorCode : int
{
RMVL_StsOk = 0, //!< 没有错误 No Error
RMVL_StsBackTrace = -1, //!< 回溯 Backtrace
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "rmvl/core/util.hpp"

static constexpr const char *rmvlErrorStr(RMVLErrorCode status)
static constexpr const char *rmvlErrorStr(int status)
{
switch (status)
{
Expand Down Expand Up @@ -60,7 +60,7 @@ std::string rm::format(const char *fmt, ...)
return str;
}

rm::Exception::Exception(RMVLErrorCode _code, const std::string &_err, const std::string &_func,
rm::Exception::Exception(int _code, const std::string &_err, const std::string &_func,
const std::string &_file, int _line)
: code(_code), err(_err), func(_func), file(_file), line(_line)
{
Expand Down

0 comments on commit fe1d73f

Please sign in to comment.