You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-30Lines changed: 76 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
This SAW component allows to stream data from most cisst/SAW components with little or no new code. It compiles on Windows, Linux and likely MacOS. It has been tested with:
4
4
* Linux
5
-
* Streaming prmStateJoint data from sawIntuitiveResearchKit and sawIntuitiveDaVinci
5
+
* Streaming `prmStateJoint` data from sawIntuitiveResearchKit and sawIntuitiveDaVinci
6
6
7
-
It current supports UDP sockets and the data is serialized using JSON
7
+
It currently supports UDP sockets and the data is serialized using the JSON
8
8
format. It is used to stream data from the different da Vinci robots
9
9
(at JHU) to HoloLens displays. On the HoloLens side, one can use the
10
-
open source package [dvrk-xr](https://github.com/jhu-dvrk/dvrk-xr).
10
+
open source package [dvrk-xr](https://github.com/jhu-dvrk/dvrk-xr). It can be used to receive and send data to any other SAW component (see https://github.com/jhu-cisst/cisst/wiki/cisst-libraries-and-SAW-components)
11
11
12
12
Based on user requests, we could add:
13
13
* TCP support
@@ -24,43 +24,34 @@ Based on user requests, we could add:
24
24
25
25
## Adding the component
26
26
27
-
One can create and add the `mtsSocketStreamer` component manually in
28
-
your `main` C function but we strongly recommend using the
27
+
You can create and add the `mtsSocketStreamer` component manually in
28
+
your `main` C/C++ code but we strongly recommend using the
29
29
`cisstMultiTask` manager ability to load a configuration file to add
30
-
and connect components. The dVRK main programs provide this options. See https://github.com/jhu-dvrk/sawIntuitiveResearchKit/blob/master/applications/mainQtConsoleJSON.cpp.
30
+
and connect components. Most cisst/SAW (including dVRK) programs have
31
+
already been updated with the code below so you likely don't need to
if (!componentManager->ConfigureJSON(managerConfig)) {
48
+
CMN_LOG_INIT_ERROR << "Configure: failed to configure component manager, check cisstLog for error messages" << std::endl;
49
+
return -1;
61
50
}
62
51
```
63
52
53
+
## Configuration file for the component manager
54
+
64
55
The configuration files for the component manager will look like (more examples can be found at https://github.com/jhu-dvrk/sawIntuitiveResearchKit/tree/master/share/socket-streamer):
To test the streamer, you can use the `nc` tool on Linux. The main options are `l` to listen and `u` for UDP protocol. Then you need to add the IP address and port. With the example above, try:
143
+
To test the read commands and events, you can use the `nc` tool on
144
+
Linux. The main options are `l` to listen and `u` for UDP protocol.
145
+
Then you need to add the IP address and port. With the example above,
146
+
try:
141
147
```sh
142
148
nc -lu 10.194.86.119 48054
143
149
```
144
-
At that point you should see a continous stream for text in JSON format.
150
+
At that point you should see a continous stream of text in JSON format.
151
+
152
+
To test the void and write commands, you need to create your own code
153
+
and send the command name and payload in JSON format. For void
154
+
commands, send an empty string (`""`). You can find an example in
155
+
Python in the sawIntuitiveResearchKit repository under
0 commit comments