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
Update Instructions for Telesurgery Workflow (#167)
### Description
- Offer Dockerized environments for running Telesurgery apps in both
simulated and real-world settings, complete with step-by-step guides for
each.
---------
Signed-off-by: Victor Chang <[email protected]>
Signed-off-by: Sachidanand Alle <[email protected]>
Co-authored-by: Sachidanand Alle <[email protected]>
Co-authored-by: Mingxin Zheng <[email protected]>
> RTI DDS is the common communication package for all scripts. Please refer to [DDS website](https://www.rti.com/products) for registration. You will need to obtain a license file and set the `RTI_LICENSE_FILE` environment variable to its path.
58
52
59
-
> Make sure your public key is added to the github account if the git authentication fails.
53
+
#### 2. Environment Configuration
54
+
When running the Patient and the Surgeon applications on separate systems, export the following environment variables:
60
55
61
-
### Obtain RTI DDS License
56
+
```bash
57
+
export PATIENT_IP="<IP Address of the system running the Patient application>"
58
+
export SURGEON_IP="<IP Address of the system running the Surgeon application>"
62
59
63
-
RTI DDS is the communication package used by all scripts. Please refer to the [DDS website](https://www.rti.com/products) for registration. You will need to obtain a license file and set the `RTI_LICENSE_FILE` environment variable to its path.
60
+
# Export the following for NTP Server (Optional)
61
+
export NTP_SERVER_HOST="<IP Address of the NTP Server>"
62
+
export NTP_SERVER_PORT="123"
63
+
```
64
64
65
-
### NTP Server (Optional)
65
+
> [!Note]
66
+
> For NTP settings and variables, refer to the [NTP (Network Time Protocol) Server](#ntp-server-setup) section for additional details.
66
67
67
-
An NTP (Network Time Protocol) server provides accurate time information to clients over a computer network. NTP is designed to synchronize the clocks of computers to a reference time source, ensuring all devices on the network maintain the same time.
68
+
## Running the System
69
+
70
+
### Real World Environment
68
71
72
+
#### 1. Build Environment
69
73
```bash
70
-
# Run your own NTP server in the background
71
-
docker run -d --name ntp-server --restart=always -p 123:123/udp cturra/ntp
74
+
cd<path-to-i4h-workflows>
75
+
workflows/telesurgery/docker/real.sh build
76
+
```
72
77
73
-
# Check if it's running
74
-
docker logs ntp-server
78
+
#### 2. Running Applications
75
79
76
-
# fix server ip in env.sh for NTP Server
77
-
export NTP_SERVER_HOST=<NTP server address>
80
+
##### Patient Application
81
+
```bash
82
+
# Start the Docker Container
83
+
workflows/telesurgery/docker/real.sh run
78
84
79
-
# To stop the server
80
-
# docker stop ntp-server && docker rm ntp-server
81
-
```
85
+
# Using RealSense Camera with NVIDIA H.264 Encoder
### Using H.264/HEVC Encoder/Decoder from NVIDIA Video Codec
162
+
## Advanced Configuration
163
+
164
+
### NTP Server Setup
165
+
An NTP (Network Time Protocol) server provides accurate time information to clients over a computer network. NTP is designed to synchronize the clocks of computers to a reference time source, ensuring all devices on the network maintain the same time.
166
+
167
+
```bash
168
+
# Run your own NTP server in the background
169
+
docker run -d --name ntp-server --restart=always -p 123:123/udp cturra/ntp
148
170
149
-
Camera data can be streamed using either the H.264 or HEVC (H.265) codecs. To enable this for the Patient and Surgeon applications, use the `--encoder nvc` or `--decoder nvc` argument, respectively.
171
+
# Check if it's running
172
+
docker logs ntp-server
150
173
151
-
Encoding parameters can be customized in the Patient application using the `--encoder_params` argument, as shown below:
174
+
# fix server ip in env.sh for NTP Server
175
+
export NTP_SERVER_HOST=<NTP server address>
176
+
177
+
# To stop the server
178
+
docker stop ntp-server && docker rm ntp-server
179
+
```
180
+
181
+
### Advanced NVIDIA Video Codec Configuration
182
+
183
+
The applications streams H.264 by default using NVIDIA Video Codec. Additional encoding parameters can be customized in the Patient application using the `--encoder_params` argument:
#### Sample Encoding Parameters for the NVIDIA Video Codec
189
+
#### Sample Encoding Parameters
158
190
159
-
Here’s an example of encoding parameters in JSON format:
191
+
Here's an example of encoding parameters in JSON format:
160
192
161
193
```json
162
194
{
@@ -169,16 +201,55 @@ Here’s an example of encoding parameters in JSON format:
169
201
}
170
202
```
171
203
172
-
> [!NOTE]
173
-
> H.264 or HEVC (H.265) codecs are available on x86 platform only.
204
+
### Advanced NVJPEG Configuration
205
+
206
+
Adjust the quality of encoded frames using the NVJPEG encoder by editing the [nvjpeg_encoder_params.json](./scripts/patient/nvjpeg_encoder_params.json) file. Simply change the quality parameter to a value between 1 and 100:
174
207
175
-
### Important Notes
176
-
1. You may need to run multiple scripts simultaneously in different terminals or run in background (in case of docker)
177
-
2. A typical setup requires multiple terminals running:
178
-
- Patient: Camera1, Camera2, Controller, etc.
179
-
- Surgeon: Camera1, Camera2, Controller, etc.
208
+
```json
209
+
{
210
+
"quality": 90
211
+
}
212
+
```
180
213
181
-
If you encounter issues not covered in the notes above, please check the documentation for each component or open a new issue on GitHub.
214
+
## Troubleshooting
215
+
216
+
### Common Issues
217
+
218
+
#### Docker Build Error
219
+
Q: I get the following error when building the Docker image:
220
+
```bash
221
+
ERROR: invalid empty ssh agent socket: make sure SSH_AUTH_SOCK is set
222
+
```
223
+
224
+
A: Start the ssh-agent
225
+
```bash
226
+
eval"$(ssh-agent -s)"&& ssh-add
227
+
```
228
+
#### Unable to launch the applications when using NVIDIA Video Codec
229
+
230
+
Q: I'm getting an error when I start the application with the NVIDIA Video Codec.
231
+
232
+
```BASH
233
+
[error] [nv_video_encoder.cpp:101] Failed to create encoder: LoadNvEncApi : Current Driver Version does not support this NvEncodeAPI version, please upgrade driver at /workspace/holohub/build/nvidia_video_codec/_deps/nvc_sdk/NvEncoder/NvEncoder.cpp:82
234
+
```
235
+
236
+
**A:** NVIDIA Video Codec requires CUDA version 12 (driver version 570.0) or later. Check out the [NVIDIA Video Codec System Requirements](https://developer.nvidia.com/nvidia-video-codec-sdk/download) section for more details. **
0 commit comments