Releases: viamrobotics/viam-cpp-sdk
releases/v0.0.18
What's Changed
- RSDK-3589 audit nav service docstrings by @raybjork in #334
- RSDK-6574: Fix use of
time_point
by @lia-viam in #335 - RSDK-9337: Introduce proto API bridge and insulate various geometry and math types from API by @lia-viam in #332
- RSDK-9466 - Remove robot status endpoint from SDK by @cheukt in #338
- Version bump by @lia-viam in #340
New proto API bridge approach
As part of an ongoing project to insulate google protobuf and the Viam API from the ABI and public API of the Viam SDK, we have introduced a new approach for writing and using to_proto
and from_proto
conversions. See https://github.com/viamrobotics/viam-cpp-sdk/blob/main/src/viam/sdk/common/pose.hpp for a worked example.
You have to
- include
viam/sdk/common/proto_convert.hpp
- forward declare the relevant API types
- specialize the
struct
callablesproto_convert_details::to_proto
andproto_convert_details::from_proto
to implement API to SDK interchange.
Note that the detail structs
only refer to API types by pointer to a forward-declared class, so there is no ABI dependency on the Viam API types.
The proto_convert.hpp
header also provides the callables viam::sdk::v2::to_proto
, which returns an API type by value, and viam::sdk::v2::from_proto
which takes an API type by reference to const
. In practice if you need an escape hatch to work with API types directly, you should include the relevant viam/api/...
headers and use the to_proto
and from_proto
callables rather than the struct
templates. The v2
namespace will be removed when this migration is complete and none of the old conversion functions remain.
Full Changelog: releases/v0.0.17...releases/v0.0.18
releases/v0.0.17
What's Changed
- RSDK-6634 - remove resource proto conversions from public headers by @stuqdog in #328
- use docker base image in CI by @abe-winter in #327
- RSDK-9299 - refactor get_resource_name to be a non-proto method by @stuqdog in #329
- Automated Protos Update by @github-actions in #321
- remove null opt derefs by @lia-viam in #330
- bump to 0.0.17 by @stuqdog in #333
Full Changelog: releases/v0.0.16...releases/v0.0.17
releases/v0.0.16
What's Changed
- Conan CI job additional typo fix by @lia-viam in #319
- Automated Protos Update by @github-actions in #318
- build docker base images in CI by @abe-winter in #322
- RSDK-3589 add wrapper for navigation service by @abe-winter in #323
- Add MoveThroughJointPositions to Arm component by @raybjork in #324
- bump version to v0.0.16 by @purplenicole730 in #326
New Contributors
Full Changelog: releases/v0.0.15...releases/v0.0.16
releases/v0.0.15
releases/v0.0.14
What's Changed
- Automated Protos Update by @github-actions in #308
- Automated Protos Update by @github-actions in #311
- RSDK-9077: Docker containers for module development by @lia-viam in #310
- Automated Protos Update by @github-actions in #313
- Bump version to 0.0.14 by @jckras in #314
- Update README.md for module dev Docker by @lia-viam in #315
Full Changelog: releases/v0.0.13...releases/v0.0.14
releases/v0.0.13
What's Changed
- Automated Protos Update by @github-actions in #305
- RSDK-8822: Whole archive linking by @lia-viam in #306
-
- module example code is no longer broken on static builds
-
- no further guarantees are made and this is not extensively tested in CI/releases nor will it be part of release archives going forward
- version bump by @lia-viam in #307
Full Changelog: releases/v0.0.12...releases/v0.0.13
releases/v0.0.12
Breaking change
Details and migration guide
Removes ProtoType
and AttributeMap
, replacing them with ProtoValue
and ProtoStruct
. This affects the parameter used in component doCommand
calls, as well as the extra parameter included in all component methods.
For most use cases, the change will look like this:
90246f0#diff-becf92545c215777e3fe43c17c0f4196f96bb623d3aa8feee82d1357e7c1738fL11
Namely,
- include path is now
#include <viam/sdk/common/proto_value.hpp>
- parameter is now
const ProtoStruct&
The majority of code changes will be able to just do a Replace-In-Files for the two changes above
If your component or module code actually used these types directly, the changes will look something like this:
90246f0#diff-e07f0fbd2e62063a2446d7ab99d80d9a5c50e9a94649f64b9d5caf5c67b3a345
Namely, ProtoValue
is now has value semantics rather than pointer semantics and std::shared_ptr
, and ProtoStruct
is a map of std::string
to ProtoType
. You can construct a ProtoValue
like a normal C++ class as you would, eg, a variant or JSON type:
ProtoValue num_val{5.6};
ProtoValue str_val{"meow"};
// ProtoList is a vector of ProtoValue:
ProtoList my_list{{ProtoValue{true}, ProtoValue{"meow"}, ProtoValue{6.0}}};
// ProtoStruct is a map:
ProtoStruct my_map{
{"cat", "meow"},
{"dog", "woof"},
{"number", 1.234},
{"list", my_list}, //copies my_list
};
ProtoValue
and related types now have value semantics rather than smart pointer semantics. This means, eg
map lookup operations will now use a .
rather than ->
, and types will behave like arithmetic types or standard library containers with respect to copying, moving, etc
Please see the proto_value.hpp
header for detailed documentation and API of other methods, including
to_proto
to convert togoogle::protobuf
classes, andProtoValue::from_proto
to construct fromgoogle::protobuf
classesis_a<T>
andget<T>
/get_unchecked<T>
for stored element inpection- ...or generate the doxygen documentation if you like!
To find affected code, you can grep
or ag
or GitHub code search for ProtoType
and AttributeMap
.
Additional changes
- RSDK-8828 Remove integer type from ProtoValue by @lia-viam in #292
- RSDK-8826: Conan builds in CI by @lia-viam in #296
- Fix debian builds in CI by @lia-viam in #297
- Automated Protos Update by @github-actions in #298
- Automated Protos Update by @github-actions in #300
- Use proto value get in example code by @lia-viam in #303
- RSDK-6170 - add debug log support by @stuqdog in #299
- Automated Protos Update by @github-actions in #302
- Version bump by @lia-viam in #304
Full Changelog: releases/v0.0.11...releases/v0.0.12
releases/v0.0.11
What's Changed
- RSDK-6636: Refactored AttributeMap with type-erased ProtoType by @lia-viam in #272
- Automated Protos Update by @github-actions in #277
- Version bump by @lia-viam in #281
- Fix aarch build by @lia-viam in #282
- Automated Protos Update by @github-actions in #280
- RSDK-7861 Conan dependencies by @lia-viam in #283
- RSDK-4735 Add options to disable building tests and examples (merged in the Conan deps PR)
- RSDK-8541: ProtoValue get_unchecked and visit API by @lia-viam in #279
- Update actions/download-artifact and actions/upload-artifact to v4 by @lia-viam in #291
- use boost program_options in example by @abe-winter in #288
- RSDK-8343 - create public version_metadata file by @stuqdog in #290
- Automated Protos Update by @github-actions in #286
- Automated Protos Update by @github-actions in #293
- RSDK-8829: Add frame_rate to cpp sdk by @jckras in #294
- Revert find_package logic by @lia-viam in #295
Full Changelog: releases/v0.0.10...releases/v0.0.11
releases/v0.0.10
What's Changed
- Streamable client helper by @lia-viam in #265
- Automated Protos Update by @github-actions in #263
- Automated Protos Update by @github-actions in #267
- Automated Protos Update by @github-actions in #269
- Automated Protos Update by @github-actions in #270
- RSDK-8306 - set version in metadata by @stuqdog in #271
- Automated Protos Update by @github-actions in #274
- Automated Protos Update by @github-actions in #275
- RSDK-7924: Fix building of example projects by @lia-viam in #273
- RSDK-7440: Build example projects in CI by @lia-viam in #276
- bump version by @stuqdog in #278
Full Changelog: releases/v0.0.9...releases/v0.0.10
releases/v0.0.9
What's Changed
Full Changelog: releases/v0.0.8...releases/v0.0.9