@Alex-Kushleyev, thank you for your answer.
I confirm your assumption, when I set the decimator to 1, the fps is not divided.
Here are the tests I did on SDK 1.5.0 and SDK 1.6.3 :
test with SDK 1.5.0 ;
fps = 10 | standy_enabled = false or true | decimator = 5
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 2.90 | 0 | 1540 | 28.0 | 10.0 | 3.5 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
7170622 | 240 | 180 | 7.1 | -0.0 0.0 0.0 0
fps = 60 | standy_enabled = false or true | decimator = 5
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 1.30 | 0 | 2155 | 9.3 | 59.9 | 20.7 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
10666991 | 240 | 180 | 3.1 | 0.0 0.0 0.0 0
fps = 60 | standy_enabled = false or true | decimator = 5
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 1.18 | 0 | 869 | 9.4 | 59.9 | 20.7 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
10753813 | 240 | 180 | 3.1 | 0.0 0.0 0.0 0
test with SDK 1.6.3
fps = 10 | standy_enabled = true or false | decimator = 1
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 3.02 | 0 | 260 | 29.7 | 10.0 | 3.5 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
2052194 | 240 | 180 | 7.1 | -0.0 0.0 0.0 0
fps = 60 | standy_enabled = true or false | decimator = 1
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 1.18 | 0 | 7532 | 9.3 | 59.9 | 20.7 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
2190721 | 240 | 180 | 3.1 | 0.0 0.0 0.0 0
fps = 60 | standy_enabled = true or false | decimator = 10
| Pipe Name | bytes | wide | hgt |exp(ms)| gain | frame id |latency(ms)| fps | mbps | format
| tof_depth | 43200 | 180 | 240 | 1.20 | 0 | 83 | 10.1 | 6.0 | 2.1 | RAW8
timestamp(ms)| w | h | Zmax | center point (m) (conf)
2469720 | 240 | 180 | 3.1 | 0.0 0.0 0.0 0
As you can see, for SDK 1.5.0, fhe fps is NEVER divided, regardless of the value of standby_enabled.
For SDK 1.6.3, fhe fps is ALWAYS divided, regardless of the value of standby_enabled.
So, my problem is solved but I think you have a bug on the management of the paramater 'standby_enabled'.
I fastly investigate the code of voxl-camera-server and I can't find where you are using 'standby_enabled'. Here is the search result in all the project :
# Query: standby_en
# ContextLines: 2
6 results - 2 files
include/common_defs.h:
370 modal_exposure_msv_config_t ae_msv_info; ///< ModalAI AE data (MSV)
371
372: int standby_enabled; ///< Standby enabled for lidar
373 int decimator; ///< Decimator to use for standby
374
src/config_file.cpp:
129 printf(" gain_min : %d\n", cams[i].ae_msv_info.gain_min);
130 printf(" gain_max : %d\n", cams[i].ae_msv_info.gain_max);
131: printf(" standby_enabled: %d\n", cams[i].standby_enabled);
132 printf(" decimator: %d\n", cams[i].decimator);
133 printf(" independent_exposure:%d\n", cams[i].ind_exp);
642 // standby settings for tof only
643 if(is_tof_sensor(cam->type)) {
644: json_fetch_bool_with_default(item, "standby_enabled", (int*)&cam->standby_enabled, cam->standby_enabled);
645 json_fetch_int_with_default (item, "decimator", &cam->decimator, cam->decimator);
646 }
Maybe you should add a condition in your function PerCameraMgr::ProcessTOFPreviewFrame():
void PerCameraMgr::ProcessTOFPreviewFrame(mpa_ion_buf_t* buffer_info, camera_image_metadata_t meta)
{
tofFrameCounter++;
if(grab_cpu_pitmode_active() && tofFrameCounter % (int)configInfo.decimator != 0){
return;
}
auto noStridePlaneSize = static_cast<size_t>(pre_width*pre_height*1.5);
auto realWidth = static_cast<uint32_t>(pre_width*1.5);
uint8_t* noStridePlane;
if (buffer_info->stride != realWidth) {
noStridePlane = new uint8_t[noStridePlaneSize];
removePlaneStride(buffer_info->stride, realWidth, buffer_info->height,
(uint8_t*) buffer_info->vaddress, noStridePlane);
}
else {
noStridePlane = static_cast<uint8_t*>(buffer_info->vaddress);
}
uint16_t srcPixel16[pre_width * pre_height] = {0};
// NOTE we don't actually puvblish tis particular metadata to the pipe
// TOF data is published separately in a very different way to cameras
meta.format = IMAGE_FORMAT_RAW8;
meta.size_bytes = pre_width * pre_height;
meta.stride = pre_width;
Mipi12ToRaw16(meta.size_bytes, noStridePlane, srcPixel16);
tof_interface->ProcessRAW16(srcPixel16, meta.timestamp_ns);
if (buffer_info->stride != realWidth) {
delete[] noStridePlane;
}
M_VERBOSE("Sent tof data to royale for processing\n");
return;
}
Best regards
Quentin