Public Member Functions | Private Member Functions | Private Attributes
stdr_server::Server Class Reference

Implements the STDR server functionalities. More...

#include <stdr_server.h>

List of all members.

Public Member Functions

void deleteRobotCallback (const stdr_msgs::DeleteRobotGoalConstPtr &goal)
 Action callback for robot deletion.
bool loadExternalMapCallback (stdr_msgs::LoadExternalMap::Request &req, stdr_msgs::LoadExternalMap::Response &res)
 Service callback for loading the map from GUI.
bool loadMapCallback (stdr_msgs::LoadMap::Request &req, stdr_msgs::LoadMap::Response &res)
 Service callback for loading the map.
void registerRobotCallback (const stdr_msgs::RegisterRobotGoalConstPtr &goal)
 Action callback for robot registering.
 Server (int argc, char **argv)
 Default constructor.
void spawnRobotCallback (const stdr_msgs::SpawnRobotGoalConstPtr &goal)
 Action callback for robot spawning.

Private Member Functions

void activateActionServers (void)
 Initializes the spawn,delete,register action servers.
bool addCO2SourceCallback (stdr_msgs::AddCO2Source::Request &req, stdr_msgs::AddCO2Source::Response &res)
 Service callback for adding new CO2 source to the environment.
bool addNewRobot (stdr_msgs::RobotMsg description, stdr_msgs::SpawnRobotResult *result)
 Adds new robot to simulator.
bool addRfidTagCallback (stdr_msgs::AddRfidTag::Request &req, stdr_msgs::AddRfidTag::Response &res)
 Service callback for adding new rfid tag to the environment.
bool addSoundSourceCallback (stdr_msgs::AddSoundSource::Request &req, stdr_msgs::AddSoundSource::Response &res)
 Service callback for adding new sound source to the environment.
bool addThermalSourceCallback (stdr_msgs::AddThermalSource::Request &req, stdr_msgs::AddThermalSource::Response &res)
 Service callback for adding new thermal source to the environment.
bool deleteCO2SourceCallback (stdr_msgs::DeleteCO2Source::Request &req, stdr_msgs::DeleteCO2Source::Response &res)
 Service callback for deleting a CO2 source from the environment.
bool deleteRfidTagCallback (stdr_msgs::DeleteRfidTag::Request &req, stdr_msgs::DeleteRfidTag::Response &res)
 Service callback for deleting an rfid tag from the environment.
bool deleteRobot (std::string name, stdr_msgs::DeleteRobotResult *result)
 Deletes a robot from simulator.
bool deleteSoundSourceCallback (stdr_msgs::DeleteSoundSource::Request &req, stdr_msgs::DeleteSoundSource::Response &res)
 Service callback for deleting a sound source from the environment.
bool deleteThermalSourceCallback (stdr_msgs::DeleteThermalSource::Request &req, stdr_msgs::DeleteThermalSource::Response &res)
 Service callback for deleting a thermal source from the environment.
bool hasDublicateFrameIds (const stdr_msgs::RobotMsg &robot, std::string &f_id)

Private Attributes

ros::ServiceServer _addCO2SourceServiceServer
 The deleteCO2Source srv server.
ros::ServiceServer _addRfidTagServiceServer
 The deleteRfidTag srv server.
ros::ServiceServer _addSoundSourceServiceServer
 The deleteSoundSource srv server.
ros::ServiceServer _addThermalSourceServiceServer
 The deleteThermalSource srv server.
CO2SourceMap _CO2SourceMap
 An std::map that contains the thermal sources existent in the environment.
ros::Publisher _CO2SourceVectorPublisher
 The addThermalSource srv server.
ros::ServiceServer _deleteCO2SourceServiceServer
 The CO2 source list publisher.
ros::ServiceServer _deleteRfidTagServiceServer
 The rfid tag list publisher.
DeleteRobotServer _deleteRobotServer
 An std::map that contains the robots based on theor frame_id.
ros::ServiceServer _deleteSoundSourceServiceServer
 The sound source list publisher.
ros::ServiceServer _deleteThermalSourceServiceServer
 The thermal source list publisher.
int _id
 An std::map that contains the rfid tags existent in the environment.
