misc: Improve wmr and euroc docs, fix ht memory leak, stride for cv::Mats

This commit is contained in:
Mateo de Mayo 2021-12-06 08:34:22 -03:00
parent cd0342c8dc
commit fe4f6c6eb0
8 changed files with 18 additions and 18 deletions

View file

@ -114,7 +114,7 @@ euroc_recorder_save_frame(euroc_recorder *er, struct xrt_frame *frame, bool is_l
assert(frame->format == XRT_FORMAT_L8 || frame->format == XRT_FORMAT_R8G8B8); // Only formats supported
auto img_type = frame->format == XRT_FORMAT_L8 ? CV_8UC1 : CV_8UC3;
string img_path = path + "/mav0/" + cam_name + "/data/" + std::to_string(ts) + ".png";
cv::Mat img{(int)frame->height, (int)frame->width, img_type, frame->data};
cv::Mat img{(int)frame->height, (int)frame->width, img_type, frame->data, frame->stride};
cv::imwrite(img_path, img);
}

View file

@ -100,7 +100,7 @@ public:
auto img_type = frame->format == XRT_FORMAT_L8 ? CV_8UC1 : CV_8UC3;
// Wrap the frame data into a cv::Mat header
cv::Mat img{(int)frame->height, (int)frame->width, img_type, frame->data};
cv::Mat img{(int)frame->height, (int)frame->width, img_type, frame->data, frame->stride};
// Enable reference counting for a user-allocated cv::Mat (i.e., using existing frame->data)
img.u = this->allocate(img.dims, img.size.p, img.type(), img.data, img.step.p, ACCESS_RW,

View file

@ -44,7 +44,6 @@ enum euroc_player_ui_state
*
* @implements xrt_fs
* @implements xrt_frame_node
* @implements xrt_imu_sink
*/
struct euroc_player
{

View file

@ -263,7 +263,9 @@ getUserConfig(struct ht_device *htd)
u_json_get_bool(u_json_get(dynamic_config_obj, "scribble_bounding_box"),
&hdc->scribble_bounding_box);
U_LOG_E("Hey %s %s", dynamic_config_string, cJSON_Print(dynamic_config_obj));
char *dco_str = cJSON_Print(dynamic_config_obj);
U_LOG_D("Config %s %s", dynamic_config_string, dco_str);
free(dco_str);
}
}

View file

@ -20,7 +20,7 @@ extern "C" {
/*!
* Defines for the WMR driver.
*
* @ingroup drv_wmr
* @addtogroup drv_wmr
* @{
*/

View file

@ -21,7 +21,7 @@ extern "C" {
/*!
* WMR Motion Controller protocol constant and structures
*
* @ingroup drv_wmr
* @addtogroup drv_wmr
* @{
*/
@ -75,7 +75,7 @@ struct wmr_controller_input
/*!
* WMR Motion Controller protocol helpers
*
* @ingroup drv_wmr
* @addtogroup drv_wmr
* @{
*/

View file

@ -43,9 +43,9 @@ struct wmr_headset_descriptor
{
enum wmr_headset_type hmd_type;
/* String by which we recognise the device */
//! String by which we recognise the device
const char *dev_id_str;
/* Friendly ID string for debug */
//! Friendly ID string for debug
const char *debug_name;
int (*init_func)(struct wmr_hmd *wh);
@ -54,12 +54,11 @@ struct wmr_headset_descriptor
struct wmr_hmd_distortion_params
{
/* Inverse affine transform to move from (undistorted) pixels
* to image plane / normalised image coordinates
*/
//! Inverse affine transform to move from (undistorted) pixels
//! to image plane / normalised image coordinates
struct xrt_matrix_3x3 inv_affine_xform;
/* tan(angle) FoV min/max for X and Y in the input texture */
//! tan(angle) FoV min/max for X and Y in the input texture
struct xrt_vec2 tex_x_range;
struct xrt_vec2 tex_y_range;
};
@ -73,10 +72,10 @@ struct wmr_hmd
const struct wmr_headset_descriptor *hmd_desc;
/* firmware configuration block, with device names etc */
//! firmware configuration block, with device names etc
struct wmr_config_header config_hdr;
/* Config data parsed from the firmware JSON */
//! Config data parsed from the firmware JSON
struct wmr_hmd_config config;
//! Packet reading thread.
@ -102,7 +101,7 @@ struct wmr_hmd
//! Latest proximity sensor value from the device.
uint8_t proximity_sensor;
/* Distortion related parameters */
//! Distortion related parameters
struct wmr_hmd_distortion_params distortion_params[2];
// Config-derived poses

View file

@ -23,7 +23,7 @@ extern "C" {
/*!
* WMR and MS HoloLens Sensors protocol constants and structures
*
* @ingroup drv_wmr
* @addtogroup drv_wmr
* @{
*/
@ -90,7 +90,7 @@ struct wmr_config_header
/*!
* WMR and MS HoloLens Sensors protocol helpers
*
* @ingroup drv_wmr
* @addtogroup drv_wmr
* @{
*/