13 #include <multimaster_msgs_fkie/DiscoverMasters.h> 14 #include <mrpt_msgs/GraphSlamAgent.h> 15 #include <mrpt_msgs/GraphSlamAgents.h> 16 #include <mrpt_bridge/mrpt_bridge.h> 18 #include <mrpt/utils/COutputLogger.h> 19 #include <mrpt/system/datetime.h> 20 #include <mrpt/system/os.h> 21 #include <mrpt/system/string_utils.h> 22 #include <mrpt/math/utils.h> 32 namespace mrpt {
namespace graphslam {
namespace detail {
42 typedef mrpt_msgs::GraphSlamAgents::_list_type::iterator
agents_it;
43 typedef mrpt_msgs::GraphSlamAgents::_list_type::const_iterator
agents_cit;
47 mrpt::utils::COutputLogger*
logger,
61 bool ignore_self=
true);
115 const multimaster_msgs_fkie::ROSMaster& ros_master,
116 mrpt_msgs::GraphSlamAgent* slam_agent);
119 const mrpt_msgs::GraphSlamAgent& slam_agent,
120 multimaster_msgs_fkie::ROSMaster* ros_master);
127 unsigned short* agent_port=NULL);
153 const multimaster_msgs_fkie::ROSMaster& master1,
154 const multimaster_msgs_fkie::ROSMaster& master2);
156 const multimaster_msgs_fkie::ROSMaster& master1,
157 const multimaster_msgs_fkie::ROSMaster& master2);
165 const mrpt_msgs::GraphSlamAgent& agent1,
166 const mrpt_msgs::GraphSlamAgent& agent2);
168 const mrpt_msgs::GraphSlamAgent& agent1,
169 const mrpt_msgs::GraphSlamAgent& agent2);
171 const mrpt_msgs::GraphSlamAgent& agent1,
172 const mrpt_msgs::GraphSlamAgent& agent2);
180 const multimaster_msgs_fkie::ROSMaster& master,
181 const mrpt_msgs::GraphSlamAgent& agent);
183 const mrpt_msgs::GraphSlamAgent& agent,
184 const multimaster_msgs_fkie::ROSMaster& master);
186 const multimaster_msgs_fkie::ROSMaster& master,
187 const mrpt_msgs::GraphSlamAgent& agent);
189 const mrpt_msgs::GraphSlamAgent& agent,
190 const multimaster_msgs_fkie::ROSMaster& master);
const mrpt_msgs::GraphSlamAgents & getNearbySlamAgentsCached() const
Read-only method for accessing list of nearby agents. This doesn't update the internal list of GraphS...
bool operator!=(const multimaster_msgs_fkie::ROSMaster &master1, const multimaster_msgs_fkie::ROSMaster &master2)
void setupComm()
Wrapper method around the private setup* class methods.
const mrpt_msgs::GraphSlamAgents & getNearbySlamAgents()
Read-only method for accessing list of nearby agents.
bool operator==(const multimaster_msgs_fkie::ROSMaster &master1, const multimaster_msgs_fkie::ROSMaster &master2)
ROSMaster instances are considered the same if the "uri" field is the same.
void updateNearbySlamAgents()
Update the internal list of nearby SLAM agents.
mrpt_msgs::GraphSlamAgents::_list_type::const_iterator agents_cit
mrpt_msgs::GraphSlamAgents::_list_type::iterator agents_it
std::string own_ns
Namespace under which we are running. Corresponds to the agent_ID_str with which the nodes are going ...
ros::NodeHandle * m_nh
Pointer to the Ros NodeHanle instance.
mrpt_msgs::GraphSlamAgents m_nearby_slam_agents
List of slam agents in the current agent's neighborhood.
bool operator<(const mrpt_msgs::GraphSlamAgent &agent1, const mrpt_msgs::GraphSlamAgent &agent2)
const std::string & getTrimmedNs() const
Get the agent ROS namespace.
CConnectionManager(mrpt::utils::COutputLogger *logger, ros::NodeHandle *nh_in)
Constructor.
mrpt::utils::COutputLogger * m_logger
Pointer to the logging instance.
ros::ServiceClient m_DiscoverMasters_client
static std::string extractHostnameOrIP(const std::string &str, unsigned short *agent_port=NULL)
Remove http:// prefix and port suffix from the string and return result.
static bool convert(const multimaster_msgs_fkie::ROSMaster &ros_master, mrpt_msgs::GraphSlamAgent *slam_agent)
ROSMaster ==> mrpt_msgs::GraphSlamAgent.
~CConnectionManager()
Destructor.
Class responsible of handling the network communication between SLAM agents in the Multi-Robot graphS...