MipTasks::PursuingComm Class Reference
[Pursuing]

Task for pursuing. More...

#include <PursuingComm.h>

Inheritance diagram for MipTasks::PursuingComm:

MIPObject

List of all members.

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.


Detailed Description

Task for pursuing.

Author:
Antonio Franchi and Arnaud Dufranne

Constructor & Destructor Documentation

MipTasks::PursuingComm::PursuingComm ( CommModule commModule,
TaskPlate  plate,
PursuingStates currentStatePtr 
)

Constructor.

Parameters:
[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.


Member Function Documentation

void MipTasks::PursuingComm::setAutomaticReplies ( bool  automaticRepliesActivated  ) 

set of the property _automaticRepliesActivated

Parameters:
[in] automaticRepliesActivated the value to assign

bool MipTasks::PursuingComm::getAutomaticReplies (  ) 

get of the property _automaticRepliesActivated

Returns:
the value of the parameter

string MipTasks::PursuingComm::getObjectName (  )  const [inline, virtual]

Gives the Name of the object.

Returns:
string the name of the object as a string

Implements MIPObject.

void MipTasks::PursuingComm::sendCurrentPose ( vector< uint >  recipientIds,
Pose  currentPose 
)

Sends the current pose of the robot to a list of recipients.

Parameters:
[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.

Parameters:
[in] recipientsIds The vector containing the Ids of recipients.
[in] The current state of the robot.

bool MipTasks::PursuingComm::sendGiveMeYourFrontier ( uint  recipientId  ) 

Sends a Frontier request to a robot.

Parameters:
[in] recipientId The Id of the robot asked for its frontier.

bool MipTasks::PursuingComm::sendImNotAGuardAnymoreFrontier ( uint  recipientId  ) 

Tells a robot requesting my frontier that my state is no more guard.

Parameters:
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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[in] recipientId The Id of the robot to whom is sent the command.
[in] goal The aim position of the follower.
Note:
the goal could become a path in further developments.

bool MipTasks::PursuingComm::sendCommandExpand ( uint  recipientId,
Pose  goal 
)

Sends the command Expand to a robot, which should be a Follower.

Parameters:
[in] recipientId The Id of the robot to whom is sent the command.
[in] goal The aim position of the follower.
Note:
the goal could become a path in further developments.

bool MipTasks::PursuingComm::sendCommandWander ( uint  recipientId  ) 

Sends the command Wander to a robot, which should be a Follower.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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().

Parameters:
[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.
Returns:
false if no such a packet was received yet. true otherwise.

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.

Parameters:
[in] senderId Neighboring robot id.
Returns:
False if no such a packet was received yet. True otherwise.

bool MipTasks::PursuingComm::receiveGuardAcknowledgmentAffiliation ( uint  supposedGuardId,
bool &  accepted 
)

Gets the answer of the "supposed to be" a guard, i.e., the answer to sendIWannaBeYourFollower().

Parameters:
[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.
Returns:
False if no such a packet was received yet. True 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().

Parameters:
[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.
Returns:
False if no such a packet was received yet. True otherwise.

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.

Parameters:
[out] AsyncReq A collection of universal asynchronous requests.


The documentation for this class was generated from the following files:

Generated on Mon Feb 20 07:01:13 2017 for MIP by  doxygen 1.5.6