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

Python code for sending navigation goal to TurtleBot

asked 2013-03-20 16:56:59 -0500

Chik gravatar image

updated 2016-10-24 08:58:59 -0500

ngrennan gravatar image

I would like to write a Class Navi in Python that loads a known yaml map, runs amcl and move_base to move the TurtleBot to the goal. I know I can do it with rviz, but I want to do it using Python codes so I can incorporate them with other codes. There is a tutorial: http://ros.org/wiki/navigation/Tutorials/SendingSimpleGoals but the code is in C++ and it does not load the map and does not do localization and also is not tailor made for TurtleBot.

It will be best if someone already have such code. Otherwise I shall appreciate if you can teach me what do I need to import and how to call the libraries. Thank you very much for your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-03-22 11:35:29 -0500

fergs gravatar image

I think you are confusing a bit what should actually be in your Python node.

You should translate the C++ code into Python, which basically means having a single actionlib client that sends goals.

Localization, loading maps, etc, would not be in the Python node, but would rather run as separate nodes, typically started by a launch file.

Your launch file would most likely have an "include" of turtlebot_navigation/move_base.launch to get localization, planning, etc as well as launching your Python-based node which sends waypoints to move_base.

Finally, don't forget that you will likely need to send an "initial pose" to AMCL before you can go anywhere.

edit flag offensive delete link more

Comments

Thank you very much. I shall try that.

Chik gravatar image Chik  ( 2013-03-22 14:01:26 -0500 )edit

@fergs i have read the move_base code but i found that the goal message is (geometry_msg/PoseStamped) that require a position my Question is : Can i send a different goal message type ? say i want my robot to detect my Object then use move_base to plan and Go to it and detection publish a /re_ki

salma gravatar image salma  ( 2013-04-18 21:33:49 -0500 )edit

publish a /re_kinect/detection_results (re_kinect_object_detector/DetectionResult)

How can i link these two aspects detection result and object position ?

thanks ,

salma gravatar image salma  ( 2013-04-18 21:34:48 -0500 )edit

Question Tools

Stats

Asked: 2013-03-20 16:56:59 -0500

Seen: 4,451 times

Last updated: Mar 22 '13