|
GKD.RoboCtrl
RoboMaster Linux 电控:异步 IO、设备驱动与机器人控制
|
用于存放工具函数的命名空间。 更多...
用于存放工具函数的命名空间。
封装了工具函数,如字节序列转换、角度处理等。
命名空间 | |
| namespace | byte_literals |
| 字节面向的用户字面量命名空间。 | |
类 | |
| struct | ballistic_config |
| struct | ballistic_solution |
| struct | ballistic_target |
| struct | ballistic_vector |
| struct | control_chain |
| 控制链,将多个控制器串联组合。 更多... | |
| class | control_stage |
| struct | function_arg |
| struct | function_arg< Ret(*)(Arg) noexcept > |
| struct | function_arg< Ret(*)(Arg)> |
| struct | function_arg< Ret(Arg) noexcept > |
| struct | function_arg< Ret(Arg)> |
| struct | function_arg< Ret(Class::*)(Arg) const > |
| struct | function_arg< Ret(Class::*)(Arg) const noexcept > |
| struct | function_arg< Ret(Class::*)(Arg) noexcept > |
| struct | function_arg< Ret(Class::*)(Arg)> |
| struct | immovable_base |
| 快速继承获得“不可移动”约束的基类。 更多... | |
| class | Matrix |
| struct | not_copyable_base |
| 快速继承获得“不可复制”约束的基类。 更多... | |
| struct | pair |
| 双值绑定结构,兼容 std::pair。 更多... | |
| struct | pid_base |
| PID 控制器基础模板。 更多... | |
| class | ramp |
| 一阶斜坡控制器 (Ramp) 更多... | |
| class | RLS |
| class | runtime_control_chain |
| class | singleton_base |
| 提供单例模式的单例基类 更多... | |
概念 | |
| concept | invocable_r |
| 约束可调用对象的返回值。 | |
| concept | instance_of |
| 判断类型是否为某模板的实例。 | |
| concept | immovable |
| 判断类型不可移动。 | |
| concept | not_copyable |
| 判断类型不可复制。 | |
| concept | package |
| 用于约束“可安全作为报文搬运”的平凡类型。 | |
| concept | controller |
| 控制器概念,约束 update/state/构造能力。 | |
| concept | singleton_info |
| 单例信息 | |
| concept | singleton |
| concept | byte_container |
描述具有 data() 与 size() 接口的字节容器。 | |
类型定义 | |
| template<int r, int c> | |
| using | Matrixf = Matrix< r, c, float > |
| using | linear_pid = pid_base< fp32, details::linear_error > |
| 线性 PID 控制器。 | |
| using | rad_pid = pid_base< fp32, details::rad_error > |
| 角度 PID 控制器。 | |
| template<device::motor motor_type> | |
| using | linear_pid_motor = device::controlled_motor< motor_type, linear_pid > |
| 将线性 PID 附着于特定电机类型的别名。 | |
| template<device::motor motor_type> | |
| using | rad_pid_motor = device::controlled_motor< motor_type, rad_pid > |
| 将角度 PID 附着于特定电机类型的别名。 | |
| using | ramp_f = ramp< float > |
float 精度的 Ramp 控制器别名。 | |
| using | ramp_d = ramp< double > |
double 精度的 Ramp 控制器别名。 | |
| template<typename Fn > | |
| using | function_arg_t = typename function_arg< std::remove_cvref_t< Fn > >::type |
枚举 | |
| enum class | ballistic_status { success , invalid_config , invalid_input , no_intercept , not_converged } |
函数 | |
| std::optional< double > | legacy_ballistic_drag (double bullet_speed) |
| std::optional< ballistic_vector > | ballistic_position (const ballistic_config &config, double speed, double yaw, double pitch, double time) |
| ballistic_solution | solve_ballistics (const ballistic_config &config, const ballistic_target &target, double bullet_speed) |
| template<controller controller_type> | |
| controller_type | make_controller (const typename controller_type::info_type &info) |
| constexpr fp32 | rad_format (fp32 ang) |
| 将角度限制到[-Pi,Pi]范围内 | |
| template<package T, byte_container C> | |
| T | from_bytes (const C &bytes) |
| 将字节容器内容反序列化为平凡类型。 | |
| template<package T> | |
| auto | to_bytes (const T &t) -> std::array< std::byte, sizeof(T)> |
| template<package T, typename C > requires requires(C& c) { { c.data() } -> std::convertible_to<std::byte*>; { c.size() } -> std::convertible_to<std::size_t>; } | |
| void | to_bytes (const T &t, C &container) |
| 将平凡类型序列化到指定容器。 | |
| auto | now () |
| 记录程序启动后的纳秒级时间戳。 | |
| constexpr uint16_t | make_u16 (uint16_t high, uint16_t low) noexcept |
| 将高低字节组合成无符号 16 位整数。 | |
| constexpr int16_t | make_i16 (int16_t high, int16_t low) noexcept |
| 将高低字节组合成有符号 16 位整数。 | |
| constexpr std::byte | to_byte (std::integral auto v) noexcept |
辅助将整数转换为 std::byte。 | |
| using roboctrl::utils::function_arg_t = typedef typename function_arg<std::remove_cvref_t<Fn> >::type |
| using roboctrl::utils::linear_pid = typedef pid_base<fp32, details::linear_error> |
| using roboctrl::utils::linear_pid_motor = typedef device::controlled_motor<motor_type, linear_pid> |
| using roboctrl::utils::Matrixf = typedef Matrix<r, c, float> |
在文件 Matrix.hpp 第 508 行定义.
| using roboctrl::utils::rad_pid = typedef pid_base<fp32, details::rad_error> |
| using roboctrl::utils::rad_pid_motor = typedef device::controlled_motor<motor_type, rad_pid> |
| using roboctrl::utils::ramp_d = typedef ramp<double> |
| using roboctrl::utils::ramp_f = typedef ramp<float> |
|
strong |
在文件 ballistics.hpp 第 37 行定义.
| std::optional< ballistic_vector > roboctrl::utils::ballistic_position | ( | const ballistic_config & | config, |
| double | speed, | ||
| double | yaw, | ||
| double | pitch, | ||
| double | time | ||
| ) |
Evaluate the same linear-drag trajectory used by solve_ballistics().
在文件 ballistics.cpp 第 98 行定义.
| T roboctrl::utils::from_bytes | ( | const C & | bytes | ) |
| std::optional< double > roboctrl::utils::legacy_ballistic_drag | ( | double | bullet_speed | ) |
Legacy uncalibrated coefficient lookup, made opt-in instead of implicit.
在文件 ballistics.cpp 第 89 行定义.
| controller_type roboctrl::utils::make_controller | ( | const typename controller_type::info_type & | info | ) |
在文件 controller.hpp 第 123 行定义.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
记录程序启动后的纳秒级时间戳。
被这些函数引用 roboctrl::device::device_base::offline(), roboctrl::device::device_base::tick() , 以及 roboctrl::utils::ramp< T >::update().
将角度限制到[-Pi,Pi]范围内
引用了 roboctrl::Pi_f.
被这些函数引用 roboctrl::device::convert_serial_imu(), roboctrl::device::gkd_sentry_gimbal::set_target_yaw() , 以及 roboctrl::device::gkd_sentry_gimbal::update().
| ballistic_solution roboctrl::utils::solve_ballistics | ( | const ballistic_config & | config, |
| const ballistic_target & | target, | ||
| double | bullet_speed | ||
| ) |
Bounded search for the first bracketed positive-time intercept in max_flight_time. Retains the old adjacent-armor selection and high-spin front-surface prediction. no_intercept means no root was bracketed in this horizon, not a reachability proof. Pure calculation: it neither commands hardware nor authorizes firing.
在文件 ballistics.cpp 第 111 行定义.
引用了 roboctrl::utils::ballistic_config::drag , 以及 roboctrl::utils::ballistic_solution::pitch.
|
inlineconstexprnoexcept |
| auto roboctrl::utils::to_bytes | ( | const T & | t | ) | -> std::array<std::byte, sizeof(T)> |
| void roboctrl::utils::to_bytes | ( | const T & | t, |
| C & | container | ||
| ) |