 |
Multi-robot Playground
|
Go to the documentation of this file.
53 #include "nav_msgs/OccupancyGrid.h"
54 #include "std_msgs/String.h"
55 #include "std_msgs/Int8MultiArray.h"
56 #include "multirobotsimulations/CustomPose.h"
57 #include "multirobotsimulations/Frontiers.h"
58 #include "multirobotsimulations/rendezvous.h"
59 #include "visualization_msgs/Marker.h"
168 int SelectFrontier(multirobotsimulations::Frontiers& centroids, tf::Vector3& selectFrontierWorld);
177 void CreateMarker(visualization_msgs::Marker& input,
const char* ns,
const int&
id,
const int& seq);
183 void SetGoal(
const tf::Vector3& goal);
275 void CommCallback(std_msgs::Int8MultiArray::ConstPtr msg);
283 std::shared_ptr<RendezvousPlan>
aPlan;
void SetGoal(const tf::Vector3 &goal)
Set the goal location to visit, it could be a rendezvousl location or a frontier cluster center of ma...
nav_msgs::OccupancyGrid aCSpaceMsg
Message used to store meta data from the occupancy grid to help converting world positions to positio...
Definition: Alysson2024Node.h:230
ros::Time aLastTime
The last capatured system time used to compute the dalta time.
Definition: Alysson2024Node.h:203
void SetBasestationCallback(std_msgs::String::ConstPtr msg)
Callback this node uses to go back to the basestation.
@ state_waiting_centroids
in this state, the robot waits for frontier clusters.
Definition: Alysson2024Node.h:76
tf::Vector3 aGoalFrontier
Temp variable used to store which frontier this robot should explore next.
Definition: Alysson2024Node.h:205
@ state_exploring
state responsible to explore a selected location.
Definition: Alysson2024Node.h:70
double aTimeWaiting
Counter to help checking if this robot is waiting for too long.
Definition: Alysson2024Node.h:282
int SelectFrontier(multirobotsimulations::Frontiers ¢roids, tf::Vector3 &selectFrontierWorld)
Select which frontier to explore from the message received by the FrontierDiscovery node.
std::string aNamespace
The namespace of this robot.
Definition: Alysson2024Node.h:207
tf::Vector3 aNewRendezvousLocation
Helper variable used to keep track where this robot should meet next with its current sub-team.
Definition: Alysson2024Node.h:294
@ state_planning
in this state, the robot asks for new frontier clusters and also selects which one to explore.
Definition: Alysson2024Node.h:78
@ state_updating_plan
in this state, the consensus robot updates the plan and send to the other robots.
Definition: Alysson2024Node.h:86
int SelectSubteamNewRendezvous(multirobotsimulations::Frontiers ¢roids, tf::Vector3 &selectFrontierWorld)
Select a new rendezvous location that is the frontier with the highest cost (i.e.,...
double aWaitingThreshold
The maximum allowed waiting time in rendezvous location.
Definition: Alysson2024Node.h:280
std::vector< ros::Subscriber > aSubscribers
All subscribers of this node.
Definition: Alysson2024Node.h:218
@ state_set_rendezvous_location
in this state, the robot starts navigating towards its current sub-team rendezvous location.
Definition: Alysson2024Node.h:83
@ state_set_back_to_base
in this state, the robot navigates towards the basestation.
Definition: Alysson2024Node.h:77
bool aDirty
Used to initialize the basestation location in the main loop only once.
Definition: Alysson2024Node.h:199
int aRobots
Number of robots this robot should be aware.
Definition: Alysson2024Node.h:195
tf::Vector3 aGoalRendezvous
Helper variable that holds the location of the rendezvous location.
Definition: Alysson2024Node.h:293
multirobotsimulations::Frontiers aFrontierCentroidsMsg
Message used to receive frontier clusters.
Definition: Alysson2024Node.h:229
double aDeltaTime
Delta time between iterations in the main loop.
Definition: Alysson2024Node.h:201
@ state_navigating_to_rendezvous
in this state, the robot simply navigate towards the assigned rendezvous location.
Definition: Alysson2024Node.h:84
Node that implements the intermittent communication policy.
Definition: Alysson2024Node.h:99
std::unique_ptr< std::mt19937 > aRandomNumberGenerator
Random number generator for randomized social welfare.
Definition: Alysson2024Node.h:295
tf::Vector3 aGoalBasestation
The goal position of the basestation.
Definition: Alysson2024Node.h:206
std::shared_ptr< RendezvousPlan > aPlan
The rendezvous plan object used to control how agreements are executed, their order,...
Definition: Alysson2024Node.h:283
bool CheckNear()
Used to help checking if there are other robots nearby.
tf::Vector3 aRendezvousFootprint
The rendezvous location this robot should go when inside a rendezous zone.
Definition: Alysson2024Node.h:291
@ state_select_new_rendezvous
in this state, the consensus robot sends the new rendezvous locations to all other robots.
Definition: Alysson2024Node.h:89
@ state_select_frontier
state responsible to select which frontier cluster to explore.
Definition: Alysson2024Node.h:69
void SetExploringCallback(std_msgs::String::ConstPtr msg)
Callback this node uses to change its internal state to start exploring.
void EstimatePoseCallback(multirobotsimulations::CustomPose::ConstPtr msg)
Callback for pose estimator from the SLAM algorithm.
@ state_waiting_consensus
in this state, the other robots wait for the information from the consensus robot.
Definition: Alysson2024Node.h:87
multirobotsimulations::CustomPose aRendezvousNewPoseMsg
Custom pose used to tell the other robots which location they should meet next with their current sub...
Definition: Alysson2024Node.h:288
void ClustersCallback(multirobotsimulations::Frontiers::ConstPtr msg)
Callback for the FrontierDiscovery node to update rendezvous locations or for planning.
int aRate
Main loop rate.
Definition: Alysson2024Node.h:194
bool aHasOcc
Used to known when this robot received its OccupancyGrid information from the SLAM sub-system.
Definition: Alysson2024Node.h:198
std::vector< ros::Timer > aTimers
Routines of this node.
Definition: Alysson2024Node.h:213
ros::Publisher aPlanRealizationPublisher
Publisher used to help synchronize who is fulfilling a rendezvous agreement.
Definition: Alysson2024Node.h:299
void CSpaceCallback(nav_msgs::OccupancyGrid::ConstPtr msg)
Callback from the MapStitching node that is used to receive meta data from the map.
@ state_exploration_finished
this states marks the end of the mission when all frontiers were explored.
Definition: Alysson2024Node.h:72
Alysson2024Node()
Default constructor that initializes all ros advertisers, publishers, and routines.
int aId
Unique id.
Definition: Alysson2024Node.h:196
ros::Publisher aGoalPublisher
This publisher is used to tell the global planner, which goal location the robot should visit next.
Definition: Alysson2024Node.h:223
void CommCallback(std_msgs::Int8MultiArray::ConstPtr msg)
Callback of the MockCommunication model used to check which robots are nearby.
std::random_device aRandomNumberDevice
Random device to use with std::mt19937 to generate random numbers.
Definition: Alysson2024Node.h:296
@ state_idle
in this state the robot waits for commands.
Definition: Alysson2024Node.h:71
~Alysson2024Node()
Default destructor.
bool aReceivedNewRendezvousLocation
Flag used to check if this robot received new rendezvous location in the it is not the consensus robo...
Definition: Alysson2024Node.h:279
ExplorerState
Definition: Alysson2024Node.h:68
ExplorerState aCurrentState
The current state of the robot.
Definition: Alysson2024Node.h:208
void ChangeState(const ExplorerState &newState)
Change the state of the robot and print information about the change.
ros::Publisher aFrontierComputePublisher
This publisher is used to request the FrontierDiscovery module to compute new frontier clusters.
Definition: Alysson2024Node.h:224
@ state_back_to_base
this state tells that the robot is going to the initial basestation location.
Definition: Alysson2024Node.h:73
void Update()
Node's main update routine.
bool aHasComm
Flag used to check if the robot received the mock communication model communications array.
Definition: Alysson2024Node.h:278
tf::Vector3 aFirstRendezvous
Store the location of the first rendezvous location for all sub-teams.
Definition: Alysson2024Node.h:292
bool aFirst
Used to skip the first delta time calculation to avoid major errors.
Definition: Alysson2024Node.h:200
std_msgs::Int8MultiArray aCommMsg
Message to receive information from the mock communication model node.
Definition: Alysson2024Node.h:286
void CreateMarker(visualization_msgs::Marker &input, const char *ns, const int &id, const int &seq)
Create a marker to mark selected goal locations (e.g., rendezvous locations or frontier clusters).
tf::Vector3 aWorldPos
The position of the robot in the world reference frame.
Definition: Alysson2024Node.h:204
@ state_compute_centroids
used to wait for the FrontierDiscovery to return frontier clusters.
Definition: Alysson2024Node.h:75
bool FinishedMission()
Check if there are places left to explore.
void SetIdleCallback(std_msgs::String::ConstPtr msg)
Callback this node uses to stop the mission and enter in idle mode.
@ state_back_to_base_finished
this state is used to identify when the robot reached the basestation.
Definition: Alysson2024Node.h:74
void SubGoalFinishCallback(std_msgs::String::ConstPtr msg)
Callback from the IntegratedGlobalPlanner node that is called when the robot reached the assigned goa...
bool aHasPose
Used to known when this robot received its estimate pose from the SLAM sub-system.
Definition: Alysson2024Node.h:197
ros::Publisher aPlanLocationPublisher
Publisher to broadcast new rendezvous locations for the current sub-team.
Definition: Alysson2024Node.h:300
@ state_waiting_centroids_for_plan
in this state the consensus robot waits for clusters to use as reference updates for new rendezvous l...
Definition: Alysson2024Node.h:88
int aQueueSize
Size of all publishers and subscribers queues.
Definition: Alysson2024Node.h:193
@ state_at_rendezvous
in this state, the robot reached the rendezvous location and can start updating the plan or waiting f...
Definition: Alysson2024Node.h:85
multirobotsimulations::rendezvous aRendezvousMsg
Message that helps the consensus robot sending new rendezvous locations to other robots.
Definition: Alysson2024Node.h:287
Vec2i aOccPos
The position of the robot in the Occupancy Grid reference frame.
Definition: Alysson2024Node.h:202
bool CanCommunicate(const int &id)
Used to check if this robot can communicate with another.
int RandomizedFrontierSelection(multirobotsimulations::Frontiers ¢roids, tf::Vector3 &selectFrontierWorld)
Select a randomized frontier.