FollowMe Example with MonsterBorg
Forums:
I don't suppose anyone has had luck getting something like the FollowMe or Ball follow example to work on the Monsterborg? I've tried, with my extremely limited experience, to make the necessary changes to port the example over but the errors are too numerous to sift through.
Before anyone asks, I did replace all instances of ZB and ZeroBorg with TB and ThunderBorg and set the power settings correctly. There were also some issues with the comms failsafe, led functions and then some general threading/picamera stuff that didn't work either.
Suggestions?
piborg
Fri, 03/16/2018 - 15:53
Permalink
Converting scripts for MonsterBorg
For the ball following you can start from the DiddyBorg v2 version of the script.
diddy2FollowBall.py
, which is already written for the ThunderBorg :)All you will need to do in that script is swap the left and right motor outputs on the ThunderBorg. Look for these lines:
and swap the left and right like this:
The
yeti2FollowMe.py
script will be a bit more difficult to convert as there are a fair number of differences between the two.As you have done, the first step is to replace ZeroBorg with ThunderBorg in all cases. This includes the
ZeroBorg.ScanForZeroBorg()
which needs to beThunderBorg.ScanForThunderBorg()
. ChangingZB
toTB
is not strictly required, but it will help avoid confusion :)The next thing is to remove the
ZB.ResetEpo()
line. This function is not available on the ThunderBorg.After that we need to correct the LED functionality. Start by adding this line at the bottom of the setup section:
This allows the script to control the LED instead of showing the battery level. Now change this line at the end of the script:
for this one:
We also need to change the LED for showing motion, I suggest we use red for a detection and green for none. Look for this line:
and swap if for these lines:
The last thing that needs to be changed is the motor outputs. Look for these lines:
and change them to:
That should be all the changes needed. Remember Python is very picky about the spacing at the start of each line, as such we suggest using the space bar to get them right, not the tab key.