ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I made it work doing this

def movebase_client(ns, x, y):

    client = actionlib.SimpleActionClient(ns + '/move_base', MoveBaseAction)
    client.wait_for_server()

and then when you call the function,

movebase_client('Bot1', 4.0, 4.0)

I made it work doing this

def movebase_client(ns, x, y):

    client = actionlib.SimpleActionClient(ns + '/move_base', MoveBaseAction)
    client.wait_for_server()

and then when you call the function,

movebase_client('Bot1', 4.0, 4.0)

This, however, does not allow me to change the values in the launch file. For this, I had to use the param server. In the python file, I wrote this:

x = rospy.get_param('~x_position')
y = rospy.get_param('~y_position')

client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
client.wait_for_server()

and then in the launch file I could then change the values doing this:

  <node pkg="okg" name="name" type="name.py" output="screen">
      <remap from="move_base"       to="Bot1/move_base"/>
      <param name="~x_position"      type="double"      value="2.0"/>
      <param name="~y_position"      type="double"      value="2.0"/>
  </node>

Thanks, osilva and Geoff.