class_example.cpp
Go to the documentation of this file.
00001 /*
00002  * Example for abstract class implementation
00003  */
00004 
00005 #include <ros/ros.h>
00006 #include <bt_action.h>
00007 
00008 
00009 class StartCondition: public BTAction
00010 {
00011 public:
00012     bool start_condition = false;
00013     ros::NodeHandle nh_;
00014 
00015     StartCondition(ros::NodeHandle* n) :
00016             BTAction("StartCondition"),
00017             nh_(*n)
00018     {
00019         nh_.param("/start_condition", start_condition, false);
00020     }
00021 
00022     void execute_callback(const behavior_tree_core::BTGoalConstPtr &goal)
00023     {
00024         set_status(SUCCESS);
00025         // if (start_condition)
00026             // set_status(SUCCESS);
00027         // else
00028             // set_status(FAILURE);
00029     }
00030 };
00031 
00032 int main(int argc, char** argv)
00033 {
00034     ros::init(argc, argv, "start_conditions");
00035     ros::NodeHandle nh;
00036     StartCondition sc(&nh);
00037     ros::spin();
00038     return 0;
00039 }


behavior_tree_leaves
Author(s): Michele Colledanchise
autogenerated on Thu Jun 6 2019 18:19:15