Web UI - robot runs the wrong way
Forums:
Hi,
My DiddyBorg status at the moment:
- Joystick control OK
- Wifi OK
- Camera OK
- PicoBorg Reverse OK
- WebUi is running, but wrong direction
i have just a little problem with the WebUi.
WebUi status:
Forward wrong direction (moves reverse)
Reverse wrong direction (moves forward)
Turn Left wrong direction (turn right)
Turn Right wrong direction (turn left)
Stop OK
Spin Left OK
Spin Right OK
Save Photo OK
Camera on WebUi: the image is rotated 180 degrees around
i hope you can help me with this problem
thank you in advance,
sorry for my bad english :)
piborg
Mon, 01/11/2016 - 10:48
Permalink
DiddyBorg WebUI
That is a little strange, the
diddyWeb.py
script should match the assembled DiddyBorg setup.Which model of DiddyBorg do you have?
From the sounds of it there are two differences between the script and your DiddyBorg:
Both of these can be fixed in the script fairly easily.
To swap the motor outputs:
Change the "Set the outputs" section to read as follows:
To remove the 180 degree camera rotation:
Change the "Read the image and save globally" section to read as follows:
Cyborg
Thu, 01/28/2016 - 10:27
Permalink
Thanks, but..
First, thanks for the quick response!
I was very busy the last few days.
I have the parts of an normal "DiddyBorg - The most powerful Raspberry Pi robot available" (PicoBorg Reverse, BattBorg, ...) just with a self-made case.
I changed the "diddyWeb.py" as you described it.
Now:
- Forwar OK
- Reverse OK
- Stop OK
- Turn Left and Turn Right wrong direction
- Spin Left and Spin Right wrong direction
- Camera OK
I´m going to try some things.
But if you have a possible solution for my problem , I would be very grateful ;)
Cyborg
Thu, 01/28/2016 - 11:24
Permalink
Tested some changes in code line 217 and 218
Code changes:
#217 PBR.SetMotor1(driveLeft)
#218 PBR.SetMotor2(driveRight)
WebUi Button (left side) = Real function on the car (right side)
spin left = reverse
spin right = forward
forward = spin left
reverse = spin right
turn right = turn left
turn left = motors on the left side move backwards
.
Code changes:
#217 PBR.SetMotor1(-driveLeft)
#218 PBR.SetMotor2(driveRight)
WebUi Button (left side) = Real function on the car (right side)
spin left = wrong direction
spin right = wrong direction
forward = OK
reverse = OK
turn right = wrong direction
turn left = wrong direction
.
Code changes:
#217 PBR.SetMotor1(driveLeft)
#218 PBR.SetMotor2(-driveRight)
WebUi Button (left side) = Real function on the car (right side)
spin left = OK
spin right = OK
forward = wrong direction
reverse = wrong direction
turn right = wrong direction
turn left = wrong direction
.
Code changes:
#217 PBR.SetMotor1(-driveLeft)
#218 PBR.SetMotor2(-driveRight)
WebUi Button (left side) = Real function on the car (right side)
spin left = forward
spin right = reverse
forward = spin right
reverse = spin left
turn right = motors on the right side move backwards
turn left = turn right
piborg
Thu, 01/28/2016 - 13:42
Permalink
I can only think the motors
I can only think the motors are running backwards instead of being swapped.
Try this version instead:
Cyborg
Thu, 01/28/2016 - 15:37
Permalink
hm..
already tried this:
Code changes:
#217 PBR.SetMotor1(-driveLeft)
#218 PBR.SetMotor2(driveRight)
WebUi Button (left side) = Real function on the car (right side)
spin left = wrong direction, spin right
spin right = wrong direction, spin left
forward = OK
reverse = OK
turn right = wrong direction, turns left
turn left = wrong direction, turns right
piborg
Thu, 01/28/2016 - 17:11
Permalink
Not quite what I meant
I was suggesting that driveLeft ad driveRight should be swapped around to how they were before, then swapping only the - sign.
So you end up with this:
PBR.SetMotor1(-driveRight)
PBR.SetMotor2(driveLeft)
Cyborg
Fri, 01/29/2016 - 12:17
Permalink
thx
oh no , what an embarrassing mistake by me!
I have read the code a hundred times wrong... driveRight and driveLeft was wrong.
I changed it:
PBR.SetMotor1(-driveLeft)
PBR.SetMotor2(driveRight)
Everything is fine now :)
Thank you very much for your time and the fast answers,
very good support!!