ros::ServiceServer _loadExternalMapService
 Service server for moving robots.
ros::ServiceServer _loadMapService
 Service server for loading maps from GUI.
MapServerPtr _mapServer
 ROS publisher for the ensemble of robots.
ros::ServiceServer _moveRobotService
 Action server for registering robots.
boost::mutex _mut
 Boost condition variable for conflicting avoidance.
ros::NodeHandle _nh
 < THe ROS node handle
RegisterRobotServer _registerRobotServer
 Action server for spawning robots.
RfidTagMap _rfidTagMap
 An std::map that contains the CO2 sources existent in the environment.
ros::Publisher _rfidTagVectorPublisher
 The addCO2Source srv server.
RobotMap _robotMap
 Index that shows the next robot id.
ros::Publisher _robotsPublisher
 Action client for robot spawning.
SoundSourceMap _soundSourceMap
 Boost mutex for conflict avoidance.
ros::Publisher _soundSourceVectorPublisher
ros::ServiceClient _spawnRobotClient
 Action client for robot unloading.
SpawnRobotServer _spawnRobotServer
 Action server for deleting robots.
ThermalSourceMap _thermalSourceMap
 An std::map that contains the sound sources existent in the environment.
ros::Publisher _thermalSourceVectorPublisher
 The addSoundSource srv server.
ros::ServiceClient _unloadRobotClient
 Service server for loading maps from files.
boost::condition_variable cond
 The addRfidTag srv server.

Detailed Description

Implements the STDR server functionalities.

Definition at line 96 of file stdr_server.h.


Constructor & Destructor Documentation

stdr_server::Server::Server ( int  argc,
char **  argv 
)

Default constructor.

Parameters:
argc[int] Number of input arguments
argv[char**] The input arguments
Returns:
void Services --------------------------

< if we don't have map, no point to start servers

< Rfid tags

< CO2 sources

< Thermal sources

< Sound sources

Definition at line 30 of file stdr_server.cpp.


Member Function Documentation

void stdr_server::Server::activateActionServers ( void  ) [private]

Initializes the spawn,delete,register action servers.

Returns:
void

Definition at line 519 of file stdr_server.cpp.

bool stdr_server::Server::addCO2SourceCallback ( stdr_msgs::AddCO2Source::Request &  req,
stdr_msgs::AddCO2Source::Response &  res 
) [private]

Service callback for adding new CO2 source to the environment.

Parameters:
req[stdr_msgs::AddCO2Source::Request &] The request
res[stdr_msgs::AddCO2Source::Response &] The Response
Returns:
bool

< Sanity check for the source

< A source exists with the same id

< Publish the new source list

< Return success

Definition at line 176 of file stdr_server.cpp.

bool stdr_server::Server::addNewRobot ( stdr_msgs::RobotMsg  description,
stdr_msgs::SpawnRobotResult *  result 
) [private]

Adds new robot to simulator.

Parameters:
description[stdr_msgs::RobotMsg] The new robot description
result[stdr_msgs::SpawnRobotResult*] The action result
Returns:
bool

< wait until robot calls RobotRegisterAction

Definition at line 532 of file stdr_server.cpp.

bool stdr_server::Server::addRfidTagCallback ( stdr_msgs::AddRfidTag::Request &  req,
stdr_msgs::AddRfidTag::Response &  res 
) [private]

Service callback for adding new rfid tag to the environment.

Parameters:
req[stdr_msgs::AddRfidTag::Request &] The request
res[stdr_msgs::AddRfidTag::Response &] The Response
Returns:
bool

< Sanity check for the RFID tag

< A rfid tag exists with the same tag_id

< Publish the new RFID tag list

< Return success

Definition at line 143 of file stdr_server.cpp.

bool stdr_server::Server::addSoundSourceCallback ( stdr_msgs::AddSoundSource::Request &  req,
stdr_msgs::AddSoundSource::Response &  res 
) [private]

Service callback for adding new sound source to the environment.

Parameters:
req[stdr_msgs::AddSoundSource::Request &] The request
res[stdr_msgs::AddSoundSource::Response &] The Response
Returns:
bool

< Sanity check for the source

