Skip to content

Commit c8649f4

Browse files
Merge branch 'boston-dynamics:master' into master
2 parents 1789a26 + b4682d9 commit c8649f4

File tree

250 files changed

+4839
-3526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+4839
-3526
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ is subject to the terms and conditions of the Boston Dynamics Software
66
Development Kit License (20191101-BDSDK-SL).
77
-->
88

9-
# Spot C++ SDK (BETA)
9+
# Spot C++ SDK (BETA)
1010

1111
Develop applications and payloads for Spot using the Boston Dynamics Spot C++ SDK. The Spot C++ SDK is a **beta** release.
1212

1313
The C++ SDK consists of:
14-
* [C++ client library](docs/cpp/README.md). Applications using the C++ library can control Spot and read sensor and health information from Spot. A variety of example programs and a QuickStart guide are also included.
15-
* [Spot C++ SDK Repository](https://github.com/boston-dynamics/spot-cpp-sdk). The GitHub repo where all of the Spot C++ SDK code is hosted.
14+
15+
- [C++ client library](docs/cpp/README.md). Applications using the C++ library can control Spot and read sensor and health information from Spot. A variety of example programs and a QuickStart guide are also included.
16+
- [Spot C++ SDK Repository](https://github.com/boston-dynamics/spot-cpp-sdk). The GitHub repo where all of the Spot C++ SDK code is hosted.
1617

1718
The official Spot SDK documentation also contains information relevant to the C++ SDK:
18-
* [Conceptual documentation](https://dev.bostondynamics.com/docs/concepts/readme). These documents explain the key abstractions used by the Spot API.
19-
* [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.
20-
* [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.
2119

22-
This is version 4.0.2 of the C++ SDK. Please review the [Release Notes](docs/cpp_release_notes.md) to see what has changed.
20+
- [Conceptual documentation](https://dev.bostondynamics.com/docs/concepts/readme). These documents explain the key abstractions used by the Spot API.
21+
- [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.
22+
- [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.
23+
24+
This is version 4.1.0 of the C++ SDK. Please review the [Release Notes](docs/cpp_release_notes.md) to see what has changed.
2325

2426
## Contents
2527

26-
* [C++ Library](docs/cpp/README.md)
27-
* [Release Notes](docs/cpp_release_notes.md)
28-
* [SDK Repository](https://github.com/boston-dynamics/spot-cpp-sdk)
28+
- [C++ Library](docs/cpp/README.md)
29+
- [Release Notes](docs/cpp_release_notes.md)
30+
- [SDK Repository](https://github.com/boston-dynamics/spot-cpp-sdk)

cpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This file is autogenerated.
88

99
cmake_minimum_required (VERSION 3.10.2)
10-
project (bosdyn VERSION 4.0.2)
10+
project (bosdyn VERSION 4.0.3)
1111

1212
# Dependencies:
1313
find_package(protobuf REQUIRED)

cpp/README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ The C++ SDK includes C++ libraries and examples.
1313
## Coding standards and dependencies.
1414

1515
The C++ implementation follows these requirements:
16-
* A modern C++14 compiler toolchain.
17-
* Does not make use of exceptions or RTTI.
18-
* Generally complies with the Google C++ style guide.
19-
* Doxygen-friendly comments, particularly in header files.
16+
17+
- A modern C++14 compiler toolchain.
18+
- Does not make use of exceptions or RTTI.
19+
- Generally complies with the Google C++ style guide.
20+
- Doxygen-friendly comments, particularly in header files.
2021

2122
Library Dependencies:
22-
* C++14 standard library. Many advanced features, such as functional programming and concurrency support are used.
23-
* Google's gRPC C++ library, as well as it's transitive dependencies.
24-
* Unit tests depend on gTest.
25-
* Eigen for math operations
23+
24+
- C++14 standard library. Many advanced features, such as functional programming and concurrency support are used.
25+
- Google's gRPC C++ library, as well as it's transitive dependencies.
26+
- Unit tests depend on gTest.
27+
- Eigen for math operations
2628

2729
## Contents
2830

29-
* [Client](bosdyn/client/README.md)
30-
* [Common](bosdyn/common/README.md)
31-
* [Math](bosdyn/math/README.md)
31+
- [Client](bosdyn/client/README.md)
32+
- [Common](bosdyn/common/README.md)
33+
- [Math](bosdyn/math/README.md)

cpp/bosdyn/client/auth/auth_client.cpp

+24-20
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const char* AuthClient::s_default_service_authority = "auth.spot.robot";
2424

2525
const char* AuthClient::s_service_type = "bosdyn.api.AuthService";
2626

27-
std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(
28-
const std::string& username, const std::string& password,
29-
const RPCParameters& parameters) {
27+
std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(const std::string& username,
28+
const std::string& password,
29+
const RPCParameters& parameters) {
3030
std::promise<AuthResultType> response;
3131
std::shared_future<AuthResultType> future = response.get_future();
3232
BOSDYN_ASSERT_PRECONDITION(m_stub != nullptr, "Stub for service is unset!");
@@ -36,16 +36,18 @@ std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(
3636
request.set_password(password);
3737

3838
MessagePumpCallBase* one_time =
39-
InitiateAsyncCall<::bosdyn::api::GetAuthTokenRequest, ::bosdyn::api::GetAuthTokenResponse, ::bosdyn::api::GetAuthTokenResponse>(
39+
InitiateAsyncCall<::bosdyn::api::GetAuthTokenRequest, ::bosdyn::api::GetAuthTokenResponse,
40+
::bosdyn::api::GetAuthTokenResponse>(
4041
request,
41-
std::bind(&::bosdyn::api::AuthService::Stub::AsyncGetAuthToken, m_stub.get(), _1, _2, _3),
42+
std::bind(&::bosdyn::api::AuthService::StubInterface::AsyncGetAuthToken, m_stub.get(),
43+
_1, _2, _3),
4244
std::bind(&AuthClient::OnGetAuthTokenComplete, this, _1, _2, _3, _4, _5),
4345
std::move(response), parameters);
4446
return future;
4547
}
4648

47-
std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(
48-
const std::string& token, const RPCParameters& parameters) {
49+
std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(const std::string& token,
50+
const RPCParameters& parameters) {
4951
std::promise<AuthResultType> response;
5052
std::shared_future<AuthResultType> future = response.get_future();
5153
BOSDYN_ASSERT_PRECONDITION(m_stub != nullptr, "Stub for service is unset!");
@@ -54,33 +56,35 @@ std::shared_future<AuthResultType> AuthClient::GetAuthTokenAsync(
5456
request.set_token(token);
5557

5658
MessagePumpCallBase* one_time =
57-
InitiateAsyncCall<::bosdyn::api::GetAuthTokenRequest, ::bosdyn::api::GetAuthTokenResponse, ::bosdyn::api::GetAuthTokenResponse>(
59+
InitiateAsyncCall<::bosdyn::api::GetAuthTokenRequest, ::bosdyn::api::GetAuthTokenResponse,
60+
::bosdyn::api::GetAuthTokenResponse>(
5861
request,
59-
std::bind(&::bosdyn::api::AuthService::Stub::AsyncGetAuthToken, m_stub.get(), _1, _2, _3),
62+
std::bind(&::bosdyn::api::AuthService::StubInterface::AsyncGetAuthToken, m_stub.get(),
63+
_1, _2, _3),
6064
std::bind(&AuthClient::OnGetAuthTokenComplete, this, _1, _2, _3, _4, _5),
6165
std::move(response), parameters);
6266

6367
return future;
6468
}
6569

66-
AuthResultType AuthClient::GetAuthToken(
67-
const std::string& username, const std::string& password,
68-
const RPCParameters& parameters) {
70+
AuthResultType AuthClient::GetAuthToken(const std::string& username, const std::string& password,
71+
const RPCParameters& parameters) {
6972
return GetAuthTokenAsync(username, password, parameters).get();
7073
}
7174

72-
AuthResultType AuthClient::GetAuthToken(
73-
const std::string& token, const RPCParameters& parameters) {
75+
AuthResultType AuthClient::GetAuthToken(const std::string& token, const RPCParameters& parameters) {
7476
return GetAuthTokenAsync(token, parameters).get();
7577
}
7678

7779
// Set the outstanding response, which will update any futures. Reset it.
78-
void AuthClient::OnGetAuthTokenComplete(
79-
MessagePumpCallBase* call, const ::bosdyn::api::GetAuthTokenRequest& request,
80-
::bosdyn::api::GetAuthTokenResponse&& response, const grpc::Status& status,
81-
std::promise<AuthResultType> promise) {
82-
::bosdyn::common::Status ret_status = ProcessResponseAndGetFinalStatus<::bosdyn::api::GetAuthTokenResponse>(
83-
status, response, response.status());
80+
void AuthClient::OnGetAuthTokenComplete(MessagePumpCallBase* call,
81+
const ::bosdyn::api::GetAuthTokenRequest& request,
82+
::bosdyn::api::GetAuthTokenResponse&& response,
83+
const grpc::Status& status,
84+
std::promise<AuthResultType> promise) {
85+
::bosdyn::common::Status ret_status =
86+
ProcessResponseAndGetFinalStatus<::bosdyn::api::GetAuthTokenResponse>(status, response,
87+
response.status());
8488
if (!ret_status) {
8589
promise.set_value({ret_status, std::move(response)});
8690
return;

cpp/bosdyn/client/auth/auth_client.h

+10-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace client {
2222

2323
// This typedef needs to be a std::shared_ptr to satisfy the InitiateCall templatized method in
2424
// ServiceClient
25-
typedef Result<::bosdyn::api::GetAuthTokenResponse> AuthResultType;
25+
typedef Result<::bosdyn::api::GetAuthTokenResponse> AuthResultType;
2626

2727
class AuthClient : public ServiceClient {
2828
public:
@@ -36,17 +36,16 @@ class AuthClient : public ServiceClient {
3636
const RPCParameters& parameters = RPCParameters());
3737

3838
// Synchronous method to get an auth token for username/password combination.
39-
AuthResultType GetAuthToken(
40-
const std::string& username, const std::string& password,
41-
const RPCParameters& parameters = RPCParameters());
39+
AuthResultType GetAuthToken(const std::string& username, const std::string& password,
40+
const RPCParameters& parameters = RPCParameters());
4241

4342
// Asynchronous method to get an auth token for provided token.
4443
std::shared_future<AuthResultType> GetAuthTokenAsync(
4544
const std::string& token, const RPCParameters& parameters = RPCParameters());
4645

4746
// Synchronous method to get an auth token for provided token.
48-
AuthResultType GetAuthToken(
49-
const std::string& token, const RPCParameters& parameters = RPCParameters());
47+
AuthResultType GetAuthToken(const std::string& token,
48+
const RPCParameters& parameters = RPCParameters());
5049

5150
// Start of ServiceClient overrides.
5251
QualityOfService GetQualityOfService() const override;
@@ -65,12 +64,12 @@ class AuthClient : public ServiceClient {
6564
static std::string GetServiceType() { return s_service_type; }
6665

6766
private:
68-
void OnGetAuthTokenComplete(
69-
MessagePumpCallBase* call, const ::bosdyn::api::GetAuthTokenRequest& request,
70-
::bosdyn::api::GetAuthTokenResponse&& response, const grpc::Status& status,
71-
std::promise<AuthResultType> promise);
67+
void OnGetAuthTokenComplete(MessagePumpCallBase* call,
68+
const ::bosdyn::api::GetAuthTokenRequest& request,
69+
::bosdyn::api::GetAuthTokenResponse&& response,
70+
const grpc::Status& status, std::promise<AuthResultType> promise);
7271

73-
std::unique_ptr<::bosdyn::api::AuthService::Stub> m_stub;
72+
std::unique_ptr<::bosdyn::api::AuthService::StubInterface> m_stub;
7473

7574
// Default service name for the Auth service.
7675
static const char* s_default_service_name;

0 commit comments

Comments
 (0)