13 #include <type_traits>
21 namespace rp {
namespace standalone {
namespace aurora {
65 SDKConnectionInfo& operator=(
const SDKConnectionInfo& other) {
66 memcpy(
this, &other,
sizeof(SDKConnectionInfo));
84 return std::string(buffer);
97 uint16_t tport = SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PORT;
99 std::string inputWrapper = input;
101 size_t protocol_pos = inputWrapper.find(
'/');
102 if (protocol_pos != std::string::npos) {
103 protocol = inputWrapper.substr(0, protocol_pos);
106 protocol = SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PROTOCOL;
110 size_t port_pos = inputWrapper.rfind(
':');
111 if (port_pos != std::string::npos) {
112 ip = inputWrapper.substr(protocol_pos + 1, port_pos - protocol_pos - 1);
113 auto&& portStr = inputWrapper.substr(port_pos + 1);
114 tport = (uint16_t)std::stoi(portStr);
117 ip = inputWrapper.substr(protocol_pos + 1);
156 SDKServerConnectionDesc(
const std::vector<SDKConnectionInfo>& src) {
158 for (
auto&& info : src) {
170 SDKServerConnectionDesc(
const char* ip,
int port = SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PORT,
const char* proto = SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PROTOCOL)
187 std::vector<SDKConnectionInfo> result;
196 for (
auto&& info : src) {
285 : _desc(desc),
_data(data)
308 template <
typename T>
309 typename std::enable_if<std::is_same<T, cv::Mat>::value,
bool>::type
342 , _keypoints_left(_keypoints_buffer_left.data())
343 , _keypoints_right(_keypoints_buffer_rightf.data())
356 ,
leftImage(info.left_image_desc, buffer.imgdata_left)
357 ,
rightImage(info.right_image_desc, buffer.imgdata_right)
358 , _keypoints_left(buffer.keypoints_left)
359 , _keypoints_right(buffer.keypoints_right)
374 std::vector<uint8_t>&& imgbuffer_left,
375 std::vector<uint8_t>&& imgbuffer_right,
376 std::vector< slamtec_aurora_sdk_keypoint_t>&& keypoints_buffer_left,
377 std::vector< slamtec_aurora_sdk_keypoint_t>&& keypoints_buffer_right)
379 ,
leftImage(info.left_image_desc, imgbuffer_left.data())
380 ,
rightImage(info.right_image_desc, imgbuffer_right.data())
381 , _keypoints_left(keypoints_buffer_left.data())
382 , _keypoints_right(keypoints_buffer_right.data())
383 , _imgbuffer_left(std::move(imgbuffer_left))
384 , _imgbuffer_right(std::move(imgbuffer_right))
385 , _keypoints_buffer_left(std::move(keypoints_buffer_left))
386 , _keypoints_buffer_rightf(std::move(keypoints_buffer_right))
393 , _keypoints_left(nullptr)
394 , _keypoints_right(nullptr)
399 RemoteTrackingFrameInfo(RemoteTrackingFrameInfo&& other)
403 , _keypoints_left(nullptr)
404 , _keypoints_right(nullptr)
406 if (!other._isOwnBuffer()) {
415 RemoteTrackingFrameInfo& operator=(
const RemoteTrackingFrameInfo& other) {
421 RemoteTrackingFrameInfo& operator=(RemoteTrackingFrameInfo&& other) {
423 if (!other._isOwnBuffer()) {
438 return _keypoints_left;
447 return _keypoints_right;
487 bool _isOwnBuffer()
const {
488 return (_keypoints_left == _keypoints_buffer_left.data());
492 _imgbuffer_left = std::move(other._imgbuffer_left);
493 _imgbuffer_right = std::move(other._imgbuffer_right);
494 _keypoints_buffer_left = std::move(other._keypoints_buffer_left);
495 _keypoints_buffer_rightf = std::move(other._keypoints_buffer_rightf);
499 _keypoints_left = _keypoints_buffer_left.data();
500 _keypoints_right = _keypoints_buffer_rightf.data();
504 void _copyFrom(
const RemoteTrackingFrameInfo& other) {
505 if (other.leftImage._data) {
506 _imgbuffer_left.resize(other.trackingInfo.left_image_desc.data_size);
507 memcpy(_imgbuffer_left.data(), other.leftImage._data, other.trackingInfo.left_image_desc.data_size);
512 _imgbuffer_left.clear();
515 if (other.rightImage._data) {
516 _imgbuffer_right.resize(other.trackingInfo.right_image_desc.data_size);
517 memcpy(_imgbuffer_right.data(), other.rightImage._data, other.trackingInfo.right_image_desc.data_size);
522 _imgbuffer_right.clear();
525 if (other._keypoints_left) {
526 _keypoints_buffer_left.resize(other.trackingInfo.keypoints_left_count);
527 memcpy(_keypoints_buffer_left.data(), other._keypoints_left, other.trackingInfo.keypoints_left_count *
sizeof(
slamtec_aurora_sdk_keypoint_t));
528 _keypoints_left = _keypoints_buffer_left.data();
531 _keypoints_left =
nullptr;
532 _keypoints_buffer_left.clear();
535 if (other._keypoints_right) {
536 _keypoints_buffer_rightf.resize(other.trackingInfo.keypoints_right_count);
537 memcpy(_keypoints_buffer_rightf.data(), other._keypoints_right, other.trackingInfo.keypoints_right_count *
sizeof(
slamtec_aurora_sdk_keypoint_t));
538 _keypoints_right = _keypoints_buffer_rightf.data();
541 _keypoints_right =
nullptr;
542 _keypoints_buffer_rightf.clear();
551 std::vector<uint8_t> _imgbuffer_left;
552 std::vector<uint8_t> _imgbuffer_right;
553 std::vector< slamtec_aurora_sdk_keypoint_t> _keypoints_buffer_left;
554 std::vector< slamtec_aurora_sdk_keypoint_t> _keypoints_buffer_rightf;
658 std::vector< slamtec_aurora_sdk_lidar_scan_point_t>
scanData;
697 this->
resolution = SLAMTEC_AURORA_SDK_LIDAR_2D_GRIDMAP_DEFAULT_RESOLUTION;
The floor detection histogram class wraps the floor detection histogram data and its description.
Definition: slamtec_remote_objects.hxx:732
slamtec_aurora_sdk_floor_detection_histogram_info_t info
The floor detection histogram info.
Definition: slamtec_remote_objects.hxx:760
std::vector< float > histogramData
The floor detection histogram data.
Definition: slamtec_remote_objects.hxx:765
The 2D gridmap generation options class wraps the 2D gridmap generation options.
Definition: slamtec_remote_objects.hxx:667
void loadDefaults()
Load the default 2D gridmap generation options.
Definition: slamtec_remote_objects.hxx:696
void clearHeightRange()
Clear the height range for the 2D gridmap generation.
Definition: slamtec_remote_objects.hxx:718
void setHeightRange(float minHeight, float maxHeight)
Set the height range for the 2D gridmap generation.
Definition: slamtec_remote_objects.hxx:709
Definition: slamtec_remote_objects.hxx:24
The image reference class wraps the image description and data.
Definition: slamtec_remote_objects.hxx:281
const void * _data
The data pointer of the image.
Definition: slamtec_remote_objects.hxx:292
std::enable_if< std::is_same< T, cv::Mat >::value, bool >::type toMat(T &mat) const
Convert the image to a cv::Mat object.
Definition: slamtec_remote_objects.hxx:310
The keyframe data class wraps the keyframe description and its data.
Definition: slamtec_remote_objects.hxx:563
std::vector< uint64_t > loopedKeyFrameIDs
The looped keyframe IDs.
Definition: slamtec_remote_objects.hxx:611
slamtec_aurora_sdk_keyframe_desc_t desc
The keyframe description.
Definition: slamtec_remote_objects.hxx:606
std::vector< uint64_t > connectedKeyFrameIDs
The connected keyframe IDs.
Definition: slamtec_remote_objects.hxx:616
The tracking frame info class wraps the tracking information and its data.
Definition: slamtec_remote_objects.hxx:337
size_t getKeypointsRightCount() const
Get the right keypoints count.
Definition: slamtec_remote_objects.hxx:464
const slamtec_aurora_sdk_keypoint_t * getKeypointsRightBuffer() const
Get the right keypoints buffer.
Definition: slamtec_remote_objects.hxx:446
RemoteTrackingFrameInfo(const slamtec_aurora_sdk_tracking_info_t &info, const slamtec_aurora_sdk_tracking_data_buffer_t &buffer)
Create the tracking frame info with the tracking information and the tracking data buffer.
Definition: slamtec_remote_objects.hxx:354
RemoteImageRef leftImage
The left image reference.
Definition: slamtec_remote_objects.hxx:474
RemoteTrackingFrameInfo(const slamtec_aurora_sdk_tracking_info_t &info, std::vector< uint8_t > &&imgbuffer_left, std::vector< uint8_t > &&imgbuffer_right, std::vector< slamtec_aurora_sdk_keypoint_t > &&keypoints_buffer_left, std::vector< slamtec_aurora_sdk_keypoint_t > &&keypoints_buffer_right)
Create the tracking frame info with the tracking information and the image data buffer.
Definition: slamtec_remote_objects.hxx:373
const slamtec_aurora_sdk_keypoint_t * getKeypointsLeftBuffer() const
Get the left keypoints buffer.
Definition: slamtec_remote_objects.hxx:437
slamtec_aurora_sdk_tracking_info_t trackingInfo
The tracking information.
Definition: slamtec_remote_objects.hxx:484
RemoteImageRef rightImage
The right image reference.
Definition: slamtec_remote_objects.hxx:479
size_t getKeypointsLeftCount() const
Get the left keypoints count.
Definition: slamtec_remote_objects.hxx:455
The connection info class.
Definition: slamtec_remote_objects.hxx:42
SDKConnectionInfo(const char *ip, int port=SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PORT, const char *proto=SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PROTOCOL)
The constructor with IP address, port and protocol.
Definition: slamtec_remote_objects.hxx:55
std::string toLocatorString() const
Convert the connection info to a locator string.
Definition: slamtec_remote_objects.hxx:81
bool fromLocatorString(const char *input)
Parse the connection info from a locator string.
Definition: slamtec_remote_objects.hxx:94
The server connection description class.
Definition: slamtec_remote_objects.hxx:135
const SDKConnectionInfo & at(size_t index) const
Get the connection info at the specified index.
Definition: slamtec_remote_objects.hxx:269
SDKServerConnectionDesc(const char *ip, int port=SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PORT, const char *proto=SLAMTEC_AURORA_SDK_REMOTE_SERVER_DEFAULT_PROTOCOL)
Create the server connection description with one connection option with IP address,...
Definition: slamtec_remote_objects.hxx:170
size_t size() const
Get the count of the server connection description.
Definition: slamtec_remote_objects.hxx:207
void clear()
Clear the connection description.
Definition: slamtec_remote_objects.hxx:224
size_t capacity() const
Get the capacity of the connection description this object can hold.
Definition: slamtec_remote_objects.hxx:216
std::vector< SDKConnectionInfo > toVector() const
Convert the server connection description to a vector of connection info.
Definition: slamtec_remote_objects.hxx:186
SDKServerConnectionDesc(const slamtec_aurora_sdk_server_connection_info_t &info)
Create the server connection description with a server connection info structure.
Definition: slamtec_remote_objects.hxx:146
void pop_back()
Pop a connection info from the server connection description.
Definition: slamtec_remote_objects.hxx:247
const SDKConnectionInfo & operator[](size_t index) const
Get the connection info at the specified index.
Definition: slamtec_remote_objects.hxx:259
bool push_back(const slamtec_aurora_sdk_connection_info_t &info)
Push a connection info to the server connection description.
Definition: slamtec_remote_objects.hxx:234
The single layer LIDAR scan data class wraps the LIDAR scan data and its description.
Definition: slamtec_remote_objects.hxx:625
slamtec_aurora_sdk_lidar_singlelayer_scandata_info_t info
The LIDAR scan data info.
Definition: slamtec_remote_objects.hxx:653
std::vector< slamtec_aurora_sdk_lidar_scan_point_t > scanData
The LIDAR scan data.
Definition: slamtec_remote_objects.hxx:658
struct _slamtec_aurora_sdk_connection_info_t slamtec_aurora_sdk_connection_info_t
The connection info structure.
struct _slamtec_aurora_sdk_server_connection_info_t slamtec_aurora_sdk_server_connection_info_t
The server connection info structure.
The 2D gridmap generation options structure.
Definition: aurora_pubsdk_objects.h:883
float min_height
The minimum height of LIDAR scan pose to be included in the gridmap.
Definition: aurora_pubsdk_objects.h:908
int active_map_only
Whether to generate the active map only.
Definition: aurora_pubsdk_objects.h:899
float map_canvas_height
The height of the gridmap canvas.
Definition: aurora_pubsdk_objects.h:895
float map_canvas_width
The width of the gridmap canvas.
Definition: aurora_pubsdk_objects.h:891
float resolution
The resolution of the gridmap.
Definition: aurora_pubsdk_objects.h:887
float max_height
The maximum height of LIDAR scan pose to be included in the gridmap.
Definition: aurora_pubsdk_objects.h:912
int height_range_specified
Whether the height range is specified.
Definition: aurora_pubsdk_objects.h:904
The connection info structure.
Definition: aurora_pubsdk_objects.h:114
uint16_t port
The port.
Definition: aurora_pubsdk_objects.h:135
char address[64]
The address.
Definition: aurora_pubsdk_objects.h:128
char protocol_type[16]
The protocol type.
Definition: aurora_pubsdk_objects.h:121
The floor detection histogram info structure.
Definition: aurora_pubsdk_objects.h:976
The image description structure.
Definition: aurora_pubsdk_objects.h:517
uint32_t width
The width of the image.
Definition: aurora_pubsdk_objects.h:522
uint32_t stride
The stride of the image.
Definition: aurora_pubsdk_objects.h:532
uint32_t format
The format of the image.
Definition: aurora_pubsdk_objects.h:538
uint32_t height
The height of the image.
Definition: aurora_pubsdk_objects.h:527
The keyframe description structure.
Definition: aurora_pubsdk_objects.h:1158
size_t connected_frame_count
The count of the connected frames.
Definition: aurora_pubsdk_objects.h:1190
size_t looped_frame_count
The count of the looped frames.
Definition: aurora_pubsdk_objects.h:1186
The keypoint structure.
Definition: aurora_pubsdk_objects.h:552
The single layer LIDAR scan data header structure.
Definition: aurora_pubsdk_objects.h:798
The server connection info structure.
Definition: aurora_pubsdk_objects.h:145
uint32_t connection_count
The number of connection methods.
Definition: aurora_pubsdk_objects.h:164
slamtec_aurora_sdk_connection_info_t connection_info[8]
The connection methods.
Definition: aurora_pubsdk_objects.h:158
The tracking data buffer structure.
Definition: aurora_pubsdk_objects.h:578
The tracking info structure.
Definition: aurora_pubsdk_objects.h:659
uint32_t keypoints_left_count
The count of the keypoints of the left image.
Definition: aurora_pubsdk_objects.h:698
slamtec_aurora_sdk_image_desc_t left_image_desc
The description of the left image.
Definition: aurora_pubsdk_objects.h:670
slamtec_aurora_sdk_image_desc_t right_image_desc
The description of the right image.
Definition: aurora_pubsdk_objects.h:675
uint32_t keypoints_right_count
The count of the keypoints of the right image.
Definition: aurora_pubsdk_objects.h:703