[fix] compilation of this tag on windows
Some checks failed
Verification / Is-Buildable (push) Failing after 2m4s
Some checks failed
Verification / Is-Buildable (push) Failing after 2m4s
This commit is contained in:
parent
5634773eaf
commit
e9e15a20a2
33
API.md
33
API.md
@ -2,6 +2,10 @@
|
||||
|
||||
The Cloud Point RPC server implements the **JSON-RPC 2.0** protocol over TCP.
|
||||
|
||||
> **NOTE 1:** Base64 encoding of data should be implemented on Unity Side.
|
||||
|
||||
> **NOTE 2:** Unit Tests were not written for the described API yet
|
||||
|
||||
## General Format
|
||||
|
||||
All requests and responses are JSON objects.
|
||||
@ -59,15 +63,11 @@ Retrieves the intrinsic camera parameters as a flat 3x3 matrix (row-major).
|
||||
```json
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": [
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0
|
||||
],
|
||||
"result": <base64-encoded-array>,
|
||||
"id": 1
|
||||
}
|
||||
```
|
||||
*Type: `vector<double>` (size 9)*
|
||||
*Type: `vector<double>` (size 9) encoded as base64*
|
||||
|
||||
### `get-extrinsic-params`
|
||||
|
||||
@ -86,16 +86,11 @@ Retrieves the extrinsic camera parameters as a flat 4x4 matrix (row-major).
|
||||
```json
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": [
|
||||
1.0, 0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0, 0.0,
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
],
|
||||
"result": <base64-encoded-array>,
|
||||
"id": 2
|
||||
}
|
||||
```
|
||||
*Type: `vector<double>` (size 16)*
|
||||
*Type: `vector<double>` (size 16) encoded as base64*
|
||||
|
||||
### `get-cloud-point`
|
||||
|
||||
@ -114,12 +109,12 @@ Retrieves the current field of view point cloud.
|
||||
```json
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": [
|
||||
[0.1, 0.2, 0.3],
|
||||
[1.1, 1.2, 1.3],
|
||||
[5.5, 6.6, 7.7]
|
||||
],
|
||||
"result": {
|
||||
"width": int,
|
||||
"height": int,
|
||||
"data": <base64-encoded-array>
|
||||
},
|
||||
"id": 3
|
||||
}
|
||||
```
|
||||
*Type: `vector<vector<double>>` (List of [x, y, z] points)*
|
||||
*Type of data: `matrix WxH` (List of [x, y, z] points) encoded as base 64*
|
||||
|
||||
@ -6,16 +6,17 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "export.h"
|
||||
namespace score {
|
||||
|
||||
class IRPCCoder {
|
||||
class CRPC_EXPORT IRPCCoder {
|
||||
public:
|
||||
virtual ~IRPCCoder() = default;
|
||||
virtual std::vector<char> decode(const std::string& encoded) = 0;
|
||||
virtual std::string encode(const std::vector<char>& data) = 0;
|
||||
};
|
||||
|
||||
class Base64RPCCoder final : public IRPCCoder {
|
||||
class CRPC_EXPORT Base64RPCCoder final : public IRPCCoder {
|
||||
public:
|
||||
Base64RPCCoder();
|
||||
~Base64RPCCoder() override;
|
||||
@ -22,6 +22,7 @@ if libtype == 'static'
|
||||
glog_opt.add_cmake_defines({
|
||||
'BUILD_SHARED_LIBS': 'OFF',
|
||||
})
|
||||
add_project_arguments('-DBASE64_STATIC_DEFINE', '-DYAML_CPP_STATIC_DEFINE', language: 'cpp')
|
||||
endif
|
||||
|
||||
glog_proj = cmake.subproject('glog', options: glog_opt)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Created by vptyp on 11.03.2026.
|
||||
//
|
||||
#include "cloud_point_rpc/rpc_coder.h"
|
||||
#include "cloud_point_rpc/rpc_coder.hpp"
|
||||
|
||||
#include "libbase64.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include "cloud_point_rpc/config.hpp"
|
||||
#include "cloud_point_rpc/rpc_coder.h"
|
||||
#include "cloud_point_rpc/rpc_coder.hpp"
|
||||
|
||||
|
||||
class Base64Test : public ::testing::Test {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user