![]() |
CRINSA-team2024 2024
Documentation du Club Robot INSA Rennes 2024
|
Est dérivée de TCPTalks.
Fonctions membres publiques | |
| __init__ (self, ID, ip="192.168.12.1", port=_BEACON_PORT) | |
| reset_ressources (self) | |
| get_ressource (self, name) | |
| release_ressource (self, name) | |
| is_active (self) | |
| get_brother_pos (self) | |
| get_opponents_pos (self) | |
| get_side (self) | |
| get_final_orientation (self) | |
Fonctions membres protégées | |
| _refresh (self) | |
| _get_my_pos (self) | |
| _get_my_final_orientation (self) | |
The Global sync client is used to interconnect robots or beacon using TCPTalks protocol
Args:
TCPTalks (class): The TCPTalks client class
| global_sync.ClientGS.__init__ | ( | self, | |
| ID, | |||
| ip = "192.168.12.1", | |||
| port = _BEACON_PORT ) |
Initialize the client with its id and ip,port. The id is the robot or beacon id (ex: _BORNIBUS_ID)
Args:
ID (int): Robot or beacon id
ip (str, optional): The server ip. Defaults to "192.168.12.1".
port (int, optional): The server port. Defaults to _BEACON_PORT.

|
protected |
Used internally to return the wheatervane orientation, redifined by EY
Returns:
None

|
protected |
Internal method to give my pos to my brother, by default, return my pos outise of the game area, it can be redefined by the Robot Client
Returns:
tuple: my x, y, theta position

|
protected |
Refresh
Returns:
Bool : true

| global_sync.ClientGS.get_brother_pos | ( | self | ) |
Get the pos of our brother robot in order to avoid it
Returns:
tuple: The brother x, y, theta position

| global_sync.ClientGS.get_final_orientation | ( | self | ) |
Get final wheathervane orientation
Returns:
int: the orientation

| global_sync.ClientGS.get_opponents_pos | ( | self | ) |
Get the opponent pos from the supervior beacon that can detect oppoenets whith the ArUco tags
Returns:
list of tuple: The the all opponents [(x, y, theta), (x, y, theta)] position

| global_sync.ClientGS.get_ressource | ( | self, | |
| name ) |
Distributed mutex to lock resources on the server (ex: access to a shared action)
Args:
name (string): The ressource name
Returns:
Bool: Exist or not

| global_sync.ClientGS.get_side | ( | self | ) |
Get the side configured on the robot
Returns:
int : Side color

| global_sync.ClientGS.is_active | ( | self | ) |
Check if the client and server is connected
Returns:
bool : Connected or not

| global_sync.ClientGS.release_ressource | ( | self, | |
| name ) |
Distributed mutex to unlock resources on the server (ex: access to a shared action)
Args:
name (string): The ressource name

| global_sync.ClientGS.reset_ressources | ( | self | ) |
Reset all server ressources
