Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
4d01c95
feat<>: leftovers from mobile feature regarding styles and variables …
Ahelsamahy Nov 29, 2023
6e27b25
feat<utils/ssh.py>: create router class with function to get SSID
Ahelsamahy Nov 29, 2023
865a4ae
feat<teleop/app.py> use the new fetch ssid in utils and remove old call
Ahelsamahy Nov 29, 2023
7daa373
feat<utils/ssh.py>: create camera and router class
Ahelsamahy Nov 29, 2023
90194cf
feat<teleop/app.py> use the new fetch ssid in utils and remove old call
Ahelsamahy Nov 29, 2023
5e294c0
Merge branch 'RFC0012_ConfigurationFile' of https://github.com/Ahelsa…
Ahelsamahy Nov 29, 2023
46faf4f
feat<utils/ssh.py>: add function to get mac and ip of connected devices
Ahelsamahy Nov 30, 2023
b71c022
feat<teleop/user_menu>: Change styles hierarchy and add padding to body
Ahelsamahy Nov 30, 2023
d4f28f5
feat<utils/ssh>: add router function to scan for networks and filter …
Ahelsamahy Dec 1, 2023
58a99cc
doc<utils/ssh> add DocString to other functions
Ahelsamahy Dec 1, 2023
9b74d79
deb<utils/ssh>: add 2 debugger for scanning networks function
Ahelsamahy Dec 1, 2023
ef9a58e
feat<teleop/static>: relocate JS files for userMenu and Index
Ahelsamahy Dec 1, 2023
3199364
refactor<utils/ssh>: remove functions made by SegCooperation team
Ahelsamahy Dec 4, 2023
ecb253a
feat<utils/ssh>: add camera function to change the ip of it
Ahelsamahy Dec 4, 2023
0c1162a
feat<vehicle>: add function to check and create robot template file
Ahelsamahy Dec 4, 2023
54a82ff
feat<teleop/app.py>: add call for robot conf file
Ahelsamahy Dec 4, 2023
9011134
feat<teleop/user_admin>: add load for admin page in Tornado
Ahelsamahy Dec 4, 2023
5a21036
feat<teleop/app.py>: add templateLoader function
Ahelsamahy Dec 4, 2023
a9f1b86
feat<teleop/user_admin>: add drag for table rows
Ahelsamahy Dec 4, 2023
e47d359
doc<teleop/app.py>: add comment for endpoint navigation
Ahelsamahy Dec 4, 2023
e981099
feat<teleop/user_admin>: allow reposition only for tr
Ahelsamahy Dec 4, 2023
8ac8c7d
feat<utils/ssh>: add class for scanning wifi networks and getting result
Ahelsamahy Dec 7, 2023
ac16deb
feat<utils/ssh>: add function to connect to new network
Ahelsamahy Dec 7, 2023
eca6e28
feat<utils/ssh>: add function to remove connection with a network
Ahelsamahy Dec 7, 2023
71b2a23
refactor<utils/ssh>: include the command in fetch_ssid function
Ahelsamahy Dec 7, 2023
b5fa33e
refactor<utils/ssh>: add example for connect_to_network function
Ahelsamahy Dec 7, 2023
552357f
refactor<utils/ssh>: add labels to each ip connected to segment
Ahelsamahy Dec 7, 2023
820d56e
refactor<teleop>: change the serving for static files in app.py and t…
Ahelsamahy Dec 8, 2023
c898cbe
feat<teleop/user_menu>: add collapsible navigation bar
Ahelsamahy Dec 8, 2023
587cd25
refactor<teleop/mobileController>: change the serving for js files
Ahelsamahy Dec 8, 2023
41adc02
refactor<teleop>: change the call for fetch ssid segment
Ahelsamahy Dec 8, 2023
9b1d978
feat<utils/ssh>: create one function that makes ssh connection to router
Ahelsamahy Dec 8, 2023
00196fd
feat<teleop/admin_menu>: move the js init to admin_settings and call …
Ahelsamahy Dec 11, 2023
7a71133
feat<teleop>: add scan networks table and endpoint
Ahelsamahy Dec 11, 2023
f408fda
refactor<admin_menu>: Move CSS file to user_menu
Ahelsamahy Dec 11, 2023
1517d3f
feat<admin_menu>: add js to call py endpoint
Ahelsamahy Dec 11, 2023
203f3fd
refactor<ssh>: change ssh_client from private to protected
Ahelsamahy Dec 11, 2023
18ca758
feat<ssh>: limit connectable networks to be MWLC and CP only
Ahelsamahy Dec 11, 2023
935bf5d
feat<ssh>: add Nano function to get its local IP
Ahelsamahy Dec 11, 2023
23dd057
feat<teleop>: call Router class with dynamic ip instead of static
Ahelsamahy Dec 11, 2023
9c8d540
feat<>: change the parser to have dynamic ip from config files(s)
Ahelsamahy Dec 11, 2023
5a0a0bb
feat<robot_confid.ini>: add template data in the file
Ahelsamahy Dec 11, 2023
e7f080e
feat<vehicle/app>: add function to change the ip of segment in robot_…
Ahelsamahy Dec 11, 2023
5bffddd
feat<teleop/ssh>: append call for excute ssh function to be protected…
Ahelsamahy Dec 12, 2023
6c0413f
feat<utils/ssh>: remove init router class with ip
Ahelsamahy Dec 12, 2023
39c13a7
fix<raspi/camera>: fix problem "[Errno 2] No such file or directory: …
Ahelsamahy Dec 13, 2023
d171a42
fix<respi/servos>: fix "TypeError: __init__() got an unexpected keywo…
Ahelsamahy Dec 13, 2023
e2e6e44
feat<raspi/camera>: add function to change ip of camera config accord…
Ahelsamahy Dec 13, 2023
55dd389
refctor<utils/ssh>: connecting to network wasn't working from normal ui
Ahelsamahy Dec 14, 2023
6b5ddda
refactor<utils/ssh>: update delete connection to include firewall file
Ahelsamahy Dec 14, 2023
ac62882
feat<vehicle>: add fucntion to check the .ini have all the keys from …
Ahelsamahy Dec 18, 2023
24b0a36
refactor<robot_config.ini>: Change the stored data in it
Ahelsamahy Dec 18, 2023
12d81db
feat<vehicle>:Change the ips in all the config files the segment is u…
Ahelsamahy Dec 18, 2023
21f099a
feat<black formatter>: increase the line length for black formatter
Ahelsamahy Dec 18, 2023
fdf9997
feat<vehicle>: pass the host ip to GPS poller from app.py in the call
Ahelsamahy Dec 18, 2023
b2d962a
feat<teleop>: add post call to add network
Ahelsamahy Dec 18, 2023
690bf34
refactoring some code parts
Ahelsamahy Dec 18, 2023
c9305d0
refactor<teleop/app.py>: remove unused vars for getting segment name …
Ahelsamahy Dec 18, 2023
c9418a3
refactor<teleop/Admin_settings>: remove ip column for connected segments
Ahelsamahy Dec 18, 2023
fd7c0f8
feat<teleop/menu_admin>: add javascript event listener to start scanning
Ahelsamahy Dec 18, 2023
ded75e3
feat<teleop/menu_admin>: change the show for segments
Ahelsamahy Dec 18, 2023
81cd457
feat<Teleop/menu_admin>: add post function in router API call
Ahelsamahy Dec 18, 2023
f9d2f7c
feat<Teleop/menu_admin>: add post function to connect with another se…
Ahelsamahy Dec 18, 2023
a532880
refactor<Teleop/menu_admin>: change nano ip function name
Ahelsamahy Dec 18, 2023
c1419e2
feat<teleop/menu_admin>: add slide left animation for new row in conn…
Ahelsamahy Dec 18, 2023
377dff1
refactoring code parts
Ahelsamahy Dec 18, 2023
09215df
refactor<utils/ssh>: make get_ip for nano a static function
Ahelsamahy Dec 19, 2023
5a28dc7
feat<teleop/app.py>: change the logger to make it include line num of…
Ahelsamahy Dec 19, 2023
3ca3af8
feat<teleop/socket>: create PUB and SUB ZMQ sockets
Ahelsamahy Dec 19, 2023
53f5c39
refactorteleop/server>: use nano static method
Ahelsamahy Dec 19, 2023
dd8f059
feat<Teleop/socket>: send the actual robot_config file
Ahelsamahy Dec 19, 2023
4675b29
doc<Teleop/app.py>:
Ahelsamahy Dec 19, 2023
0d7d8a4
feat<teleop/robot_coms>: make the subscriber function as a class
Ahelsamahy Dec 19, 2023
2ea7ae8
refactor<>
Ahelsamahy Dec 19, 2023
853c50d
refactor<utils/ssh>: add default value for router class
Ahelsamahy Dec 27, 2023
335624d
refactor<vehicles>: change calls from segment1 to segment_1
Ahelsamahy Dec 27, 2023
a59c071
feat<teleop>: add fake json data for testing
Ahelsamahy Dec 27, 2023
67c6e3c
feat<teleop/router_coms>: add router actions class
Ahelsamahy Dec 27, 2023
9d3b935
feat<utils/ssh>: add function to return mac address for router
Ahelsamahy Dec 28, 2023
204daf4
refactor<robot_config.ini>: change the data stored in it
Ahelsamahy Dec 28, 2023
3a9ed4f
feat<vehicles/configFile>: Move the config functions to class
Ahelsamahy Dec 28, 2023
02946ff
feat<config.ini>: add default value for GPS port in router
Ahelsamahy Dec 28, 2023
c53a28c
feat<utils/ssh>: add function to make static route
Ahelsamahy Dec 28, 2023
2b4e5d8
refactor<utils/ssh>: update the saving command to fit
Ahelsamahy Dec 28, 2023
3ed3fcb
feat<utils/ssh>: create functions to add static route back from T-router
Ahelsamahy Jan 2, 2024
b16a4e1
feat<utils/ssh>: add a driver function to control the flow
Ahelsamahy Jan 2, 2024
8e2548e
refactor<>: some code parts with dark
Ahelsamahy Jan 3, 2024
9682939
feat<utils/ssh>: add pinging function
Ahelsamahy Jan 4, 2024
dbb1f4f
feat<utils/ssh>: add boolean to change connection logic route
Ahelsamahy Jan 4, 2024
6d957b8
refactor<utils/ssh>: change the driver functions call
Ahelsamahy Jan 4, 2024
047ae14
feat<utils/ssh>: get ip of new network is a loop now
Ahelsamahy Jan 4, 2024
773c9c7
feat<utils/ssh>: add duplication check
Ahelsamahy Jan 4, 2024
0fc0256
refactor<utils/ssh>: remove the firewall rule for interface dhcp
Ahelsamahy Jan 4, 2024
2206f79
feat<utils/ssh>: add the firewall rule in static interface
Ahelsamahy Jan 4, 2024
37abbc3
feat<utils/ssh>:add sleeping time for infinite loop in static route
Ahelsamahy Jan 4, 2024
dcd8b10
feat<utils/ssh>: add interface verification in wifi_connect class call
Ahelsamahy Jan 4, 2024
255e0ef
feat<utils/ssh>: add target seg ip in static route ssh function call
Ahelsamahy Jan 4, 2024
9941f7d
feat<utils/ssh>: add restarting command for the router
Ahelsamahy Jan 4, 2024
2c4977e
feat<utils/ssh>: remove any trailing white spaces in ssh return
Ahelsamahy Jan 4, 2024
bc78b9e
refactor<utils/ssh>: move the firewall function
Ahelsamahy Jan 4, 2024
0cf8bf6
feat<utils/ssh>: remove not needed info for the connectable networks
Ahelsamahy Jan 4, 2024
2262f33
feat<utils/ssh>: add filter for mac address
Ahelsamahy Jan 4, 2024
6d9e159
feat<teleop>: add function to populate robot_config.ini
Ahelsamahy Jan 8, 2024
76b10e2
refactor<utils/ssh>: create loop for ssid and mac router functions
Ahelsamahy Jan 9, 2024
f21534e
feat<utils/ssh>: Create class for deleting connection with another se…
Ahelsamahy Jan 9, 2024
985826d
feat<utils/ssh>: add function to check for wifi visibility
Ahelsamahy Jan 10, 2024
c6f5016
refactor<TEL>: remove solo call for router class
Ahelsamahy Jan 10, 2024
bf956d4
feat<TEL/admin_menu>: disable scroll to refresh
Ahelsamahy Jan 10, 2024
6db2590
feat<TEL/admin_menu>: remove the double borders for SEG table
Ahelsamahy Jan 10, 2024
3e81f07
refactor<TEL/admin_menu>: remove head tag in html
Ahelsamahy Jan 10, 2024
773784f
feat<TEL&SSH>: change logger format
Ahelsamahy Jan 10, 2024
c211bac
feat<TEL/admin_menu>:add styles to segment table
Ahelsamahy Jan 10, 2024
9672fc0
feat<TEL/admin_menu>: change the animation trigger
Ahelsamahy Jan 10, 2024
db87efc
refactor<TEL/robot_coms>: remove the need to action command
Ahelsamahy Jan 10, 2024
8e9ba8c
feat<TEL/robot_comm>: add router actions class
Ahelsamahy Jan 10, 2024
431f31e
feat<TEL/robot_comm>: add checker for robot existence
Ahelsamahy Jan 10, 2024
61877e4
refactor<TEL/robot_comm>: remove parts related to "action" message
Ahelsamahy Jan 10, 2024
892c911
refactor<robot_comm&TEL DOCK>
Ahelsamahy Jan 10, 2024
863e00f
refactoring
Ahelsamahy Jan 10, 2024
d7b26fd
feat<TEL/menu_robot>: add drop animation for segment cell
Ahelsamahy Jan 11, 2024
07c54ca
feat<TEL/menu_robot>: add filter function for data from .ini
Ahelsamahy Jan 11, 2024
cb54f28
feat<TEL/menu_robot>: rename the files
Ahelsamahy Jan 11, 2024
954573b
feat<TEL/menu_robot>: merge segment classes together
Ahelsamahy Jan 11, 2024
6a4ed51
feat<TEL/robot-comm>: work on robot interpretation for the received j…
Ahelsamahy Jan 11, 2024
652e666
feat<VEH>: remove robot_config populating functions
Ahelsamahy Jan 11, 2024
efd90f3
refactor<robot_config.ini>: change keys
Ahelsamahy Jan 11, 2024
8ddf0ec
feat<TEL/menu_robot>: add utils class
Ahelsamahy Jan 11, 2024
d5a7392
feat<TEL/menu_admin>: add segment to segmentData upon add button click
Ahelsamahy Jan 11, 2024
2cbbdd6
feat<TEL/menu_admin>: add print function for segmentData
Ahelsamahy Jan 11, 2024
bb1daf7
feat<TEL/menu_admin>: add verfication for segmentData setter
Ahelsamahy Jan 11, 2024
061df45
feat<TEL/menu_robot>: add segment to segmentData upon add button click
Ahelsamahy Jan 11, 2024
7b4cfb8
feat<TEL/menu_admin>: add print function for segmentData
Ahelsamahy Jan 11, 2024
05b3c6f
feat<TEL/menu_robot>: add verfication for segmentData setter
Ahelsamahy Jan 11, 2024
7ed4e78
Merge branch 'RFC0012_ConfigurationFile' of https://github.com/Ahelsa…
Ahelsamahy Jan 11, 2024
81c72ce
feat<TEL/menu_robot>: show SEG in SEG table after it is added
Ahelsamahy Jan 12, 2024
8dc0814
feat<TEL/menu_robot>: hide nano ip p tag and change scan button text
Ahelsamahy Jan 12, 2024
be70588
feat<TEL/menu_robot>: change setter to accept full list
Ahelsamahy Jan 12, 2024
a644f81
feat<TEL/menu_admin>: add function to remove a SEG
Ahelsamahy Jan 12, 2024
69d8118
feat<TEL/menu_robot>: add button event for deleting SEG from segment …
Ahelsamahy Jan 12, 2024
af9e7c0
feat<TEL/user_robot>: split main JS into 4 files
Ahelsamahy Jan 15, 2024
71d3a65
refactor<TEL/menu_robot>: remove segment_ filtering
Ahelsamahy Jan 15, 2024
6856042
feat<TEL/menu_robot>: add function to send json data on save
Ahelsamahy Jan 15, 2024
75aa8a1
feat<TEL/SSH>: add details for current router
Ahelsamahy Jan 16, 2024
394e4e0
feat<SSh>: Add function to get ip address from mac
Ahelsamahy Jan 16, 2024
fe1925d
refactor<TEL/menu_robot>: change from "main" to "host"
Ahelsamahy Jan 16, 2024
d7ead51
feat<TEL/robot_comm>: add get ip from mac function in check connection
Ahelsamahy Jan 16, 2024
f6a44e6
refactor<TEL/robot_comm>: check for difference in json vs .ini
Ahelsamahy Jan 16, 2024
1d6c219
refactor<TEL/robot_comm>: rename from RouterActions to RobotActions
Ahelsamahy Jan 16, 2024
4c0b4e7
feat<TEL/robot_comm>: remove comments and add loggers
Ahelsamahy Jan 16, 2024
9b43a8c
remove old code
Ahelsamahy Jan 16, 2024
6922214
feat<TEL/server>: add handler for post request from JS
Ahelsamahy Jan 16, 2024
2572e30
feat<>: change the saved data in robot_config.template
Ahelsamahy Jan 16, 2024
95cc191
feat<TEL=>COMS>: Made the file transition
Ahelsamahy Jan 17, 2024
3c3691e
refactor<TEL/menu_robot>: remove scanning functionality
Ahelsamahy Jan 17, 2024
78b4ef8
refactor<TEL/menu_robot>: remove table to show result from scanning
Ahelsamahy Jan 17, 2024
e554023
refactor<TEL/menu_robot>: change placeholder for empty cell in seg table
Ahelsamahy Jan 18, 2024
bc0c95a
feat<TEL/robot_menu>: create post function for the save button
Ahelsamahy Jan 18, 2024
123198c
feat<TEL>: create Tornado handler for post saving request
Ahelsamahy Jan 18, 2024
ceda5ff
feat<TEL/server>: create Tornado handler class for sending robot_config
Ahelsamahy Jan 18, 2024
8dcb769
feat<COMS>: filter message from TEL chatter
Ahelsamahy Jan 18, 2024
3695d9b
refactor<PIL>: remove logger for config
Ahelsamahy Jan 18, 2024
1415c61
feat<COM>: create publisher
Ahelsamahy Jan 18, 2024
675348b
feat<TEL>: create subscriber to coms socket
Ahelsamahy Jan 18, 2024
dc21923
REFACTORING
Ahelsamahy Jan 18, 2024
672a7ab
feat<COMS>: add filter for robot_message
Ahelsamahy Jan 18, 2024
c05452b
refactor<TEL>:change Application class
Ahelsamahy Jan 19, 2024
99086a1
feat<COMS>: add passed argument parser
Ahelsamahy Jan 19, 2024
5f4225b
feat<COMS>: Create Application class to keep consistent design across…
Ahelsamahy Jan 19, 2024
66b2b73
feat<COMS/robot_coms>: move PUB,SUB and RobotActions file
Ahelsamahy Jan 19, 2024
7b01e9a
feat<COMS>: Create handler class for TEL chatter
Ahelsamahy Jan 19, 2024
b6b4ae5
style<COMS & TEL>: Sort imports
Ahelsamahy Jan 19, 2024
084a3fc
feat<COMS>: Create socket handler class for all operations related to…
Ahelsamahy Jan 19, 2024
5e4b0d9
refactor<robot_config>: change the data in it
Ahelsamahy Jan 19, 2024
9bcf23a
feat<COMS/common_utils>: auto start TEL to PIL socket
Ahelsamahy Jan 19, 2024
94aae1f
feat<COMS/common_utils>: create function to handle TEL-chatter
Ahelsamahy Jan 19, 2024
4062b9c
feat<COMS>: handle filtering robot_config from TEL_chatter
Ahelsamahy Jan 19, 2024
803681a
feat<SSH>: change logic for changing wifi visibility function
Ahelsamahy Jan 19, 2024
aa8bcd8
feat<SSH>: decrease connection time from 3 min to 76 seconds
Ahelsamahy Jan 19, 2024
467c4b5
style<SSH&COMS>: Sort imports
Ahelsamahy Jan 19, 2024
5734566
refactor<SSH>: remove sleeping time
Ahelsamahy Jan 19, 2024
3489847
feat<SSH>: save content of config files during connection
Ahelsamahy Jan 19, 2024
74dcafa
feat<SSH>: open and close current ssh socket manually
Ahelsamahy Jan 19, 2024
a7d3672
feat<SSH>: add closing to SSH connection
Ahelsamahy Jan 22, 2024
f224a0d
feat<COMS>: remove TeleopChatter handler to common_utils of COMS
Ahelsamahy Jan 22, 2024
f6587cf
feat<COMS>: move TEL chatter filter from main()
Ahelsamahy Jan 22, 2024
5a7faea
refactor<menu_robot>: remove the fake data from segments table
Ahelsamahy Jan 22, 2024
d7b4ef3
feat<COMS>: move application setup before TEL chatter class init
Ahelsamahy Jan 22, 2024
9e4746c
feat<TELmenu_robot>: bring back the scan functionality
Ahelsamahy Jan 23, 2024
deeba21
feat<TEL/menu_robot>: remove VIN and MAC from robot table
Ahelsamahy Jan 23, 2024
44d9065
refactor<TEL/menu_robot>: replace segmentData with segmentsData in de…
Ahelsamahy Jan 23, 2024
2809d35
feat<TEL/menu_robot>: start scanning when the page is loaded
Ahelsamahy Jan 23, 2024
dc65420
refactor<TEL/menu_robot>: remove add row button
Ahelsamahy Jan 23, 2024
813f2a4
feat<TEL/menu_robot>: work on update indices for seg in HTML table
Ahelsamahy Jan 23, 2024
8c84154
REFACTOR
Ahelsamahy Jan 23, 2024
d0698d6
feat<TEL/menu_robot>: move cell delete button to setupButton function
Ahelsamahy Jan 23, 2024
47cc342
refactor<TEL/menu_robot>: fix assigned data in the wifi-name tag of b…
Ahelsamahy Jan 23, 2024
39f0c7e
feat<SSH>: create function to check for static route
Ahelsamahy Jan 24, 2024
ad8224a
feat<COMS/commun_utils>: create class that runs a function in thread …
Ahelsamahy Jan 24, 2024
a1cafb0
feat<COMS/common_utils>: add thread function to check for static route
Ahelsamahy Jan 24, 2024
ffa287a
Merge branch 'master' into RFC0012_ConfigurationFile
Ahelsamahy Oct 18, 2024
7b0b3a3
refactor<pi/stream> to fix dynamic ip for the camera
Ahelsamahy Oct 18, 2024
d60937f
refactor<servos> move classes from app.py
Ahelsamahy Oct 18, 2024
471385f
refactors
Ahelsamahy Oct 18, 2024
b07a2c8
refactor<tel/robot_comm> add proper imports for byodr common utils fo…
Ahelsamahy Oct 21, 2024
866b7e2
refactor<tel=>veh> move the robot config from tel to veh
Ahelsamahy Oct 21, 2024
0ded3e6
refactor<coms> change application file directory
Ahelsamahy Oct 21, 2024
b954a25
refactor imports for common folders
Ahelsamahy Oct 21, 2024
51835e7
feat<veh> add ssh libraries
Ahelsamahy Oct 21, 2024
4915f4d
refactor<coms> organise imports
Ahelsamahy Oct 21, 2024
e4aab26
add coms service in docker compose of jetson
Ahelsamahy Oct 21, 2024
1123843
feat<tel> start application to get the configs
Ahelsamahy Oct 21, 2024
12cbaa4
remove ros from PIL
Ahelsamahy Oct 21, 2024
16f9591
refactor<coms> proper imports
Ahelsamahy Oct 21, 2024
c4f7de5
feat<pil> add coms socket communication
Ahelsamahy Oct 21, 2024
a6ad1ed
feat<veh> add robot config file checks
Ahelsamahy Oct 21, 2024
44b40d0
refactor
Ahelsamahy Oct 21, 2024
91a82de
feat<tel> add robot train UI components
Ahelsamahy Oct 22, 2024
9288d20
feat<tel/server.py> add "robot connection" endpoint to start the process
Ahelsamahy Oct 22, 2024
f8d34b8
feat<ssh> change the connection class to use UCI instead of directly …
Ahelsamahy Oct 23, 2024
b0e52bf
feat<tel> Add password prompt modal + styles
Ahelsamahy Oct 23, 2024
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"GPIO",
"Jetson",
"mjpeg",
"teleop"
"teleop",
"VESC"
],
"python.analysis.typeCheckingMode": "off",
"liveServer.settings.port": 5501,
Expand Down
2 changes: 2 additions & 0 deletions BYODR_utils/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def run(self):


