update navi server

This commit is contained in:
Robot 2019-12-10 08:18:00 +08:00
parent 32842a4136
commit 3fa7302149
2 changed files with 16 additions and 16 deletions

View File

@ -68,20 +68,20 @@ int main(int argc, char** argv)
MoveBaseClient ac("move_base", true);
move_base_msgs::MoveBaseGoal goal;
//wait for the action server to come up
while(!ac.waitForServer(ros::Duration(5.0)))
{
if(!ros::ok())
break;
ROS_INFO("Waiting for the move_base action server to come up");
}
ros::Rate r(30);
while(ros::ok())
{
if(bNewCmd)
{
//wait for the action server to come up
while(!ac.waitForServer(ros::Duration(5.0)))
{
if(!ros::ok())
break;
ROS_INFO("Waiting for the move_base action server to come up");
}
goal.target_pose.header.frame_id = "map";
goal.target_pose.header.stamp = ros::Time::now();
goal.target_pose.pose = goal_pose;

View File

@ -83,20 +83,20 @@ int main(int argc, char** argv)
MoveBaseClient ac("move_base", true);
move_base_msgs::MoveBaseGoal goal;
//wait for the action server to come up
while(!ac.waitForServer(ros::Duration(5.0)))
{
if(!ros::ok())
break;
ROS_INFO("Waiting for the move_base action server to come up");
}
ros::Rate r(30);
while(ros::ok())
{
if(bNewCmd)
{
//wait for the action server to come up
while(!ac.waitForServer(ros::Duration(5.0)))
{
if(!ros::ok())
break;
ROS_INFO("Waiting for the move_base action server to come up");
}
goal.target_pose.header.frame_id = "map";
goal.target_pose.header.stamp = ros::Time::now();
goal.target_pose.pose = wp_pose;