< A source exists with the same id

< Publish the new source list

< Return success

Definition at line 244 of file stdr_server.cpp.

bool stdr_server::Server::addThermalSourceCallback ( stdr_msgs::AddThermalSource::Request &  req,
stdr_msgs::AddThermalSource::Response &  res 
) [private]

Service callback for adding new thermal source to the environment.

Parameters:
req[stdr_msgs::AddThermalSource::Request &] The request
res[stdr_msgs::AddThermalSource::Response &] The Response
Returns:
bool

< Sanity check for the source

< A source exists with the same id

< Publish the new source list

< Return success

Definition at line 210 of file stdr_server.cpp.

bool stdr_server::Server::deleteCO2SourceCallback ( stdr_msgs::DeleteCO2Source::Request &  req,
stdr_msgs::DeleteCO2Source::Response &  res 
) [private]

Service callback for deleting a CO2 source from the environment.

Parameters:
req[stdr_msgs::DeleteCO2Source::Request &] The request
res[stdr_msgs::DeleteCO2Source::Response &] The Response
Returns:
bool

< Publish the new sources list

< Source does not exist

Definition at line 307 of file stdr_server.cpp.

bool stdr_server::Server::deleteRfidTagCallback ( stdr_msgs::DeleteRfidTag::Request &  req,
stdr_msgs::DeleteRfidTag::Response &  res 
) [private]

Service callback for deleting an rfid tag from the environment.

Parameters:
req[stdr_msgs::DeleteRfidTag::Request &] The request
res[stdr_msgs::DeleteRfidTag::Response &] The Response
Returns:
bool

< Publish the new RFID tag list

< Tag does not exist

Definition at line 278 of file stdr_server.cpp.

bool stdr_server::Server::deleteRobot ( std::string  name,
stdr_msgs::DeleteRobotResult *  result 
) [private]

Deletes a robot from simulator.

Parameters:
name[std::string] The robot frame_id
result[stdr_msgs::DeleteRobotResult*] The action result
Returns:
bool

Definition at line 571 of file stdr_server.cpp.

void stdr_server::Server::deleteRobotCallback ( const stdr_msgs::DeleteRobotGoalConstPtr &  goal)

Action callback for robot deletion.

Parameters:
goal[const stdr_msgs::DeleteRobotGoalConstPtr&] The action goal
Returns:
void

Definition at line 475 of file stdr_server.cpp.

bool stdr_server::Server::deleteSoundSourceCallback ( stdr_msgs::DeleteSoundSource::Request &  req,
stdr_msgs::DeleteSoundSource::Response &  res 
) [private]

Service callback for deleting a sound source from the environment.

Parameters:
req[stdr_msgs::DeleteSoundSource::Request &] The request
res[stdr_msgs::DeleteSoundSource::Response &] The Response
Returns:
bool

< Publish the new sources list

< Source does not exist

Definition at line 365 of file stdr_server.cpp.

bool stdr_server::Server::deleteThermalSourceCallback ( stdr_msgs::DeleteThermalSource::Request &  req,
stdr_msgs::DeleteThermalSource::Response &  res 
) [private]

Service callback for deleting a thermal source from the environment.

Parameters:
req[stdr_msgs::DeleteThermalSource::Request &] The request
res[stdr_msgs::DeleteThermalSource::Response &] The Response
Returns:
bool

< Publish the new sources list

< Source does not exist

Definition at line 336 of file stdr_server.cpp.

bool stdr_server::Server::hasDublicateFrameIds ( const stdr_msgs::RobotMsg &  robot,
std::string &  f_id 
) [private]

Definition at line 604 of file stdr_server.cpp.

bool stdr_server::Server::loadExternalMapCallback ( stdr_msgs::LoadExternalMap::Request &  req,
stdr_msgs::LoadExternalMap::Response &  res 
)

Service callback for loading the map from GUI.

Parameters:
req[stdr_msgs::LoadExternalMap::Request&] The service request
res[stdr_msgs::LoadExternalMap::Response&] The service response
Returns:
bool Actions --------------------------
Parameters:
req[stdr_msgs::LoadExternalMap::Request&] The service request
res[stdr_msgs::LoadExternalMap::Response&] The service response
Returns:
bool

