state_tracker.cpp
Go to the documentation of this file.
00001 #include "actions/LogicalNavigation.h"
00002 #include "actionlib_msgs/GoalStatusArray.h"
00003 #include <ros/ros.h>
00004 using namespace bwi_krexec;
00005 using namespace actasp;
00006 
00007 void updateStates(const actionlib_msgs::GoalStatusArray::ConstPtr& msg) {
00008     ROS_INFO_STREAM(msg->status_list[0]);
00009     //if ((msg->status_list[0].status > 1) and (msg->status_list[0].status < 6)  or (msg->status_list[0].status == 8)) { //2,3,4,5,8 are terminal states
00010     if (((*(msg->status_list.end())).status == 3)) {
00011         LogicalNavigation setState("noop");
00012         setState.run();
00013     }
00014 }
00015 
00016 int main(int argc, char**argv) {
00017     ros::init(argc, argv, "state_tracker");
00018     ros::NodeHandle n;
00019     ros::Subscriber sub = n.subscribe("/execute_logical_goal/status", 1, updateStates);
00020 
00021     while (ros::ok()) {
00022         ros::Duration(5).sleep();
00023         ros::spinOnce();
00024     }
00025 }


bwi_kr_execution
Author(s): Matteo Leonetti, Piyush Khandelwal
autogenerated on Thu Jun 6 2019 17:57:37