Ask Your Question

Simple movement goal problem

asked 2012-10-10 14:49:24 -0500

highencast gravatar image

updated 2014-01-28 17:13:54 -0500

ngrennan gravatar image

Hi, when I try to run the following code to move the turtlebot 1 meter forward it becomes unresponsive (possibly when it is waiting for the server), and prints "None" if I do a keyboard interrupt:

#!/usr/bin/env python

import roslib; roslib.load_manifest('robot_red')
import rospy
import actionlib

from move_base_msgs.msg import *

def simple_move():


    #Simple Action Client
    sac = actionlib.SimpleActionClient('move_base', MoveBaseAction )

    #create goal
    goal = MoveBaseGoal()

    #use self?
    #set goal
    goal.target_pose.pose.position.x = 1.0
    goal.target_pose.pose.orientation.w = 1.0
    goal.target_pose.header.frame_id = 'first_move'
    goal.target_pose.header.stamp =

    #start listner

    #send goal


    #print result
    print sac.get_result()

if __name__ == '__main__':
    except rospy.ROSInterruptException:
        print "Keyboard Interrupt"

I think I may have to start a server seperately for the SimpleActionClient but am not sure what it would be. If anyone can describe what the problem might be I'll be eternally grateful. Thanks!

edit retag flag offensive close merge delete


I changed the parameter for the SimpleActionClient, but it's still stuck at wait_for_server(). Is there an actual action server I need to start separately?

highencast gravatar image highencast  ( 2012-10-11 01:35:01 -0500 )edit

Yes, as I said in my answer, there is. The launch file is provided by the package turtlebot_navigation. Have a look at the tutorials.

Lorenz gravatar image Lorenz  ( 2012-10-11 01:37:14 -0500 )edit

Thanks for posting, I had good use of your code to make my own basic move_base thing with Python

korkor gravatar image korkor  ( 2015-05-08 05:29:56 -0500 )edit

I have a simple question, what does goal.target_pose.pose.orientation.w = 1.0 mean?

aarontan gravatar image aarontan  ( 2018-06-16 14:33:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-10 23:23:00 -0500

Lorenz gravatar image

The parameter you pass to SimpleActionClient is the name of the action, not the name of your node. Normally it's something like move_base. Make sure the navigation stack and move_base are running. Have a look at the turtlebot_navigation tutorials.

edit flag offensive delete link more


The link is blank for jade and kinetic.

Also is scewy- 'Setup the Navigation Stack for TurtleBot' is listed twice but goes to different pages links but similar looking content.

lucasw gravatar image lucasw  ( 2016-07-07 13:07:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-10-10 14:49:24 -0500

Seen: 4,763 times

Last updated: Oct 11 '12