00001 #include <nav_msgs/Odometry.h>
00002 #include <ros/ros.h>
00003 #include <stdio.h>
00004 #include <tf/tf.h>
00005
00006 using namespace std;
00007 using namespace ros;
00008 using namespace nav_msgs;
00009
00010 void sendGoal(double x, double y, double theta, Publisher pub){
00011
00012 geometry_msgs::PoseStamped goal;
00013
00014
00015
00016 goal.pose.position.x = x;
00017 goal.pose.position.y = y;
00018 goal.pose.position.z = 0;
00019 btQuaternion temp;
00020 temp.setEulerZYX(theta,0,0);
00021 goal.pose.orientation.x = temp.getX();
00022 goal.pose.orientation.y = temp.getY();
00023 goal.pose.orientation.z = temp.getZ();
00024 goal.pose.orientation.w = temp.getW();
00025 goal.header.stamp = ros::Time::now();
00026 goal.header.frame_id = "/map";
00027 pub.publish(goal);
00028 }
00029
00030 int main(int argc, char** argv){
00031 ros::init(argc, argv, "demo_sbpl_dynamic_env");
00032
00033 Publisher robotGoal = ros::NodeHandle().advertise<geometry_msgs::PoseStamped>("/robot_0/move_base_simple/goal", 1);
00034 Publisher dynObsGoal1 = ros::NodeHandle().advertise<geometry_msgs::PoseStamped>("/robot_1/move_base_simple/goal", 1);
00035
00036
00037
00038
00039 sleep(10);
00040 ROS_DEBUG("fire one!\n");
00041 sendGoal(8.913, 6.913, 3.14159, dynObsGoal1);
00042 sleep(2);
00043
00044 ROS_DEBUG("fire two!\n");
00045 sendGoal(20.413, 6.913, 0.0, robotGoal);
00046
00047 ros::spin();
00048 }
00049