Sarafun Behavior Trees package  1
Behavior trees for the SARAFun project
 All Data Structures Namespaces Functions Variables Enumerations Enumerator
OnlineMotionAction.cpp
1 #include <sarafun_tree/demo_bt_nodes/OnlineMotionAction.h>
2 
3 namespace sarafun {
5  double timeout = 0;
6  fillParameter("/sarafun/bt/online_motion/timeout", 30.0, timeout);
7 
8  return timeout;
9 }
10 
11 bool OnlineMotionAction::fillGoal(sarafun_hqp_omg::OnlineMotionGoal &goal) {
12  double x = 0, y = 0, z = 0;
13 
14  ros::param::get(ros::this_node::getName() + "/position/x", x);
15  ros::param::get(ros::this_node::getName() + "/position/y", y);
16  ros::param::get(ros::this_node::getName() + "/position/z", z);
17 
18  goal.ref.position.x = x;
19  goal.ref.position.y = y;
20  goal.ref.position.z = z;
21 
22  goal.ref.orientation.x = 0;
23  goal.ref.orientation.y = 0;
24  goal.ref.orientation.z = 0;
25  goal.ref.orientation.w = 1;
26 
27  return true;
28 }
29 }
30 
31 int main(int argc, char **argv) {
32  ros::init(argc, argv, "online_motion_action");
33 
34  sarafun::OnlineMotionAction online_motion_action(
35  ros::this_node::getName(), "/sarafun/motion/online", ros::this_node::getName());
36 
37  ROS_INFO("Started %s!", ros::this_node::getName().c_str());
38  ros::spin();
39  return 1;
40 }
bool fillGoal(sarafun_hqp_omg::OnlineMotionGoal &goal)