View: 369|Reply: 3

New Mars Rover PiCar-B

[Copy link]

1

Threads

3

Posts

35

Credits

Newbie

Rank: 1

Credits
35
Post time 2020-3-26 23:30:55 | Show all posts |Read mode
New guy here. I searched the forum and can not find the answers to a coupole questions.

How can i set the max turn of the steering servo. it turns to sharp and forces it to get stuck. I need it to turn less sharp.

I can not figure out how to get the camera and opencv windows to open on windows.
they work just fine on linux.

Am i missing a module or need to change something?
Reply

Use magic Report

18

Threads

49

Posts

392

Credits

Intermediate member

Rank: 3Rank: 3

Credits
392
Post time 2020-3-27 18:19:15 | Show all posts
Hello,

These parameters in the file servo.py can limit the maximum and minimum angles of the servo:

  1.         pwm0_max  = 500
  2.         pwm0_min  = 100

  3.         pwm1_max  = 450
  4.         pwm1_min  = 150

  5.         pwm2_max  = 450
  6.         pwm2_min  = 150
Copy the Code


On Windows, switch to the client folder in the cmd window and use python GUI.py to run the GUI. Make sure you have the GUI dependencies installed on your PC.
Reply

Use magic Report

1

Threads

3

Posts

35

Credits

Newbie

Rank: 1

Credits
35
 Author| Post time 2020-4-17 01:52:40 | Show all posts
Adeept replied at 2020-3-27 06:19 PM
Hello,

These parameters in the file servo.py can limit the maximum and minimum angles of the servo ...

Excellent thank you. It seems i have most everything working.  Two new things I have found.

When using the client the controls work perfect, except for moving the camera up and down.  There is a delay for some reason. sometime 5 seconds sometimes 10 seconds. Then every now and then it will work perfect for a minute.  I do not have this delay with any of the other controls.

My second thing is sometimes when opening the GUI i get the following

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\kenny\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\kenny\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Tools\client\GUI.py", line 82, in video_thread
    footage_socket.bind('tcp://*:5555')
  File "zmq\backend\cython\socket.pyx", line 550, in zmq.backend.cython.socket.Socket.bind
  File "zmq\backend\cython\checkrc.pxd", line 26, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address in use


Seems to only effect the camera maybe? I have to sign out or reboot to clear the error out. Could it possibly be from not releasing port 5555 on disconnect?
Reply

Use magic Report

1

Threads

3

Posts

35

Credits

Newbie

Rank: 1

Credits
35
 Author| Post time 2020-4-23 03:45:00 | Show all posts
Ah Ha.

For anyone else experiencing this.... It looks like bluestacks uses port 5555 as well. So i changed the Gui.py and the FPV.py to use another port and it works perfect now.

Looks like the slowness was due to a bad servo. Replaced the servo and it works well now.
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules