Limit values of frame rate and imu frequency
This commit is contained in:
parent
9fcbb066bb
commit
730d221637
|
@ -16,8 +16,8 @@
|
|||
|
||||
| 名称 | 字段 | 字节数 | 默认值 | 最小值 | 最大值 | 是否储存 | Flash 地址 | 所属通道 | 通道地址 | 说明 |
|
||||
| :----- | :----- | :-------- | :-------- | :-------- | :-------- | :----------- | :----------- | :----------- | :----------- | :----- |
|
||||
| 图像帧率 | frame_rate | 2 | 25 | 10 | 60 | √ | 0x21 | XU_CAM_CTRL | 0x0100 | |
|
||||
| IMU 频率 | imu_frequency | 2 | 200 | 200 | 500 | √ | 0x23 | XU_CAM_CTRL | 0x0100 | |
|
||||
| 图像帧率 | frame_rate | 2 | 25 | 10 | 60 | √ | 0x21 | XU_CAM_CTRL | 0x0100 | 步进为5,即有效值为{10,15,20,25,30,35,40,45,50,55,60} |
|
||||
| IMU 频率 | imu_frequency | 2 | 200 | 100 | 500 | √ | 0x23 | XU_CAM_CTRL | 0x0100 | 有效值为{100,200,250,333,500} |
|
||||
| 曝光模式 | exposure_mode | 1 | 0 | 0 | 1 | √ | 0x0F | XU_CAM_CTRL | 0x0100 | 0:开启自动曝光; 1:关闭 |
|
||||
| 最大增益 | max_gain | 2 | 48 | 0 | 48 | √ | 0x1D | XU_CAM_CTRL | 0x0100 | 开始自动曝光,可设定的阈值 |
|
||||
| 最大曝光时间 | max_exposure_time | 2 | 240 | 0 | 240 | √ | 0x1B | XU_CAM_CTRL | 0x0100 | 开始自动曝光,可设定的阈值 |
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <bitset>
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
MYNTEYE_BEGIN_NAMESPACE
|
||||
|
@ -152,6 +154,19 @@ void Channels::SetControlValue(const Option &option, std::int32_t value) {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
auto in_values = [&option, &value](std::vector<std::int32_t> values) {
|
||||
if (std::find(values.begin(), values.end(), value) != values.end()) {
|
||||
return true;
|
||||
} else {
|
||||
std::ostringstream ss;
|
||||
std::copy(
|
||||
values.begin(), values.end(),
|
||||
std::ostream_iterator<std::int32_t>(ss, ","));
|
||||
LOG(WARNING) << option << " set value invalid, must be {" << ss.str()
|
||||
<< "}";
|
||||
return false;
|
||||
}
|
||||
};
|
||||
switch (option) {
|
||||
case Option::GAIN:
|
||||
case Option::BRIGHTNESS:
|
||||
|
@ -162,8 +177,17 @@ void Channels::SetControlValue(const Option &option, std::int32_t value) {
|
|||
LOG(WARNING) << option << " set value failed";
|
||||
}
|
||||
} break;
|
||||
case Option::FRAME_RATE:
|
||||
case Option::IMU_FREQUENCY:
|
||||
case Option::FRAME_RATE: {
|
||||
if (!in_range() ||
|
||||
!in_values({10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}))
|
||||
break;
|
||||
XuCamCtrlSet(option, value);
|
||||
} break;
|
||||
case Option::IMU_FREQUENCY: {
|
||||
if (!in_range() || !in_values({100, 200, 250, 333, 500}))
|
||||
break;
|
||||
XuCamCtrlSet(option, value);
|
||||
} break;
|
||||
case Option::EXPOSURE_MODE:
|
||||
case Option::MAX_GAIN:
|
||||
case Option::MAX_EXPOSURE_TIME:
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
<arg name="contrast" default="-1" />
|
||||
<!-- <arg name="contrast" default="127" /> -->
|
||||
|
||||
<!-- frame_rate range: [10,60]-->
|
||||
<!-- frame_rate range: {10,15,20,25,30,35,40,45,50,55,60} -->
|
||||
<arg name="frame_rate" default="-1" />
|
||||
<!-- <arg name="frame_rate" default="25" /> -->
|
||||
|
||||
<!-- imu_frequency range: [200,500]-->
|
||||
<!-- imu_frequency range: {100,200,250,333,500} -->
|
||||
<arg name="imu_frequency" default="-1" />
|
||||
<!-- <arg name="imu_frequency" default="200" /> -->
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user