Jolin, While you're right that the intended server is move_base, I'm afraid its not as simple as just rosrunning the move_base node. You'll first need to configure it for your platform following this tutorial: http://www.ros.org/wiki/navigation/Tutorials/RobotSetup. Unless someone has the navigation stack configured for a Pioneer 3 already and wants to share? Hope all is well, Eitan 2010/11/4 Jolin Jia > Hi, > > I am learning sending a simple navigation goal to the robot in the website > of http://www.ros.org/wiki/navigation/Tutorials/SendingSimpleGoals. And I > found the simple_navigation_goals package is just the client. There must be > a server. So I write the code of server, but I am shamed that I don't very > understand the operating mechanism of the server. The file for the server is > as following: > > =======================================simple_navigation_server.cpp============================== > #include > #include > #include > #include > #include "geometry_msgs/Twist.h" > class simple_server > { > public: > simple_server(std::string name):as_(nh_,name),action_name_(name) > { > // Register the goal and feeback callbacks > as_.registerGoalCallback(boost::bind(&simple_server::goalCB, this)); > as_.registerPreemptCallback(boost::bind(&simple_server::preemptCB, > this)); > sub_ = > nh_.subscribe("/random_number",1,&simple_server::analysisCB,this); > cmd.linear.x = cmd.linear.y = cmd.angular.z = 0; > > // ¹ã²¥ÃüÁî > cmd_pub_ = nh_.advertise("/p3robot/cmd",1); > } > void goalCB() > { > ROS_INFO("%s : received a new goal",action_name_.c_str()); > as_.acceptNewGoal(); > ROS_INFO("end of receiving the new goal"); > } > void preemptCB() > { > ROS_INFO("%s : preempted",action_name_.c_str()); > as_.setPreempted(); > } > void analysisCB(const geometry_msgs::PoseStamped::ConstPtr& msg) > { > ROS_INFO("get in analysisCB"); > if(!as_.isActive()) > return; > //feedback_.feedback.base_position.header = msg->header; > //feedback_.feedback.base_position.pose.position.x = > msg->pose.position.x; > //feedback_.feedback.base_position.pose.orientation.w = > msg->pose.orientation.w; > cmd.linear.x = msg->pose.position.x; > ROS_INFO("the position value is %d \n ",msg->pose.position.x); > cmd_pub_.publish(cmd); > //as_.setSucceeded(result_); > } > protected: > ros::NodeHandle nh_; > actionlib::SimpleActionServer as_; > std::string action_name_; > geometry_msgs::PoseStamped goal_; > move_base_msgs::MoveBaseActionFeedback feedback_; > move_base_msgs::MoveBaseActionResult result_; > ros::Subscriber sub_; > > ros::Publisher cmd_pub_; > > geometry_msgs::Twist cmd; > }; > > int main(int argc, char** argv) > { > ros::init(argc,argv,"simple_server"); > simple_server serverInstance("move_base"); > ros::spin(); > > return 0; > } > ============================end of the > file================================= > > When I type "roscore"¡¢ "rosrun simple_navigation_goals > simple_navigation_server > "¡¢ "rosrun simple_navigation_goals simple_navigation_goals"£¬I can find that > the client has sending a goal, and the server can receive the goal, but it > can't enter into the function of "preemptCB" and "analysisCB", that's to say > I can't publish the "/p3robot/cmd" cmd. I think there must be some problem > in the server file. > > Then I am trying another way. I find the "move_base" package is really a > server. But when I type "rosrun move_base move_base" and "rosrun > simple_navigation_goals simple_navigation_goals", I find the client always > gets the "Waiting for the move_base action server to come up" outputs. This > means the client can't get touched the server. But the "move_base" node is > really a server named "move_server". What is the problem? > > Thanks in advanced! > > _______________________________________________ > ros-users mailing list > ros-users@code.ros.org > https://code.ros.org/mailman/listinfo/ros-users > >