Wrapper
About
The wrapper lets you get an instance of an e-puck robot.
Code
- get_robot(ip_addr=None, is_pipuck=False)
Get the instance of an e-puck
Note
Leave the parameters empty if you will be using Webots
- Parameters:
ip_addr – ip address of the e-puck
is_pipuck – boolean
- Returns:
instance of the e-puck
- get_client(client_id, host_ip='localhost')
Get an instance of a client for communication
- Parameters:
client_id – put an unique name id for the communication
- Returns:
instance of a ClientCommunication
Examples
To get an instance of a real e-puck with its ip address:
from unifr_api_epuck import wrapper
my_robot = wrapper.get_robot('192.168.43.125')
To get an instance of a simulated e-puck in Webots:
from unifr_api_epuck import wrapper
my_robot = wrapper.get_robot()
To get an instance of the e-puck from the pi-puck
from unifr_api_epuck import wrapper
#ip address of the pi-puck
my_robot = wrapper.get_robot('192.168.43.11', is_pipuck = True)
To get an instance of a client communication for a PC
from unifr_api_epuck import wrapper
my_computer = wrapper.get_client('computer_192.168.112.24')
my_computer.init_client_communication('192.168.112.24')