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.hppinclude/booster/robot/x5_camera/x5_camera_api.hppinclude/booster/robot/x5_camera/x5_camera_api_const.hpp
Method | Description | Minimum firmware |
|---|---|---|
| Change the X5 camera mode. |
|
| Query the current camera-control status. |
|
CameraSetMode values:
Enum | Value | Meaning |
|---|---|---|
|
| Select normal-resolution mode. |
|
| Select high-resolution mode. |
|
| Enable normal-resolution mode; the mode remains enabled after restart. |
|
| 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 |
|---|---|---|
|
| Request an X5 camera operating-mode change. |
|
| 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.