[Solved] How to Update Github Repo on GoPiGo

Am trying to run the ServoControl example, but Init_servo is not found:

pi@dex:~/Dexter/GoPiGo3/Projects/ServoControl $ sudo python runnable.py 
Traceback (most recent call last):
  File "runnable dot py", line 80, in <module>
  File "runnable dot py", line 37, in Main
    gopigo3_servos = GoPiGo3WithKeyboard()
  File "/home/pi/Dexter/GoPiGo3/Projects/ServoControl/keyboarded_robot.py", line 47, in __ init __
    self.servo1 = self.gopigo3.init_servo("SERVO1")
AttributeError: 'EasyGoPiGo3' object has no attribute 'init_servo'

I can believe this, as the class definition in easygopigo3 dot py doesn’t define it. Then why does the example use it?

The state of the device is:

pi@dex:~/Dexter/GoPiGo3/Projects/ServoControl $ cat ~/Desktop/log.txt 
GoPiGo3 Troubleshooting Script log

Checking for hardware, and checking hardware and firmware version.
Manufacturer    :  Dexter Industries
Board           :  GoPiGo3
Serial Number   :  F1768CDD514E343732202020FF11281D
Hardware version:  3.1.3
Firmware version:  0.3.2
Battery voltage :  9.5
5v voltage      :  4.987

Any pointers anyone can offer? Is there an official API doc site?

I think @RobertLucian can help with this. The latest API site for GoPiGo3 Python is here.

Thanks - I’ll take a look for the doc.

I also noted the following. After doing a git fetch in /home/pi/Dexter/GoPiGo3, I see the following state of the code.

pi@dex:~/Dexter/GoPiGo3 $ git remote -v
origin	https://github.com/DexterInd/GoPiGo3 (fetch)
origin	https://github.com/DexterInd/GoPiGo3 (push)
pi@dex:~/Dexter/GoPiGo3 $ git branch -v
  • master 8d2f9d4 [behind 59] Merge pull request #44 from CleoQc/master

Yet having done a git clone of that remote into another directory, I see:

pi@dex:~/GoPiGo3 $ git remote -v
origin	https://github.com/DexterInd/GoPiGo3.git (fetch)
origin	https://github.com/DexterInd/GoPiGo3.git (push)
pi@dex:~/GoPiGo3 $ git branch -v
  • master d3614da servo control project for the gopigo3 (#72)

So it appears the installed software is off by 59-odd commits. Despite doing the git fetch. Hence, the EasyGoPiGo3 class is not up to date with the ServoControl project. I’ll have to see why the fetch didn’t bring the Dexter/GoPiGo3 directory up to the d3614da commit.

Hello @ottodelupe have you tried the following git command?

sudo git pull

Just tried it, and yes, it appears to have pulled down the most recent commits. Don’t know why the fetch didn’t (pull == fetch + merge; right?)

Anyway, did that, and then ran the install.sh script & rebooted.That, plus a setting of PYTHONPATH (to find mock_package) seems to have gotten it working.

Many thanks for the help!

1 Like