$search
00001 #include "wire/WorldModelROS.h" 00002 00003 using namespace std; 00004 00005 double loop_rate_ = 20; 00006 00007 int main(int argc, char **argv) { 00008 00009 // Initialize node 00010 ros::init(argc, argv, "WorldModel"); 00011 ros::NodeHandle nh_private("~"); 00012 00013 mhf::WorldModelROS wm; 00014 00015 /* * * * * * * * * Load evidence topic names from parameters * * * * * * * * * */ 00016 00017 XmlRpc::XmlRpcValue evidence_topics; 00018 nh_private.getParam("evidence_topics", evidence_topics); 00019 00020 if (evidence_topics.getType() != XmlRpc::XmlRpcValue::TypeArray) { 00021 ROS_ERROR("Parameter 'evidence_topics' should be an array."); 00022 return -1; 00023 } 00024 00025 for (int i = 0; i < evidence_topics.size(); ++i) { 00026 XmlRpc::XmlRpcValue& evidence_topic = evidence_topics[i]; 00027 00028 if (evidence_topic.getType() != XmlRpc::XmlRpcValue::TypeString) { 00029 ROS_ERROR("Each evidence topic must be a string."); 00030 return -1; 00031 } 00032 00033 wm.registerEvidenceTopic((string)evidence_topic); 00034 } 00035 00036 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00037 00038 wm.startThreaded(); 00039 00040 ros::spin(); 00041 00042 return 0; 00043 }