class ApplicationExit(object):
"""Encapsulate the logic for checking if an application should exit and then performing the necessary action to shut down the application. It's designed as a callable object (using the __call__ method) so that it can be used like a function."""

def __init__(self, event, cb):
self._event = event
self._cb = cb
Expand Down
673 changes: 667 additions & 6 deletions BYODR_utils/common/ssh.py

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions jetson_runtime/coms/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM centipede2donald/ubuntu-bionic:python36-opencv32-gstreamer10

RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
python3-pip \
libxml2-dev \
libxslt1-dev \
unzip

RUN python3 -m pip install -U pip
RUN pip3 install paramiko pythonping


# Copy application files
COPY ./BYODR_utils/common/ /app/BYODR_utils/common/
COPY ./BYODR_utils/JETSON_specific/ /app/BYODR_utils/JETSON_specific/

COPY ./coms/coms /app/coms
ENV PYTHONPATH "/app:${PYTHONPATH}"
WORKDIR /app/coms

# CMD ["ls"]
CMD ["python3", "app.py","--name", "coms"]
Empty file.
55 changes: 55 additions & 0 deletions jetson_runtime/coms/coms/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import argparse
import logging
import multiprocessing
import signal


from coms.common_utils import *
from coms.robot_comm import *

# This flag starts as false
quit_event = multiprocessing.Event()
quit_event.clear()

