Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The official Spot SDK documentation also contains information relevant to the C+
- [Payload developer documentation](https://dev.bostondynamics.com/docs/payload/readme). Payloads add additional sensing, communication, and control capabilities beyond what the base platform provides. The Payload ICD covers the mechanical, electrical, and software interfaces that Spot supports.
- [Spot API protocol definition](https://dev.bostondynamics.com/docs/protos/readme). This reference guide covers the details of the protocol applications used to communicate to Spot. Application developers who wish to use a language other than Python can implement clients that speak the protocol.

This is version 5.0.1 of the C++ SDK. Please review the [Release Notes](docs/cpp_release_notes.md) to see what has changed.
This is version 5.1.0 of the C++ SDK. Please review the [Release Notes](docs/cpp_release_notes.md) to see what has changed.

## Contents

Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# This file is autogenerated.

cmake_minimum_required (VERSION 3.10.2)
project (bosdyn VERSION 5.0.1)
project (bosdyn VERSION 5.1.0)

# Dependencies:
find_package(Protobuf REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions cpp/bosdyn/client/data_buffer/signal_schema_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#pragma once

#include <stdint.h>
#include <string>

namespace bosdyn {
Expand Down
8 changes: 7 additions & 1 deletion cpp/bosdyn/client/data_chunk/data_chunking.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#pragma once

#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
#include "bosdyn/client/error_codes/sdk_error_code.h"
#include "bosdyn/client/service_client/result.h"

Expand Down Expand Up @@ -42,8 +44,12 @@ Result<T> MessageFromDataChunks(const std::vector<const ::bosdyn::api::DataChunk
return {result.status, {}};
}

google::protobuf::io::ArrayInputStream array_input(result.response.data(),
result.response.size());
google::protobuf::io::CodedInputStream coded_input(&array_input);
coded_input.SetRecursionLimit(500);
T output;
if (!output.ParseFromString(result.response)) {
if (!output.ParseFromCodedStream(&coded_input)) {
return {::bosdyn::common::Status(SDKErrorCode::GenericSDKError,
"Could not deserialize concatenated chunks into message"),
{}};
Expand Down
122 changes: 43 additions & 79 deletions cpp/bosdyn/client/error_codes/proto_enum_to_stderror_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,84 +13,48 @@
#include <system_error>

// This macro goes in some helper file.
#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ns, ns_def, ns_def_parenthesis) \
namespace std { \
template <> \
struct is_error_code_enum<ns::enumclass> : public true_type {}; \
} \
ns_def std::error_code make_error_code(ns::enumclass); \
ns_def_parenthesis
#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ns) \
namespace std { \
template <> \
struct is_error_code_enum<::ns::enumclass> : public true_type {}; \
} \
namespace ns { \
std::error_code make_error_code(::ns::enumclass); \
}

// Define wrapper for macro above for each namespace, so it is easier to call the macro
#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_API(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api, \
namespace bosdyn{namespace api{ \
, \
}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_AUTO_RETURN(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::auto_return, \
namespace bosdyn{namespace api{namespace auto_return{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_AUTOWALK(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::autowalk, \
namespace bosdyn{namespace api{namespace autowalk{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_KEEPALIVE(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::keepalive, \
namespace bosdyn{namespace api{namespace keepalive{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_LOG_STATUS(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::log_status, \
namespace bosdyn{namespace api{namespace log_status{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_SPOT(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::spot, \
namespace bosdyn{namespace api{namespace spot{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_MISSION(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::mission, \
namespace bosdyn{namespace api{namespace mission{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_GRAPHNAV(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::graph_nav, \
namespace bosdyn{namespace api{namespace graph_nav{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_METRICS(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::metrics_logging, \
namespace bosdyn{namespace api{namespace metrics_logging{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_INTERNAL(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::internal, \
namespace bosdyn{namespace api{namespace internal{ \
, \
}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_LOCALNAV(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER( \
enumclass, ::bosdyn::api::internal::localnav, \
namespace bosdyn{namespace api{namespace internal{namespace localnav{ \
, \
}}}})

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_DOCKING(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, ::bosdyn::api::docking, \
namespace bosdyn{namespace api{namespace docking{ \
, \
}}})
#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_API(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_AUTO_RETURN(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::auto_return)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_AUTOWALK(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::autowalk)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_KEEPALIVE(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::keepalive)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_LOG_STATUS(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::log_status)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_SPOT(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::spot)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_MISSION(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::mission)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_GRAPHNAV(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::graph_nav)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_METRICS(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::metrics_logging)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_INTERNAL(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::internal)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_LOCALNAV(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::internal::localnav)

#define DEFINE_PROTO_ENUM_ERRORCODE_HEADER_DOCKING(enumclass) \
DEFINE_PROTO_ENUM_ERRORCODE_HEADER(enumclass, bosdyn::api::docking)
Loading