Aller au contenu


Caiman

Inscrit(e) (le) 10 juil. 2021
Déconnecté Dernière activité juil. 14 2021 09:26
-----

#113876 Enable Color Tracking minus

Posté par Caiman - 10 juillet 2021 - 12:36

Enable opencv Color Tracking
"Please note that this only works with Raspberry PI 3A +, 3B + and Pi 4"
ssh into the robot.
login pi 
 
run following command Note: These number can differ per robot: for minus with pan, tilt and side-arms use these numbers
 
sudo nano /usr/local/vigiclient/opencv/frame.hpp
on #define REMOTEFRAMESIZE "number"    up the number by 4
on #define TELEMETRYFRAMESIZE "number" up the number by 4
on #define NBCOMMANDS to "3"  
 
save this file by using the pressing "control X" pres "Y" for yes hit enter 
type the following commands 
sudo -s
cd / usr / local / vigiclient / opencv
./make.sh
 
you will see that the robot compiles a few things.
hit enter a few times  
when the following line appears the compiling is done "root @ raspberrypi: / usr / local / vigiclient / opencv #"
 
in the website settings edit the following
go to cameras 
edit TYPE: to "Autopilot"
edit SOURCE: to "2"
now scroll all the way down.
exchange 
WRITEUSERDEVICE: to "1"
READUSERDEVICE : to "1"
 
Reboot the robot and the color tracking should work 
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 
if you want to make an extra tool so you can turn of the color tracking do the following 
add this under your side arms control, starting on line 410. you need to add a comma after the } on side arms. below that paste this.
 
{
      "NAME": "OpenCV Color Tracking",
      "CAMERA": 1,
      "MIXING": 0,
      "GAINX": 80,
      "GAINY": 80
    }
 
on your hardware config, add this under your first virtual camera
{
      "TYPE": "Autopilot",
      "SOURCE": 2,
      "WIDTH": 640,
      "HEIGHT": 480,
      "FPS": 30,
      "BITRATE": 1000000,
      "ROTATE": 0,
      "BRIGHTNESS": 50,
      "CONTRAST": -5,
      "BRIGHTNESSBOOST": 80,
      "CONTRASTBOOST": 100
    }
 
 
should now look like this 
{
      "TYPE": "",
      "SOURCE": 0,
      "WIDTH": 640,
      "HEIGHT": 480,
      "FPS": 30,
      "BITRATE": 1000000,
      "ROTATE": 0,
      "BRIGHTNESS": 50,
      "CONTRAST": -5,
      "BRIGHTNESSBOOST": 80,
      "CONTRASTBOOST": 100
    },
    {
      "TYPE": "Autopilot",
      "SOURCE": 2,
      "WIDTH": 640,
      "HEIGHT": 480,
      "FPS": 30,
      "BITRATE": 1000000,
      "ROTATE": 0,
      "BRIGHTNESS": 50,
      "CONTRAST": -5,
      "BRIGHTNESSBOOST": 80,
      "CONTRASTBOOST": 100
    }
  ],
 
now if you switch tools after the sidearms  open cv should start up.
 
huge thanx to OdorousWo1f, Pascal and simba