signal.signal(signal.SIGINT, lambda sig, frame: _interrupt())
signal.signal(signal.SIGTERM, lambda sig, frame: _interrupt())


# Set the flag as true when we receive interrupt signals
def _interrupt():
logger.info("Received interrupt, quitting.")
quit_event.set()


def main():
# Adding the parser here for a static design pattern between all services
parser = argparse.ArgumentParser(description="Communication sockets server.")
parser.add_argument("--name", type=str, default="none", help="Process name.")
parser.add_argument("--config", type=str, default="/config", help="Config directory path.")
args = parser.parse_args()

application = ComsApplication(event=quit_event, config_dir=args.config)
application.setup()
tel_chatter = TeleopChatter(application.get_robot_config_file(), application.get_user_config_file())
socket_manager = SocketManager(tel_chatter, quit_event=quit_event)

socket_manager.start_threads()

logger.info("Ready")
try:
while not quit_event.is_set():
socket_manager.get_teleop_chatter()
except KeyboardInterrupt:
quit_event.set()
finally:
socket_manager.join_threads()

return 0


if __name__ == "__main__":
# Declaring the logger
logging.basicConfig(format="%(levelname)s: %(asctime)s %(filename)s %(funcName)s %(message)s", datefmt="%Y%m%d:%H:%M:%S %p %Z")
logging.getLogger().setLevel(logging.INFO)
logger = logging.getLogger(__name__)
main()
71 changes: 71 additions & 0 deletions jetson_runtime/coms/coms/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import socket
import logging
import time
import json
from BYODR_utils.JETSON_specific.utilities import Nano
nano_ip = Nano.get_ip_address()


