|
Monado OpenXR Runtime
|
WMR camera interface. More...
#include "math/m_api.h"#include "os/os_threading.h"#include "xrt/xrt_byte_order.h"#include "util/u_autoexpgain.h"#include "util/u_debug.h"#include "util/u_var.h"#include "util/u_sink.h"#include "util/u_frame.h"#include "util/u_trace_marker.h"#include "wmr_config.h"#include "wmr_protocol.h"#include "wmr_camera.h"#include <libusb.h>#include <stdlib.h>#include <assert.h>
Data Structures | |
| struct | wmr_camera_active_cmd |
| struct | wmr_camera_gain_cmd |
| struct | wmr_camera |
| struct | wmr_camera::wmr_camera_expgain |
Macros | |
| #define | WMR_CAM_TRACE(c, ...) U_LOG_IFL_T((c)->log_level, __VA_ARGS__) |
| #define | WMR_CAM_DEBUG(c, ...) U_LOG_IFL_D((c)->log_level, __VA_ARGS__) |
| #define | WMR_CAM_INFO(c, ...) U_LOG_IFL_I((c)->log_level, __VA_ARGS__) |
| #define | WMR_CAM_WARN(c, ...) U_LOG_IFL_W((c)->log_level, __VA_ARGS__) |
| #define | WMR_CAM_ERROR(c, ...) U_LOG_IFL_E((c)->log_level, __VA_ARGS__) |
| #define | CAM_ENDPOINT 0x05 |
| #define | NUM_XFERS 9 |
| #define | WMR_CAMERA_CMD_GAIN 0x80 |
| #define | WMR_CAMERA_CMD_ON 0x81 |
| #define | WMR_CAMERA_CMD_OFF 0x82 |
| #define | DEFAULT_EXPOSURE 6000 |
| #define | DEFAULT_GAIN 127 |
| #define | WMR_FRAMETYPE_SLAM 0x0 |
| #define | WMR_FRAMETYPE_CONTROLLER 0x2 |
| #define | WMR_DEBUG_SINK_SLAM 0 |
| #define | WMR_DEBUG_SINK_CONTROLLER 1 |
Functions | |
| static int | update_expgain (struct wmr_camera *cam, struct xrt_frame **frames) |
| Specifies whether the user wants to enable autoexposure from the start. | |
| struct wmr_camera_active_cmd | __attribute__ ((packed)) |
| static bool | compute_frame_size (struct wmr_camera *cam) |
| static void * | wmr_cam_usb_thread (void *ptr) |
| static int | send_buffer_to_device (struct wmr_camera *cam, uint8_t *buf, uint8_t len) |
| static int | set_active (struct wmr_camera *cam, bool active) |
| static void LIBUSB_CALL | img_xfer_cb (struct libusb_transfer *xfer) |
| struct wmr_camera * | wmr_camera_open (struct wmr_camera_open_config *config) |
| void | wmr_camera_free (struct wmr_camera *cam) |
| bool | wmr_camera_start (struct wmr_camera *cam) |
| Starts the cameras. | |
| bool | wmr_camera_stop (struct wmr_camera *cam) |
| int | wmr_camera_set_exposure_gain (struct wmr_camera *cam, uint8_t camera_id, uint16_t exposure, uint8_t gain) |
| Set manual exposure and gain values. | |
Variables | |
| __le32 | magic |
| __le32 | len |
| __le32 | cmd |
| __le16 | camera_id |
| __le16 | exposure |
| observed 60 to 6000 (but supports up to ~9000) | |
| __le16 | gain |
| observed 16 to 255 | |
| __le16 | camera_id2 |
| same as camera_id | |
| struct wmr_camera | __attribute__ |
WMR camera interface.
|
static |
Specifies whether the user wants to enable autoexposure from the start.
Specifies whether the user wants to use the same exp/gain values for all cameras
References wmr_camera::ceg, wmr_camera::tcam_confs, wmr_camera::tcam_count, u_autoexpgain_get_exposure(), u_autoexpgain_get_gain(), u_autoexpgain_update(), wmr_camera::unify_expgains, and wmr_camera_set_exposure_gain().
Referenced by wmr_camera_start().
|
static |
| int wmr_camera_set_exposure_gain | ( | struct wmr_camera * | cam, |
| uint8_t | camera_id, | ||
| uint16_t | exposure, | ||
| uint8_t | gain | ||
| ) |
Set manual exposure and gain values.
| cam | Camera container |
| camera_id | Which camera to affect |
| exposure | Time the shutter is open, observed values 60-6000. |
| gain | Amplification of the analog signal, observed values: 16-255. |
References exposure, and gain.
Referenced by update_expgain().
| bool wmr_camera_start | ( | struct wmr_camera * | cam | ) |
Starts the cameras.
References update_expgain().
| __le16 camera_id2 |
same as camera_id
| __le16 exposure |
observed 60 to 6000 (but supports up to ~9000)
Referenced by brightness_to_expgain(), and wmr_camera_set_exposure_gain().
| __le16 gain |
observed 16 to 255
Referenced by brightness_to_expgain(), and wmr_camera_set_exposure_gain().