10 #include "wire_msgs/WorldEvidence.h" 11 #include "wire_msgs/ObjectEvidence.h" 19 void addEvidence(wire_msgs::WorldEvidence& world_evidence,
double x,
double y,
double z,
const std::string& class_label,
const std::string& color) {
20 wire_msgs::ObjectEvidence obj_evidence;
23 wire_msgs::Property posProp;
24 posProp.attribute =
"position";
28 obj_evidence.properties.push_back(posProp);
31 wire_msgs::Property classProp;
32 classProp.attribute =
"class_label";
38 obj_evidence.properties.push_back(classProp);
41 wire_msgs::Property colorProp;
42 colorProp.attribute =
"color";
48 obj_evidence.properties.push_back(colorProp);
51 world_evidence.object_evidence.push_back(obj_evidence);
58 wire_msgs::WorldEvidence world_evidence;
62 world_evidence.header.frame_id =
"/map";
65 addEvidence(world_evidence, 2, 2.2, 3,
"mug",
"red");
68 world_evidence_publisher_.
publish(world_evidence);
69 ROS_INFO(
"Published world evidence with size %d", world_evidence.object_evidence.size());
76 int main(
int argc,
char **argv) {
83 world_evidence_publisher_ = nh.
advertise<wire_msgs::WorldEvidence>(
"/world_evidence", 100);
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void addEvidence(wire_msgs::WorldEvidence &world_evidence, double x, double y, double z, const std::string &class_label, const std::string &color)
int main(int argc, char **argv)
ros::Publisher world_evidence_publisher_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void setProbability(const std::string &value, double p)
void PDFtoMsg(const PDF &pdf, problib::PDF &msg)