# Declaring the logger
logger = logging.getLogger(__name__)
log_format = "%(levelname)s: %(filename)s %(funcName)s %(message)s"


class Segment_client():

# Method that is called after the class is being initiated, to give it its values
def __init__(self, arg_server_ip, arg_server_port, arg_timeout):

# Giving the class the values from the class call
self.server_ip = arg_server_ip # The IP of the server that the client will connect to
self.server_port = arg_server_port # The port of the server that the client will connect to
self.timeout = arg_timeout # Maybe 100ms
self.socket_initialized = False # Variable that keeps track if we have a functioning socket to a server
self.msg_to_server = None
self.msg_from_server = None

# The client socket that will connect to the server
self.client_socket = None


# Establish the connection to the server
def connect_to_server(self):

try:
# Close the current socket, if it exists
self.close_connection()

self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Remake the socket and reconnect
self.client_socket.settimeout(self.timeout) # Set the timeout for all the back and forth between the server/client
self.client_socket.connect((self.server_ip, self.server_port)) # Connect to the server
logger.info("[Client] Connected to server.")
self.socket_initialized = True

except Exception as e:
logger.warning(f"[Client] Got error trying to connect to the server: {e}.\nTrying to reconnect...")
time.sleep(2) # Wait for a while before retrying


# Close the malfunctioning socket if we lose connection to the server.
# We will make a new one and try to reconnect
def close_connection(self):

while self.socket_initialized:
try:
self.client_socket.shutdown(socket.SHUT_RDWR)
self.client_socket.close()
self.socket_initialized = False
except Exception as e:
logger.warning(f"[Client] Error while closing socket: {e}")
time.sleep(2)


# Sending data to the server
def send_to_FL(self):
message_to_send = json.dumps(self.msg_to_server)
self.client_socket.send(message_to_send.encode("utf-8"))


# Receiving data from the server
def recv_from_FL(self):
self.msg_from_server = self.client_socket.recv(512).decode("utf-8")
22 changes: 22 additions & 0 deletions jetson_runtime/coms/coms/command_processor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import logging
from BYODR_utils.common import timestamp


# Declaring the logger
logger = logging.getLogger(__name__)
log_format = "%(levelname)s: %(filename)s %(funcName)s %(message)s"



def process(movement_command):

if type(movement_command) is dict:

# We reverse throttle and inverse steering
movement_command["throttle"] = -(movement_command["throttle"])
movement_command["steering"] = -(movement_command["steering"])

# Replacing the received command's timestamp with a current one
movement_command["time"] = timestamp()

return movement_command
Loading