#include <PursuingComm.h>
Public Member Functions | |
PursuingComm (CommModule *commModule, TaskPlate plate, PursuingStates *currentStatePtr) | |
Constructor. | |
~PursuingComm () | |
Destructor. | |
void | setAutomaticReplies (bool automaticRepliesActivated) |
set of the property _automaticRepliesActivated | |
bool | getAutomaticReplies () |
get of the property _automaticRepliesActivated | |
string | getObjectName () const |
Gives the Name of the object. | |
void | sendCurrentPose (vector< uint > recipientIds, Pose currentPose) |
Sends the current pose of the robot to a list of recipients. | |
bool | sendCurrentState (vector< uint > recipientIds, PursuingStates currentState) |
Sends the current state of the robot to a list of recipients. | |
bool | sendGiveMeYourFrontier (uint recipientId) |
Sends a Frontier request to a robot. | |
bool | sendImNotAGuardAnymoreFrontier (uint recipientId) |
Tells a robot requesting my frontier that my state is no more guard. | |
bool | sendMyCurrentFrontier (uint recipientId, const vector< vector< Position > > &frontier) |
Sends a Frontier to a robot. | |
bool | sendYourUpdatedFrontier (uint recipientId, const vector< vector< Position > > &frontier) |
Sends an updated Frontier to a robot. | |
bool | sendCommandFollow (uint recipientId, Pose goal) |
Sends the command Follow to a robot, which should be a Follower. | |
bool | sendCommandExpand (uint recipientId, Pose goal) |
Sends the command Expand to a robot, which should be a Follower. | |
bool | sendCommandWander (uint recipientId) |
Sends the command Wander to a robot, which should be a Follower. | |
bool | sendIWannaBeYourFollower (uint recipientId) |
Asks a guard the permission to become its Follower. | |
bool | sendFollowMe (uint recipientId) |
Tells a robot to become my Follower. | |
bool | sendImNotAGuardAnymoreAffiliation (uint recipientId) |
Tells a would-be-follower that my state is no more guard. | |
void | receiveCurrentPoses (map< uint, TimeStampedPose > &poses) |
Gets incoming position messages. | |
void | receiveCurrentStates (map< uint, PursuingStates > &states) |
Gets incoming states messages. | |
bool | receiveCurrentFrontier (uint senderId, bool &positiveResponse, vector< vector< Position > > &frontier) |
Gets current frontier from a neighboring guard, i.e., the answer to sendGiveMeYourFrontier(). | |
bool | receiveUpdatedFrontier (uint senderId, vector< vector< Position > > &frontier) |
Gets the updated frontier from the neighboring robot to which the robot has just sent its current frontier. | |
bool | receiveGuardAcknowledgmentAffiliation (uint supposedGuardId, bool &accepted) |
Gets the answer of the "supposed to be" a guard, i.e., the answer to sendIWannaBeYourFollower(). | |
bool | receiveFollowerCommands (uint guardId, bool &follow, bool &expand, bool &wander, Pose &goal) |
Gets the answer of the "supposed to be" a guard, i.e., the answer to sendIWannaBeYourFollower(). | |
void | receiveUniversAsyncRequests (map< uint, PursuingMessageTypes > &asyncReq) |
Collects the universal asynchronous requests, i.e., asynchronous requests which can be received in all the states. |
MipTasks::PursuingComm::PursuingComm | ( | CommModule * | commModule, | |
TaskPlate | plate, | |||
PursuingStates * | currentStatePtr | |||
) |
Constructor.
[out] | commModule | Pointer to the communication module. |
[in] | plate | The id of the task which instanciates the PursuingComm |
[in] | currentStatePtr | a pointer to the current status of the task which instanciates the PursuingComm, readonly. |
MipTasks::PursuingComm::~PursuingComm | ( | ) |
Destructor.
void MipTasks::PursuingComm::setAutomaticReplies | ( | bool | automaticRepliesActivated | ) |
set of the property _automaticRepliesActivated
[in] | automaticRepliesActivated | the value to assign |
bool MipTasks::PursuingComm::getAutomaticReplies | ( | ) |
get of the property _automaticRepliesActivated
string MipTasks::PursuingComm::getObjectName | ( | ) | const [inline, virtual] |
Gives the Name of the object.
Implements MIPObject.
void MipTasks::PursuingComm::sendCurrentPose | ( | vector< uint > | recipientIds, | |
Pose | currentPose | |||
) |
Sends the current pose of the robot to a list of recipients.
[in] | recipientsIds | The vector containing the Ids of recipients. |
[in] | The | Pose of the robot. |
bool MipTasks::PursuingComm::sendCurrentState | ( | vector< uint > | recipientIds, | |
PursuingStates | currentState | |||
) |
Sends the current state of the robot to a list of recipients.
[in] | recipientsIds | The vector containing the Ids of recipients. |
[in] | The | current state of the robot. |
bool MipTasks::PursuingComm::sendGiveMeYourFrontier | ( | uint | recipientId | ) |
bool MipTasks::PursuingComm::sendImNotAGuardAnymoreFrontier | ( | uint | recipientId | ) |
Tells a robot requesting my frontier that my state is no more guard.
ssin]&recipientId | The Id of the guard robot to whom is sent the packet. |
bool MipTasks::PursuingComm::sendMyCurrentFrontier | ( | uint | recipientId, | |
const vector< vector< Position > > & | frontier | |||
) |
Sends a Frontier to a robot.
[in] | recipientId | The Id of the robot to whom ist sent the frontier. |
bool MipTasks::PursuingComm::sendYourUpdatedFrontier | ( | uint | recipientId, | |
const vector< vector< Position > > & | frontier | |||
) |
Sends an updated Frontier to a robot.
[in] | recipientId | The Id of the robot asked for its frontier. |
bool MipTasks::PursuingComm::sendCommandFollow | ( | uint | recipientId, | |
Pose | goal | |||
) |
Sends the command Follow to a robot, which should be a Follower.
[in] | recipientId | The Id of the robot to whom is sent the command. |
[in] | goal | The aim position of the follower. |
bool MipTasks::PursuingComm::sendCommandExpand | ( | uint | recipientId, | |
Pose | goal | |||
) |
Sends the command Expand to a robot, which should be a Follower.
[in] | recipientId | The Id of the robot to whom is sent the command. |
[in] | goal | The aim position of the follower. |
bool MipTasks::PursuingComm::sendCommandWander | ( | uint | recipientId | ) |
Sends the command Wander to a robot, which should be a Follower.
[in] | recipientId | The Id of the robot to whom is sent the command. |
bool MipTasks::PursuingComm::sendIWannaBeYourFollower | ( | uint | recipientId | ) |
Asks a guard the permission to become its Follower.
[in] | recipientId | The Id of the guard robot to whom is sent the request. |
bool MipTasks::PursuingComm::sendFollowMe | ( | uint | recipientId | ) |
Tells a robot to become my Follower.
[in] | recipientId | The Id of the guard robot to whom is sent the order |
bool MipTasks::PursuingComm::sendImNotAGuardAnymoreAffiliation | ( | uint | recipientId | ) |
Tells a would-be-follower that my state is no more guard.
[in] | recipientId | The Id of the wander robot to whom is sent the packet. |
void MipTasks::PursuingComm::receiveCurrentPoses | ( | map< uint, TimeStampedPose > & | poses | ) |
Gets incoming position messages.
[out] | &poses | uint x TimeStampedPose map reference, that will contain the positions received. |
void MipTasks::PursuingComm::receiveCurrentStates | ( | map< uint, PursuingStates > & | states | ) |
Gets incoming states messages.
[out] | &states | uint x PursuingStates map reference, that will contain the states received. |
bool MipTasks::PursuingComm::receiveCurrentFrontier | ( | uint | senderId, | |
bool & | positiveResponse, | |||
vector< vector< Position > > & | frontier | |||
) |
Gets current frontier from a neighboring guard, i.e., the answer to sendGiveMeYourFrontier().
[in] | senderId | Neighboring robot id. |
[out] | positiveResponse | bool reference indicating wether the frontier has been received or not: Is false when the robot which sends the message is no more a guard. |
[out] | frontier | reference which contains the frontier in the case it has been sent. |
bool MipTasks::PursuingComm::receiveUpdatedFrontier | ( | uint | senderId, | |
vector< vector< Position > > & | frontier | |||
) |
Gets the updated frontier from the neighboring robot to which the robot has just sent its current frontier.
[in] | senderId | Neighboring robot id. |
bool MipTasks::PursuingComm::receiveGuardAcknowledgmentAffiliation | ( | uint | supposedGuardId, | |
bool & | accepted | |||
) |
Gets the answer of the "supposed to be" a guard, i.e., the answer to sendIWannaBeYourFollower().
[in] | supposedGuardId | Neighboring robot id. |
[out] | accepted | Reference to a boolean, which will be set to True if the Follower has been accepted, to False otherwise. |
bool MipTasks::PursuingComm::receiveFollowerCommands | ( | uint | guardId, | |
bool & | follow, | |||
bool & | expand, | |||
bool & | wander, | |||
Pose & | goal | |||
) |
Gets the answer of the "supposed to be" a guard, i.e., the answer to sendIWannaBeYourFollower().
[in] | guardrId | Guard id. |
[out] | follow | Reference to a boolean, set to True if an order Follow has been received. |
[out] | expand | Reference to a boolean, set to True if an order Expand has been received. |
[out] | wander | Reference to a boolean, set to True if an order Wander has been received. |
[out] | Position | reference, which stores the position to reach in the case of a received Expand or Follow order. |
void MipTasks::PursuingComm::receiveUniversAsyncRequests | ( | map< uint, PursuingMessageTypes > & | asyncReq | ) |
Collects the universal asynchronous requests, i.e., asynchronous requests which can be received in all the states.
[out] | AsyncReq | A collection of universal asynchronous requests. |