This really is a great idea for expanding the XRP beyond its original design. On that note, I have put the bot together, but I am having issues with the code. This really is beyond my level, so I ended up with some errors that I am unable to fix. For instance, when I try to run the mecanum_drive.py code, I get the following error: ImportError: can’t perform relative import. And I when I try running the mecanum_drive_examples.py, I get this message: NameError: name ‘mecanumdrivetrain’ isn’t defined. Any guidance is greatly appraciated
Hello manuel.umanzor,
Welcome to the DigiKey TechForum.
I’m not familiar with the programming code, but one of the engineers that monitor the TechForum should be able to help with this.
Hello Manuel,
Thanks for reaching out.
It sounds like you may be having issues with where the files that need to be uploaded are located on the XRP.
Looking back at the Tutorial, I didn’t do a very good job of explaining where the files should go.
Let me try walk you through it and see if it will work for you.
First make sure you have the files downloaded from near the bottom of the writeup. It should consist of the Mecanum XRP frame, and two python files, mecanum_drive and mecanum_drive_examples.
When you first have your XRP connected to your computer and have XRPCode up in your browser, click on the file button and select upload to XRP.
Navigate to the folder where you have the files saved, they will also need to be unzipped being the file is in a zipped format. Select the mecanum_drive file and click the open button on the bottom right of the popup window.
Next click the XRPLib folder under the lib folder similar to what is shown below.
Make sure the FINAL PATH looks similar to the one shown above the Ok and Cancel buttons in the picture above and once it is, click the OK button.
Once it has uploaded and refreshed, you can confirm that you have the file installed in the correct folder by looking in the filesystem folder on the far left, and opening the lib, and xrplib folder and you should see the mecanum_drive file.
The final step is to follow similar steps to upload the mecanum_drive_examples file into the XRPExamples folder.
Once you have those two uploaded, it should function properly.
If you do have any other issues, please let me know and I’ll see if I can replicate the issue you are having.
Hello Travis,
Thanks for sending the instructions. I also went back and gave the tutorial a closer look, from there I realized that I had not modified the “defaults” file to include the mecanum drive library. After doing that, the example runs fine. I still need to go back and follow the rest of the instructions more closely, particularly I have yet to make any modifications to the differential_drive file. One last comment on this, I tried running the code to control the drive using pestolink, but so far, I can only get it to strafe left and right, no other buttons on my keyboard have any effect. Any advice on this will be greatly appreciated.
Hello Manuel,
I’m thinking the issue may be how the pestolink_example is set up.
On lines 23 and 34, as shown below, you will need to update those lines to the following:
line 23: mecanumdrivetrain.arcade (throttle, rotation)
line 34: mecanumdrivetrain.arcade(0,0)
That should allow the other two motors to recive power and be able to move in all directions.
I can’t recall if I tested the arcade mode when I wrote this article up, so if you do run into further issues please let me know and i can dive back into it deeper and see if i can figure them out.




