20 #include <visualization_msgs/MarkerArray.h> 26 double marker_lifetime;
27 std::string dome_config_path;
28 std::string mild_config_path;
45 double timer_duration = 0.5;
55 std::string dome_marker_names =
"[ ";
57 dome_marker_names += m.ns +
" ";
59 dome_marker_names +=
"]";
63 std::string mild_marker_names =
"[ ";
65 mild_marker_names += m.ns +
" ";
67 mild_marker_names +=
"]";
90 std::string name = req.name;
93 ROS_WARN_STREAM(
"A marker with the name " << name <<
" is already being published");
98 bool marker_found =
false;
99 for (visualization_msgs::Marker m : marker_array.markers) {
107 ROS_WARN_STREAM(
"There is no available marker with the name " << name);
113 std::string name = req.name;
116 ROS_WARN_STREAM(
"A marker with the name " << name <<
" is already being published");
121 bool marker_found =
false;
122 for (visualization_msgs::Marker m : marker_array.markers) {
130 ROS_WARN_STREAM(
"There is no available marker with the name " << name);
136 std::string name = req.name;
137 for (std::vector<visualization_msgs::Marker>::iterator iter =
dome_markers_.markers.begin(); iter !=
dome_markers_.markers.end(); ++iter) {
138 if (iter->ns == name) {
147 std::string name = req.name;
148 for (std::vector<visualization_msgs::Marker>::iterator iter =
mild_markers_.markers.begin(); iter !=
mild_markers_.markers.end(); ++iter) {
149 if (iter->ns == name) {
161 std::vector<std::string> dome_marker_names;
162 for (visualization_msgs::Marker m : dome_markers.markers) {
163 dome_marker_names.push_back(m.ns);
166 std::vector<std::string> mild_marker_names;
167 for (visualization_msgs::Marker m : mild_markers.markers) {
168 mild_marker_names.push_back(m.ns);
171 res.dome_markers = dome_marker_names;
172 res.mild_markers = mild_marker_names;
179 int main(
int argc,
char** argv) {
static const std::string CLEAR_MODEL_DOME_SERVICE_NAME("clear_model_dome")
bool processClearAllModelsRequest(ClearAllModels::Request &req, ClearAllModels::Response &res)
visualization_msgs::MarkerArray getAllMarkersMild()
void publish(const boost::shared_ptr< M > &message) const
static const std::string DRAW_MODEL_MILD_SERVICE_NAME("draw_model_mild")
bool processDrawModelDomeRequest(DrawModelDome::Request &req, DrawModelDome::Response &res)
MarkerHelper marker_helper_
visualization_msgs::MarkerArray mild_markers_
ros::Publisher model_pub_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool processDrawAllModelsMildRequest(DrawAllModelsMild::Request &req, DrawAllModelsMild::Response &res)
int main(int argc, char **argv)
bool processDrawModelMildRequest(DrawModelMild::Request &req, DrawModelMild::Response &res)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool processDrawAllModelsDomeRequest(DrawAllModelsDome::Request &req, DrawAllModelsDome::Response &res)
ros::ServiceServer clear_all_service_
static const std::string DRAW_ALL_DOME_SERVICE_NAME("draw_all_models_dome")
visualization_msgs::MarkerArray getAllMarkersDome()
bool processClearModelDomeRequest(ClearModelDome::Request &req, ClearModelDome::Response &res)
visualization_msgs::MarkerArray dome_markers_
ros::ServiceServer draw_all_dome_service_
ros::Timer publish_timer_
ros::ServiceServer draw_model_dome_service_
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
static const std::string SHOW_AVAILABLE_MODELS_SERVICE_NAME("show_available_models")
void timerCallback(const ros::TimerEvent &e)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
static const std::string CLEAR_MODEL_MILD_SERVICE_NAME("clear_model_mild")
static const std::string DRAW_MODEL_DOME_SERVICE_NAME("draw_model_dome")
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
bool processShowAvailableModelsRequest(ShowAvailableModels::Request &req, ShowAvailableModels::Response &res)
static const std::string DRAW_ALL_MILD_SERVICE_NAME("draw_all_models_mild")
std::string output_models_topic_
static const std::string NODE_NAME("visualization")
bool getParam(const std::string &key, std::string &s) const
bool processClearModelMildRequest(ClearModelMild::Request &req, ClearModelMild::Response &res)
ros::ServiceServer clear_model_mild_service_
ros::ServiceServer clear_model_dome_service_
static const std::string CLEAR_ALL_MODELS_SERVICE_NAME("clear_all_models")
ros::ServiceServer show_available_models_service_
ros::ServiceServer draw_all_mild_service_
ros::ServiceServer draw_model_mild_service_