9 #include "wire_msgs/ObjectState.h" 10 #include "wire_msgs/WorldState.h" 22 double w_best = min_weight;
31 if (G && w > w_best) {
43 ROS_INFO(
"Received world state with %d objects", msg->objects.size());
50 wire_msgs::ObjectState obj = *it_obj;
64 if (it_prop->attribute ==
"class_label") {
71 ROS_INFO(
" - class %s with probability %f", label.c_str(), p);
74 else if (it_prop->attribute ==
"position") {
83 ROS_INFO(
" - position: object position unknown (uniform distribution)");
92 ROS_INFO(
" - position: (%f,%f,%f)", pos(0), pos(1), pos(2));
93 ROS_INFO(
" - diagonal position cov: (%f,%f,%f)",
99 else if (it_prop->attribute ==
"orientation") {
101 if (orientation_pdf) {
103 if (orientation_gauss) {
105 ROS_INFO(
" - orientation: (%f,%f,%f,%f)", ori(0), ori(1), ori(2), ori(3));
108 ROS_INFO(
" - orientation: object orientation unknown (uniform distribution)");
112 else if (it_prop->attribute ==
"color") {
115 ROS_INFO(
" - color: %s", color.c_str());
127 int main(
int argc,
char **argv) {
128 ros::init(argc, argv,
"get_world_state");
double getProbability(const std::string &value) const
PDF * msgToPDF(const problib::PDF &msg)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
virtual bool getExpectedValue(std::string &v) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void worldStateCallback(const wire_msgs::WorldState::ConstPtr &msg)
const PMF * PDFtoPMF(const PDF &pdf)
const arma::mat & getCovariance() const
const PDF & getComponent(int i) const
const_iterator(const field< oT > &in_M, const bool at_end=false)
const arma::vec & getMean() const
const pbl::Gaussian * getBestGaussianFromMixture(const pbl::Mixture &mix, double min_weight=0)
double getWeight(int i) const
const Mixture * PDFtoMixture(const PDF &pdf)
const Gaussian * PDFtoGaussian(const PDF &pdf)
int main(int argc, char **argv)