Ask Your Question

Move_base goals in 'base_link' for Turtlebot

asked 2015-02-27 18:21:10 -0600

velveteenrobot gravatar image

We're trying to get the Turtlebot to drive to points relative to the /base_link frame. We looked at the Sending Simple Goals tutorial. We've successfully gotten the robot to move by running amcl_demo.launch and using goals (either move_base_simple or regular move_base goals with actionlib) in /map frame. However, when we try to set goals in /base_link, relative to the robot, nothing happens. Our code is:

#!/usr/bin/env python

import roslib
import rospy
import actionlib

from people_msgs.msg import PositionMeasurementArray
from geometry_msgs.msg import *
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal

def callback(data):
    # publish to whatever message the driving is going to take place
    pub = rospy.Publisher("move_base_simple/goal", PoseStamped, queue_size = 10)
    client = actionlib.SimpleActionClient("move_base", MoveBaseAction)

    if len(data.people) > 0:
        #person found
        rospy.loginfo("Found person, generate goal")
        target_goal_simple = PoseStamped()
        #target_goal = MoveBaseGoal()

        #forming a proper PoseStamped message
        target_goal_simple.pose.position = data.people[0].pos
        target_goal_simple.pose.position.z = 0
        target_goal_simple.pose.orientation.w = 1
        target_goal_simple.header.frame_id = 'base_link'
        target_goal_simple.header.stamp =
        #target_goal.target_pose.pose.position = data.people[0].pos

        #sending goal
        rospy.loginfo("sending goal")

def follower():
    rospy.Subscriber('people_tracker_measurements',PositionMeasurementArray, callback)

if __name__ == '__main__':
    except rospy.ROSInterruptException:

I guess in general I'm wondering if there's a way to run navigation without a map and send goals relative to the robot? It seems to be possible, but I can't figure out how (what to launch? how to set my goals?). Any help would be appreciated! Thanks!


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-02-27 18:49:04 -0600

tfoote gravatar image

updated 2015-02-27 18:49:40 -0600

I believe that move_base actually explicitly rejects messages received in the base_link because it is not achievable to reach said goal. Since 2m forward will always be 2m forward. I didn't find the logic in a quick search but think you could find it if you looked.

To make it work relatively quickly you could simply query for the current robot pose in odom, and then add the offset you want to drive to in your script. This will allow move_base to persist the goal in the odom frame and be able to reach it.

edit flag offensive delete link more


Ah, it makes sense why /base_link wouldn't work. Although it is confusing that the Sending Simple Goals tutorial specifies goals in that frame.

So basically if we publish goals in the odom frame it might work?

velveteenrobot gravatar image velveteenrobot  ( 2015-02-27 18:55:39 -0600 )edit

I think so, but I may be out of date.

tfoote gravatar image tfoote  ( 2015-02-27 19:13:33 -0600 )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



Asked: 2015-02-27 18:21:10 -0600

Seen: 1,484 times

Last updated: Feb 27 '15