Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Running GRIP on Raspberry Pi 3 (http://www.chiefdelphi.com/forums/showthread.php?t=153982)

brad.harker 20-01-2017 17:03

Running GRIP on Raspberry Pi 3
 
We are trying to run GRIP generated code on our raspberry pi 3. We have connected a webcam to our PC and used the Windows GRIP Computer Vision Engine software to adjust our filters and output some contours. We have generated the code in a python file and we are using another python file to access the GripPipeline. We are then publishing the x and y values of the contours to our NetworkTables. The problem lies in the fact that we are not getting any output whatsoever. We have a second webcam running at the same time that does output the contours in the PC software, but the pi outputs nothing.

vScourge 20-01-2017 17:10

Re: Running GRIP on Raspberry Pi 3
 
Where are you testing for the output from the RPi? In the robot code running on the roboRIO?

How is your RPi connected to the roboRIO? Are they both connected to the radio with ethernet cables, for instance?

If so, have you verified the RPi is connected to the roboRIO over the local network? You should be able to SSH into either device and ping the other successfully.

If that's not working then the NetworkTables client on the RPi will not be able to connect to the server on the roboRIO.

brad.harker 20-01-2017 17:41

Re: Running GRIP on Raspberry Pi 3
 
Quote:

Originally Posted by vScourge (Post 1634143)
Where are you testing for the output from the RPi? In the robot code running on the roboRIO?

How is your RPi connected to the roboRIO? Are they both connected to the radio with ethernet cables, for instance?

If so, have you verified the RPi is connected to the roboRIO over the local network? You should be able to SSH into either device and ping the other successfully.

If that's not working then the NetworkTables client on the RPi will not be able to connect to the server on the roboRIO.

We are running the NetworkTables successfully. We have the rpi connected to a router that the roboRio is also connected to. We have input a test line into the NetworkTables and it showed up in our drivers station. The problem lies with the grip code. We can ping the roboRio from the pi and we can ping the pi from the roboRio. We just recently changed the values in our hsl filter and generated the code and it no longer works. We then changed the values manually in the working grip file and it worked. So the code in the GRIP program works fine but when it is generated and transferred to the pi, it does not produce any contours. If we edit the code on the pi and change the hsl filter to something with a much wider range, it works fine and outputs a bunch of contours in networktables. So something between GRIP on our computer and GRIP/OpenCV on the pi is inconsistent. We aren't sure what is going on.

vScourge 20-01-2017 23:08

Re: Running GRIP on Raspberry Pi 3
 
I would suggest posting an issue on the GRIP GitHub tracker.
https://github.com/WPIRoboticsProjects/GRIP/issues

Crew Cox 21-01-2017 17:32

Re: Running GRIP on Raspberry Pi 3
 
I usually don't bump, but we really need help here.

blueboss 21-01-2017 20:49

Re: Running GRIP on Raspberry Pi 3
 
List of things I think could cause this (in order of likelihood):
  1. The code is different. My team missed this during some tests. Be absolutely certain that the way you are receiving an image and processing it is exactly the same on the pi as it is on your PC. Copy all the code over.
  2. The image is different. Perhaps something messed up because the pi has a different view, webcam, or camera settings. Make sure they are identical. Try using a sample image to ensure this.
  3. The camera on the pi isn't sending an image (unlikely). If it worked on the pi in the past this is probably not the case. You might want to test it anyways.
  4. Your OpenCV is not the same version across your devices
    You can test this with
    Code:

    cv2.__version__
    in python or
    Code:

    CV_VERSION
    in C++
  5. OpenCV works differently on the pi. My team has not encountered any difference in running generated GRIP code on different devices (including the pi and a Mac), but I cannot be certain.
Let me know if this helps.
Good luck!
-Team 4904

cottoncandyman 23-01-2017 16:12

Re: Running GRIP on Raspberry Pi 3
 
We have tried many things. We are now trying to run it on the roboRio itself. I will keep this updated.


All times are GMT -5. The time now is 15:34.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi