a/vive: Constify config argument to get functions [NFC]

This commit is contained in:
Jakob Bornecrantz 2023-04-22 22:13:04 +01:00
parent 5e0b21cd18
commit b93ed31cce
2 changed files with 10 additions and 10 deletions

View file

@ -37,11 +37,11 @@ DEBUG_GET_ONCE_BOOL_OPTION(vive_use_factory_rotations, "VIVE_USE_FACTORY_ROTATIO
*/
static struct t_camera_calibration
vive_get_camera_calibration(struct vive_config *d, int cam_index)
vive_get_camera_calibration(const struct vive_config *d, int cam_index)
{
struct t_camera_calibration calib;
struct index_camera *camera = &d->cameras.view[cam_index];
const struct index_camera *camera = &d->cameras.view[cam_index];
calib.image_size_pixels.w = camera->intrinsics.image_size_pixels.w;
calib.image_size_pixels.h = camera->intrinsics.image_size_pixels.h;
@ -74,7 +74,7 @@ vive_get_camera_calibration(struct vive_config *d, int cam_index)
*/
bool
vive_get_stereo_camera_calibration(struct vive_config *d,
vive_get_stereo_camera_calibration(const struct vive_config *d,
struct t_stereo_camera_calibration **calibration_ptr_to_ref,
struct xrt_pose *out_head_in_left_camera)
{
@ -126,7 +126,7 @@ vive_get_stereo_camera_calibration(struct vive_config *d,
//! Camera calibrations for SLAM
void
vive_get_slam_cams_calib(struct vive_config *d,
vive_get_slam_cams_calib(const struct vive_config *d,
struct t_slam_camera_calibration *out_calib0,
struct t_slam_camera_calibration *out_calib1)
{
@ -229,7 +229,7 @@ vive_get_slam_cams_calib(struct vive_config *d,
}
struct t_imu_calibration
vive_get_imu_calibration(struct vive_config *d)
vive_get_imu_calibration(const struct vive_config *d)
{
struct xrt_vec3 ab = d->imu.acc_bias;
@ -257,7 +257,7 @@ vive_get_imu_calibration(struct vive_config *d)
}
struct t_slam_imu_calibration
vive_get_slam_imu_calibration(struct vive_config *d)
vive_get_slam_imu_calibration(const struct vive_config *d)
{
struct t_slam_imu_calibration calib;
const int IMU_FREQUENCY = 1000;

View file

@ -27,7 +27,7 @@ struct vive_config;
* @ingroup drv_vive
*/
bool
vive_get_stereo_camera_calibration(struct vive_config *d,
vive_get_stereo_camera_calibration(const struct vive_config *d,
struct t_stereo_camera_calibration **calibration_ptr_to_ref,
struct xrt_pose *out_head_in_left_camera);
@ -37,7 +37,7 @@ vive_get_stereo_camera_calibration(struct vive_config *d,
* @ingroup drv_vive
*/
void
vive_get_slam_cams_calib(struct vive_config *d,
vive_get_slam_cams_calib(const struct vive_config *d,
struct t_slam_camera_calibration *out_calib0,
struct t_slam_camera_calibration *out_calib1);
@ -47,7 +47,7 @@ vive_get_slam_cams_calib(struct vive_config *d,
* @ingroup drv_vive
*/
struct t_imu_calibration
vive_get_imu_calibration(struct vive_config *d);
vive_get_imu_calibration(const struct vive_config *d);
/*!
* Get a @ref t_slam_imu_calibration for the IMU.
@ -55,7 +55,7 @@ vive_get_imu_calibration(struct vive_config *d);
* @ingroup drv_vive
*/
struct t_slam_imu_calibration
vive_get_slam_imu_calibration(struct vive_config *d);
vive_get_slam_imu_calibration(const struct vive_config *d);
#ifdef __cplusplus