-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_ceron
More file actions
95 lines (69 loc) · 2.77 KB
/
docker_ceron
File metadata and controls
95 lines (69 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
sudo docker run -p 8080:80 -e USER=robotics -e PASSWD=robotics -u 1000:1000 -v /dev/shm:/dev/shm -v ~/tmp/c_/:/home/robotics/work -it --name=te3003b-2025 arturocerontec/robotics:te300xb
de ahi en adelante
sudo docker start te3003b-2025
sudo docker attach te3003b-2025
# en cada terminal
sudo docker exec -it te3003b-2025 bash
ver en:
localhost:8080/vnc.html
#
# CLASE PT 1
#
## INSIDE CONTAINER
# in CPP-LIB-LINUX/src
# Generate library
g++ -I. -std=c++14 -o cpp_lib_demo cpp_lib_demo.cpp
# Generate .o file
g++ -I. -std=c++14 -fPIC -c -o cpp_lib_demo.o
# Generate e.so file to use in python script
g++ -shared -o cpp_lib_demo.so cpp_lib_demo.o
# in ROS-ObjectDetection-Linux
conda activate te300xb
python ros2-object-detection.py
# in PY-RPC-Wrapper-Server-Linux
python -m grpc_tools.protoc -I./protos --python_out=./protos --grpc_python_out=./protos ./protos/rpc-demo.proto
#
# CLASE PT 2.1 -> C_SHARP CLIENT
#
sudo su # estar en root
cd /home/robotics/work/pt2/CS-RPC-Client-Linux/cs-rpc-demo/protos
# Compile proto for c_sharp
sudo /root/.nuget/packages/grpc.tools/1.2.2/tools/linux_x64/protoc -I ./ -I /home/robotics/tools/protobuf/src/ --csharp_out ./ ./rpc-demo.proto --grpc_out ./ --plugin=protoc-gen-grpc=/root/.nuget/packages/grpc.tools/1.2.2/tools/linux_x64/grpc_csharp_plugin
# primero correr (de la pt1) en diferentes terminales:
# in ROS-ObjectDetection-Linux
conda activate te300xb
python ros2-object-detection.py
# in PY-RPC-Wrapper-Server-Linux
conda activate te300xb
python ros2-grpc-wrapper.py
# ahora correr cliente de c_sharp
mono --trace=M:System.Diagnostics.Debug:WriteLine cs-rpc-demo.exe
#
# CLASE 2.2 -> GO CLIENTE (REST API)
#
sudo apt install protobuf-compiler
# First generate proto files in .go for GRPC protocol
# in GO-REST-Gateway-Linux
protoc -I ./protos -I /home/robotics/tools/googleapis --go_out ./protos --go_opt paths=source_relative --go-grpc_out ./protos --go-grpc_opt paths=source_relative rpc-demo-gw.proto
# Generate REST interface protocol
protoc -I ./protos/ -I /home/robotics/tools/googleapis/ --plugin=protoc-gen-grpc-grateway=/home/robotics/go/bin/protoc-gen-grpc-gateway --grpc-gateway_out ./protos/ --grpc-gateway_opt logtostderr=true --grpc-gateway_opt paths=source_relative rpc-demo-gw.proto
# Initialize go package
go mod init example.com/rest-gateway-demo
# Install missing dependencies
go mod tidy
# Build
go build go-gateway.go
# Run built program
./go-gateway
# Correr los 3 (nodo de ros de python, grpc server de python, go-gateway)
# Abrir Postman (./tools/Postman/Postman)
# Configurar en modo Post con el siguiente path:
http://localhost:8042/restgatewaydemo/getmultcoords
# Correr en FLASK-REST-Call-Linux el archivo de python
conda activate te300xb
python app.py
message ImageResult {
bytes b64img = 1;
uint32 width = 2;
uint32 height = 3;
}