world_model.cpp
Go to the documentation of this file.
1 #include "wire/WorldModelROS.h"
2 
3 using namespace std;
4 
5 double loop_rate_ = 20;
6 
7 int main(int argc, char **argv) {
8 
9  // Initialize node
10  ros::init(argc, argv, "WorldModel");
11  ros::NodeHandle nh_private("~");
12 
14 
15  /* * * * * * * * * Load evidence topic names from parameters * * * * * * * * * */
16 
17  XmlRpc::XmlRpcValue evidence_topics;
18  nh_private.getParam("evidence_topics", evidence_topics);
19 
20  if (evidence_topics.getType() != XmlRpc::XmlRpcValue::TypeArray) {
21  ROS_ERROR("Parameter 'evidence_topics' should be an array.");
22  return -1;
23  }
24 
25  for (int i = 0; i < evidence_topics.size(); ++i) {
26  XmlRpc::XmlRpcValue& evidence_topic = evidence_topics[i];
27 
28  if (evidence_topic.getType() != XmlRpc::XmlRpcValue::TypeString) {
29  ROS_ERROR("Each evidence topic must be a string.");
30  return -1;
31  }
32 
33  wm.registerEvidenceTopic((string)evidence_topic);
34  }
35 
36  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
37 
38  wm.startThreaded();
39 
40  ros::spin();
41 
42  return 0;
43 }
int size() const
void registerEvidenceTopic(const std::string &topic_name)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Type const & getType() const
ROSCPP_DECL void spin(Spinner &spinner)
double loop_rate_
Definition: world_model.cpp:5
bool getParam(const std::string &key, std::string &s) const
int main(int argc, char **argv)
Definition: world_model.cpp:7
#define ROS_ERROR(...)


wire_core
Author(s): Sjoerd van den Dries, Jos Elfring
autogenerated on Fri Apr 16 2021 02:32:27