Skip to main content

Camera Interfaces

Camera interfaces include the general CameraClient and the X5 camera-control client X5CameraClient.

CameraClient​

CameraClient currently provides GetCameras, which returns DeviceInfo. See Device Information Interfaces.

#include <booster/idl/b1/Camera.h>
#include <booster/robot/camera/camera_client.hpp>
#include <booster/robot/channel/channel_factory.hpp>
#include <booster/robot/common/device_info_parser.hpp>

booster::robot::ChannelFactory::Instance()->Init(0, "<network_ip>");

booster::robot::camera::CameraClient camera;
camera.Init();

booster::robot::b1::DeviceInfo info;
if (camera.GetCameras(info) == 0) {
booster_interface::msg::CameraList cameras;
booster::robot::CameraListFromDeviceInfo(cameras, info);
}

X5CameraClient​

Source headers:

  • include/booster/robot/x5_camera/x5_camera_client.hpp
  • include/booster/robot/x5_camera/x5_camera_api.hpp
  • include/booster/robot/x5_camera/x5_camera_api_const.hpp

Method

Description

Minimum firmware

ChangeMode(mode)

Change the X5 camera mode.

>= v1.5.0.9

GetStatus(response)

Query the current camera-control status.

>= v1.5.0.9

CameraSetMode values:

Enum

Value

Meaning

kCameraModeNormal

0

Select normal-resolution mode.

kCameraModeHighResolution

1

Select high-resolution mode.

kCameraModeNormalEnable

2

Enable normal-resolution mode; the mode remains enabled after restart.

kCameraModeHighResolutionEnable

3

Enable high-resolution mode; the mode remains enabled after restart.

CameraControlStatus values returned by GetStatus are kCameraStatusNormal = 0, kCameraStatusHighResolution = 1, kCameraStatusError = 2, and kCameraStatusNull = 3.

C++ Example​

#include <booster/robot/x5_camera/x5_camera_client.hpp>

booster::robot::x5_camera::X5CameraClient x5;
x5.Init();

x5.ChangeMode(
booster::robot::x5_camera::CameraSetMode::kCameraModeHighResolution);

booster::robot::x5_camera::GetStatusResponse status;
if (x5.GetStatus(status) == 0) {
const auto current_status = status.status_;
}

API Enums and Response Fields​

CameraApiId has one public business ID: kGetCameras = 3100, which queries the robot camera catalog. CameraClient::SendApiRequest is intended for protocol diagnostics; normal application code should use GetCameras(info). On success, info.kind_ is DeviceInfoKind::kCamera and info.json_ contains the service cameras array.

X5CameraApiId:

Enumerator

Value

Meaning

kChangeMode

5001

Request an X5 camera operating-mode change.

kGetStatus

5002

Query the X5 camera controller status.

CameraSetMode values are kCameraModeNormal = 0 (normal-resolution switch), kCameraModeHighResolution = 1 (high-resolution switch), kCameraModeNormalEnable = 2 (enable and persist normal mode), and kCameraModeHighResolutionEnable = 3 (enable and persist high-resolution mode). CameraControlStatus values kCameraStatusNormal = 0, kCameraStatusHighResolution = 1, kCameraStatusError = 2, and kCameraStatusNull = 3 mean normal, high-resolution, controller error, and unavailable.

ChangeModeParameter::mode_ stores the requested mode; GetStatusResponse::status_ stores the current status. X5 availability depends on compatible K1/T2 camera editions; T1 profiles should use the standard camera service.