Gopigo2 Google Cloud Vision API

Hi @strangersliver

No one has traveled this route to update us unfortunately.

You will need to update yourself on how to use Google’s vision APIs, (I believe they have changed in the three years since the DI example.)

So the the place to start is https://cloud.google.com/vision/docs/support

And the Google cloud section on Stack Overflow https://stackoverflow.com/questions/tagged/google-cloud-vision

1 Like

cyclicalobsessive, thanks for your replying.

I’m using currently google vision api on windows and on Google Cloud Shell. The only place where I was not able to set is on raspberry/gopigo2 platform which I have exhumed after some years since my kids are little bit bigger now. Of course I have already did some research and tests before to submit a topic in this forum. I wonder if somebody in Dexter may help to address this issue, and overall understand if gopigo2 platform was ever tested to work with google api?
Thanks

1 Like

While we wait for DI to jump in, do you mind some questions?

  • What do you mean by “to work with google api”?

  • Can you post the exact traceback console message that had the illegal instruction error?

  • Was the error in one of the three DI example programs from the tutorial you linked?

  • were you able to follow the tutorial steps for the google cloud web steps exactly? (It seems to me like everything was different - I eventually figured it out but I didn’t take my usual copious notes so I won’t be able to help others navigate the path. I ended up setting up another project, enabling the vision API, adding credentialed user, setting up a new billing account, linking the user to that billing account and downloading auth file but only after searching every menu option and some new permission denied errors that had hints “browse to …”.)

There weren’t any gopigo specific imports or calls in the camera_vision_label.py that I was able to run on my GoPiGo3 based Raspbian For Robots (Linux Carl 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux)

1 Like

After I have tried to use Google Vision API by following DI tutorials with no get a really success, I have started completely from scratch by following this:
https://codelabs.developers.google.com/codelabs/cloud-vision-api-python/index.html#5

By applying what has explained there on Google Cloud Shell and Raspberry OS/GoPiGo2 either, ( you can see the result on both the terminals in the picture), I have understood that probably the issue is with my raspberry processor version (ARMv6) and its set of instructions which doesn’t support google API.

I hope to get a confirmation from DI as well. If so I will plan to upgrade my raspberrypi card with a new one, probably a Pi3b+ if my GoPiGo2 is compatible.

1 Like

What RPi is it? I see references to folks running Google Cloud Vision on a Zero with Wifi which is an ARMv6 as I understand it.

Did you try updating your OS? (what does “uname -a” print out?)

Here is a link to my README and programs I ran successfully (including version I created:   ./file_vision_label.py -i image.jpg

From a power usage standpoint on a mobile robot, I would recommend getting the Pi3B non-plus version. Your robot will run between 35% longer and twice as long on a charge versus the plus version (probably 60% longer).

Additionally (I believe - need DI confirmation), be sure to stick with Raspbian For Robots stretch based version bc it still has GoPiGo2 support. I think I read that DI was dropping “native” support for the GoPiGo2 in the buster based R4R.

The Google Vision API “illegal instruction” from the import may need to be reported to Google as an issue on Github. The python vision API was just bumped to official release in February, and Google does not list any Raspberry Pi incompatibilities.

Strongly suggest you put that illegal instruction screen shot on the StackOverflow GoogleCloudVision support forum

Attach my OS version. Unfortunately I didn’t get chance to look and compare with Pi-Zero. However, I remember to have read on DI blog a while ago a difference in supporting of Cloud API based on platform version but I was not able to find the article at this time.
I will definitely try to solve this issue in one way or another since I have a project that I want to accomplish
os.pi

1 Like

Perhaps the post was about using easygopigo in place of easygopigo3 when converting GoPiGo3 examples for the GoPiGo2, That there are some things that will not be available. There really should not be any GoPiGo2 hardware or software incompatibility with any of the Google APIs.

Did you ask DI support?

Yes, I have sent an email to DI two days ago

Just I found another article that explain incompatibility between google API and armv6 processor.
http://www.christian-abraham.de/blog/index.php?controller=post&action=view&id_post=2

1 Like

That’s an interesting find, @strangersliver.
I wasn’t aware that Google dropped support for armh6 . That’s kinda annoying, really.

Your GoPiGo2 can definitely be upgraded to a Pi3B or Pi3B+. It is currently untested with a Pi4 but I can’t think of any reason why it wouldn’t work. I can’t recommend it though because it has a capacitor right in the middle so you wouldn’t be able to have a heat sink on the Pi4. And the heat sink is needed. Stick with the Pi3 family.

Cleo

1 Like

I will definitely move to a Pi3b board in order to perform my cloud API integration with a gopigo. Thank you :slight_smile:

1 Like

@strangersliver, Please keep us informed of your progress (and plans).

One of the goals I have for my robot is “capture, label, catalog objects in its world”:

  • find center of room
  • face south wall of room
  • Perform “capture, label, catalog”
    • perform known object labeling
    • catalog known objects with location found with
      • reference to cropped photo of object
      • reference to “room view” where object is located
    • identify suspected unknown objects in photo
    • catalog suspected unknown objects with
      • reference to cropped photo of unknown object
      • reference to “room view” where unknown object is located
  • if not done one complete rotation:
    • rotate one photo view width clockwise
    • repeat from “capture, label, catalog”
  • return to charging dock
  • ask human for help to “classify suspected unknown objects”
     

I believe that precise localization may not be needed for my robot, (or easily done), and that the bot could use this catalog to know roughly where it is by a “capture photo, label objects in view, compare with known world objects and derive robot location and orientation” ability.

(I don’t know of another use for the acquired knowledge at this point, but my knowing that the robot is “aware” of the existence of these objects would allow me to think that the robot could infer an awareness of its self as knowing something unique that no other robot knows. If that makes any sense.)

This is one of my “bucket list of abilities for my robot”, so I am curious about your plans and progress. Visit often please.

I have searched and searched for an official statement of non-support or support unsuccessfully, so I posted:

I also created an issue (but doubt it will go anywhere but we’ll see):

Absolutely, keep you posted as soon as I will get something concrete.
Your project seems interesting too.
First step my, Pi3b will arrive tomorrow.

1 Like

Very good. We’ll see what we get from there.

1 Like

A quick update. Just Installed the Pi3B+. No issue with Google Cloud Vision API

1 Like

Congrats - great to hear.

Thanks for the investigation there. I wasn’t aware they had dropped Pi2 support. I’ve added a note on our write-up. Even though a lot of the write-up is now outdated, at least others will be spared the Pi2 challenge.