Skip to content

Commit f7d593b

Browse files
authored
Clarify structure of example directory
1 parent db37912 commit f7d593b

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/viam/examples/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Viam C++ SDK Examples
2+
3+
This directory contains some examples for working with the Viam SDK, ranging from component and service examples to module examples which show how to create modular resources.
4+
5+
Note that with the exception of examples in the [`project`](./project) directory, all these examples are _part of the C++ SDK build tree_, which means that their build files only work if you are using them within an existing SDK build. For learning about SDK features and concepts this is fine, but it is **not** what you should use for starter code if you want, for example, to develop and deploy a standalone C++ module which lives outside of the SDK build tree. For that look in the [`project`](./project) directory, where you will find CMake and Makefile code which adapts the source code from the simple module example to work as a standalone project which consumes the Viam C++ SDK as a dependency.
6+
7+
8+
19
# Component & Service Examples
210
Examples:
311
- camera
@@ -16,9 +24,15 @@ This will setup a server running on `localhost:8080` that has a mock setup of th
1624

1725
Download and build the C++ SDK by following the instructions [here](https://github.com/viamrobotics/viam-cpp-sdk#getting-started).
1826

19-
Then run:
27+
Then run the executable for whichever component you chose to build above. This will be
2028
``` shell
21-
viam-cpp-sdk/build/viam/examples/[component name]/example_[component name]
29+
# Camera
30+
viam-cpp-sdk/build/viam/examples/camera/example_camera
31+
```
32+
or
33+
```shell
34+
# Motor
35+
viam-cpp-sdk/build/viam/examples/motor/example_motor
2236
```
2337

2438
# Module examples
@@ -27,14 +41,9 @@ Examples:
2741
- complex
2842
- tflite
2943

30-
These examples go through how to create custom modular resources using Viam's C++ SDK, and how to connect them to a Robot. Refer to each directory's README file for more information.
31-
32-
# Generic Examples
33-
34-
## Project example
35-
This example shows how to setup a simple CMake-based project that uses Viam's C++ SDK.
44+
These examples go through how to create custom modular resources using Viam's C++ SDK, and how to connect them to a Robot. Refer to each directory's README file for more information. As mentioned above, these can either be built as part of the SDK build tree, or you can use some of the build code in [`project`](./project) to build the simple module example as a standalone project which consumes the SDK as a dependency.
3645

37-
## Dial Example
46+
# Dial Example
3847

3948
If you are connecting to a robot with authentication you will need to
4049
add credentials. Update path code :

0 commit comments

Comments
 (0)