< if we don't have map, no point to start servers

Definition at line 418 of file stdr_server.cpp.

bool stdr_server::Server::loadMapCallback ( stdr_msgs::LoadMap::Request &  req,
stdr_msgs::LoadMap::Response &  res 
)

Service callback for loading the map.

Parameters:
req[stdr_msgs::LoadMap::Request&] The service request
res[stdr_msgs::LoadMap::Response&] The service response
Returns:
bool

< if we don't have map, no point to start servers

Definition at line 397 of file stdr_server.cpp.

void stdr_server::Server::registerRobotCallback ( const stdr_msgs::RegisterRobotGoalConstPtr &  goal)

Action callback for robot registering.

Parameters:
goal[const stdr_msgs::RegisterRobotGoalConstPtr&] The action goal
Returns:
void

< notify spawn action, to reply to spawnner

Definition at line 503 of file stdr_server.cpp.

void stdr_server::Server::spawnRobotCallback ( const stdr_msgs::SpawnRobotGoalConstPtr &  goal)

Action callback for robot spawning.

Parameters:
goal[const stdr_msgs::SpawnRobotGoalConstPtr&] The action goal
Returns:
void

< publish to active_robots topic

Definition at line 439 of file stdr_server.cpp.


Member Data Documentation

The deleteCO2Source srv server.

Definition at line 318 of file stdr_server.h.

The deleteRfidTag srv server.

Definition at line 311 of file stdr_server.h.

The deleteSoundSource srv server.

Definition at line 332 of file stdr_server.h.

The deleteThermalSource srv server.

Definition at line 325 of file stdr_server.h.

An std::map that contains the thermal sources existent in the environment.

Definition at line 299 of file stdr_server.h.

The addThermalSource srv server.

Definition at line 323 of file stdr_server.h.

The CO2 source list publisher.

Definition at line 320 of file stdr_server.h.

The rfid tag list publisher.

Definition at line 313 of file stdr_server.h.

An std::map that contains the robots based on theor frame_id.

Definition at line 290 of file stdr_server.h.

The sound source list publisher.

Definition at line 334 of file stdr_server.h.

The thermal source list publisher.

Definition at line 327 of file stdr_server.h.

int stdr_server::Server::_id [private]

An std::map that contains the rfid tags existent in the environment.

Definition at line 295 of file stdr_server.h.

Service server for moving robots.

Definition at line 280 of file stdr_server.h.

Service server for loading maps from GUI.

Definition at line 278 of file stdr_server.h.

ROS publisher for the ensemble of robots.

Definition at line 269 of file stdr_server.h.

Action server for registering robots.

Definition at line 283 of file stdr_server.h.

boost::mutex stdr_server::Server::_mut [private]

Boost condition variable for conflicting avoidance.

Definition at line 306 of file stdr_server.h.

< THe ROS node handle

A pointer to a MapServe object

Definition at line 266 of file stdr_server.h.

Action server for spawning robots.

Definition at line 285 of file stdr_server.h.

An std::map that contains the CO2 sources existent in the environment.

Definition at line 297 of file stdr_server.h.

The addCO2Source srv server.

Definition at line 316 of file stdr_server.h.

Index that shows the next robot id.

Definition at line 292 of file stdr_server.h.

Action client for robot spawning.

Definition at line 272 of file stdr_server.h.

Boost mutex for conflict avoidance.

Definition at line 304 of file stdr_server.h.

Definition at line 335 of file stdr_server.h.

Action client for robot unloading.

Definition at line 274 of file stdr_server.h.

Action server for deleting robots.

Definition at line 287 of file stdr_server.h.

An std::map that contains the sound sources existent in the environment.

Definition at line 301 of file stdr_server.h.

The addSoundSource srv server.

Definition at line 330 of file stdr_server.h.

Service server for loading maps from files.

Definition at line 276 of file stdr_server.h.

boost::condition_variable stdr_server::Server::cond [private]

The addRfidTag srv server.

Definition at line 309 of file stdr_server.h.


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


stdr_server
Author(s): Chris Zalidis
autogenerated on Wed Sep 2 2015 03:36:34