Using Navigation Commands To Move Magni

“Once a navigation stack is running such as at this point we are able to tell Magni to move to a specific X,Y location and then rotate to a specific angular rotation. Magni will be running move_basic from the above roslaunch and so will be ready to accept commands to move to a given X,Y with a given rotation by sending MoveBaseGoal messages to ROS topic /move_base/goal.”

I am currently stuck at this point in the tutorial of " Fiducial-Based Localization". I have created my map and wish to send X,Y coordinates for Magni to move to that location on the map. But what commands do I need to execute for this? How do I send “MoveBaseGoal messages to ROS topic /move_base/goal”?

I am not the navigation stack guru at Ubiquity. That being said I will explain what I had used to do what you are asking and tell move_basic the next waypoint. Treat this as a simple minded example that you can play with and perhaps other more elegant solutions will show up for you. I think from what you have stated that this may be a good ‘next step’ in your efforts but not the ‘final step’.

Take a look in our move_basic repository and in the scripts folder look at move_patterns.py which is a phthon script I wrote for some simple tests to navigate a pattern.

I hope this helps and again, it is rather ‘brute force’ but I offer it with that disclaimer that it is just for tests I was doing.

Our repository is here: https://github.com/UbiquityRobotics/move_basic

Good luck,
Mark

I try to run the move_patterns.py (copied from Github) after executing:

roslaunch magni_demos simple_navigation.launch

however I encounter the following error:

File “move_patterns.py”, line 265, in
node = Controller()
File “move_patterns.py”, line 188, in init
print "A total of %d waypoints is in the list " % (len(waypointList))
UnboundLocalError: local variable ‘waypointList’ referenced before assignment

Can you assist?

Thanks.
MUN

I apologize. It looks like it has fallen into disrepair. That is my fault.
I’ll try to take a look at it but it will be a few days at least.
The script is not one of our ‘official’ demos and was a sort of experiment at the time.
I may have used it in a different branch where it got fixed but never merged or something like that.
Sorry for giving out misinformation. From memory, I think you had to tell it what table of waypoints to use or it would fail like this because it did not setup the waypointList.
There are a few sample tables of waypoints and I would copy them into the list based on a command line parameter. You would have to investigate if you are up on python.
I don’t think it is tricky python, just ‘buggy’ in that it did not setup a default list is my guess.

Try using -w line or look at printUsage lines around line 50 and then look around line 163 where it fills in the waypointList. I think without the -w and pattern type is why it is failing.

Sorry, cannot run it right now but maybe that will do it for you

Thanks for the response, but I still do not quite understand your advice. I would appreciate if you can clarify the followings:-

  1. What do you mean by the -w line?
  2. What do you mean by “without the -w and pattern type”?

image

image

Run the command with the -w option like this example:
python move_patterns.py -w line

I am saying I think what may be happening is you must supply the -w and pattern name like are shown in the code in the help menu or the structure is not initialized.

Also to be clear, the script sends commands to move_basic so you must be running enough of the navigation stack so that move_basic is running or the script cannot talk to move_basic.

See if that works, if not I will try to look at this over the weekend.
Thanks,
Mark