Client Communication
Example
This example shows how to use the client communication. The code below uses the wrapper to create an instance of a client communication to be able to send messages to the robots.
my_computer = wrapper.get_client(client_id='MyUniqueName', host_ip='http://127.0.0.1:8000')
while(True):
if(my_computer.has_receive_msg()):
msg = my_computer.receive_msg()
print(msg)
Code
- class SocketClientCommunication(client_id, host_ip='http://127.0.0.1:8000')
Client Communication is a ready to go class that let you connect to the host communication of the package.
- get_id()
Get the id of the client
- send_msg(msg)
- Parameters:
msg – any
- get_available_epucks()
- Parameters:
msg – any
- send_msg_to(dest_client_id, msg)
Send a message to a specific id client
- has_receive_msg()
- Returns:
True if the robot has pending messages in his queue otherwise False.
- receive_msg()
Get next message from the robots queue otherwise throws an error.
- clean_msg()
Deletes all its pending messages
- stream_img(img)
Warning
Only works with robots
- send_init_camera()
Warning
Only works with robots
- send_disable_camera()
Warning
Only works with robots