Changes

m
Line 18: Line 18:  
===Code to Facilitate Development===
 
===Code to Facilitate Development===
 
To help easy development of specific modules in the Holonomic Robot, a communications interface is implemented between the Robot(Raspberry PI 4 Server) and a Laptop Development workstation(HP Client).  The protocol is built on TCP Tx-Rx Exchange between the two devices. The code modules are Python running at both ends.  The Robot starts out as a purely slaved device taking commands from the laptop.  Motor control modules manipulating the GPIO interface run on the Robot but are commanded by the laptop.  As the motor control is refined and routinized along with the growth of intrinsic autonomy, the code is transitioned from the Laptop to the Robot. Code is primarily developed in Python 3.7.
 
To help easy development of specific modules in the Holonomic Robot, a communications interface is implemented between the Robot(Raspberry PI 4 Server) and a Laptop Development workstation(HP Client).  The protocol is built on TCP Tx-Rx Exchange between the two devices. The code modules are Python running at both ends.  The Robot starts out as a purely slaved device taking commands from the laptop.  Motor control modules manipulating the GPIO interface run on the Robot but are commanded by the laptop.  As the motor control is refined and routinized along with the growth of intrinsic autonomy, the code is transitioned from the Laptop to the Robot. Code is primarily developed in Python 3.7.
====Robot to Laptop Base Communication Code====
+
====Laptop Code for Robot/Laptop Base Communication ====
 
<source lang="Python">
 
<source lang="Python">
# utf-8
  −
import system
   
import socket
 
import socket
 +
message_from_server = ''
 +
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 +
client.connect(('192.168.1.43', 13000))
 +
while True:
 +
    message = ''
 +
    message = input('Input lowercase sentence:')
 +
    client.send(message.encode())
 +
    message_from_server = (client.recv(4096)).decode()
 +
    print (message_from_server)
 +
    if message == "Stop the Server" : break
 +
client.close()
 +
print ("You ended the session")
 
</source>
 
</source>
 +
====Robot Code for Robot/Laptop Base Communication ====
4,000

edits