View: 550|Reply: 5

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

19

Threads

214

Posts

747

Credits

Senior member

Rank: 4

Credits
747
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

0

Threads

2

Posts

7

Credits

Newbie

Rank: 1

Credits
7
Post time 2021-1-25 02:18:31 | Show all posts
Edited by Raoul at 2021-1-25 03:43 AM
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 ...

Hello,

It looks like nothing changes when i play with these numbers in servo.py. What do i need to do to activate them?
Restarting the server or OS didn't help.

I just made a mars rover picar-b and broke two servos in the first run.  So I replaced them with metal servos (type: Corona CS-929MG)
Steering works perfectly, but the servos in the head start shaking when I go the max left, richt, up or down.
I also see more variables then min and max in servo.py.
  1. pwm0_init = 300
  2. pwm0_range = 100
  3. pwm0_max  = 500
  4. pwm0_min  = 100
  5. pwm0_pos  = pwm0_init
Copy the Code


Can someone make me clear how to change (and activate) the numbers, so the servos in the head don't go to the max position anymore?
Reply

Use magic Report

19

Threads

214

Posts

747

Credits

Senior member

Rank: 4

Credits
747
Post time 2021-2-4 18:23:29 | Show all posts
The supporting manual has been updated, please download it through the link below:
https://www.adeept.com/learn/detail-33.html
Reply

Use magic Report

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

Points Rules