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
16 changes: 8 additions & 8 deletions codesamples/apis.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"base": {
"client": "BaseClient",
"client": "Base",
"func": "is_moving",
"args": []
},
"camera": {
"client": "CameraClient",
"client": "Camera",
"func": "get_image",
"args": [ "std::string(\"image/png\")" ],
"comment": "Note that the supplied MIME type is just a placeholder. Please update as necessary."
},
"encoder": {
"client": "EncoderClient",
"client": "Encoder",
"func": "get_properties",
"args": []
},
"motion": {
"client": "MotionClient",
"client": "Motion",
"func": "get_pose",
"args": ["{{\"rdk\", \"component\", \"fake\"}, \"\", \"component\"}", "<destination-frame>", "{}", "nullptr"],
"comment": "Update with correct component name, destination frame, supplemental transforms, and extra params"
},
"motor": {
"client": "MotorClient",
"client": "Motor",
"func": "is_moving",
"args": []
},
"movement_sensor": {
"client": "MovementSensorClient",
"client": "MovementSensor",
"func": "get_linear_velocity",
"args": []
},
"power_sensor": {
"client": "PowerSensorClient",
"client": "PowerSensor",
"func": "get_voltage",
"args": []
},
"sensor": {
"client": "SensorClient",
"client": "Sensor",
"func": "get_readings",
"args": []
}
Expand Down
2 changes: 1 addition & 1 deletion src/viam/examples/dial/example_dial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main() {
std::vector<Name> resource_names = robot->resource_names();
std::cout << "Resources" << std::endl;
for (const Name& resource : resource_names) {
std::cout << "\t" << resource << "\n" << std::endl;
std::cout << "\t" << resource << "\n";
}

// ensure we can query statuses
Expand Down
2 changes: 1 addition & 1 deletion src/viam/examples/dial_api_key/example_dial_api_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main() {
std::vector<Name> resource_names = robot->resource_names();
std::cout << "Resources" << std::endl;
for (const Name& resource : resource_names) {
std::cout << "\t" << resource << "\n" << std::endl;
std::cout << "\t" << resource << "\n";
}

// ensure we can query statuses
Expand Down
4 changes: 3 additions & 1 deletion src/viam/sdk/robot/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ RobotClient::RobotClient(std::shared_ptr<ViamChannel> channel)
: channel_(channel->channel()),
viam_channel_(std::move(channel)),
should_close_channel_(false),
impl_(std::make_unique<impl>(RobotService::NewStub(channel_))) {}
impl_(std::make_unique<impl>(RobotService::NewStub(channel_))) {
Registry::initialize();
}
Comment on lines +314 to +316
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(flyby) we need to ensure that the Registry is properly initialized even when functioning as a pure client. This isn't a great long-term fix but @acmorrow has some future work on library initialization that will help clear this up.


std::vector<Name> RobotClient::resource_names() const {
const std::lock_guard<std::mutex> lock(lock_);
Expand Down