Go to Post "FIRST is like a pizza, we all think different toppings should be on it" - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-04-2016, 19:43
gegozi gegozi is offline
Registered User
no team
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Bellaire, TX
Posts: 46
gegozi is an unknown quantity at this point
Help: Raspberry pi and GRIP

Hello reader,
I am struggling to use GRIP with the raspberry pi. I have my GRIP code downloaded. I used this tutorial to get my GRIP code running on the pi on startup: Raspberry Pi on GRIP tutorial. I was able to get the MJPG Streamer running successfully, and I can see images from the camera. The only problem is when I open Network Table Viewer, it only shows the root folder with no other subfolders. I am using a Microsoft webcam plugged in to the raspberry pi. I directly connect my raspberry pi to my computer for Ethernet and power. I am able to see the image on my computer; therefore, I know that my Ethernet connection works and that everything is receiving power. Please help!
Thanks,
Gal
Reply With Quote
  #2   Spotlight this post!  
Unread 05-04-2016, 20:48
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 159
nickbrickmaster is an unknown quantity at this point
Re: Help: Raspberry pi and GRIP

Assuming you are using the NT viewer correctly (in client mode, pointed at the roboRIO) my first guess would be to change the IP of the NT server that GRIP is pointing at to be your roborio's DNS/IP. This is in the tools tab->options menu.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote
  #3   Spotlight this post!  
Unread 05-04-2016, 21:06
BrianAtlanta's Avatar
BrianAtlanta BrianAtlanta is offline
Registered User
FRC #1261
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Atlanta, GA
Posts: 70
BrianAtlanta has a spectacular aura aboutBrianAtlanta has a spectacular aura about
Re: Help: Raspberry pi and GRIP

If you can't find a way to get GRIP to work on the Pi, you can try what we did. The GRIP installation instructions for the Pi weren't figured out yet, so instead of trying to figure it out or wait for instructions, we went with OpenCv directly.

Here's the install for Raspbian

Open CV Install (takes 4hrs to complete)

We then installed PyNetworkTables to communicate to DriverStation.

If you need to stream the image, we used mjpeg-streamer.

Our image processing code was written in Python. PyImageSearch.com has a but of help for Python & OpenCv.

PM me if you need more help.

Brian
Reply With Quote
  #4   Spotlight this post!  
Unread 05-04-2016, 23:21
blackrootbot blackrootbot is offline
Registered User
FRC #5489
 
Join Date: Jan 2016
Location: Twin Falls Idaho
Posts: 3
blackrootbot is an unknown quantity at this point
Re: Help: Raspberry pi and GRIP

Do you log into the pi and start up grip with ./vision/start_grip.sh? Do you see the program boot and run? In top do you see a java program running and using lots of cpu? If GRIP runs do you see it say that it connected to a server?
Reply With Quote
  #5   Spotlight this post!  
Unread 06-04-2016, 04:59
axton900's Avatar
axton900 axton900 is offline
Programming Co-Captain
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: New Jersey USA
Posts: 46
axton900 has a spectacular aura aboutaxton900 has a spectacular aura aboutaxton900 has a spectacular aura about
Re: Help: Raspberry pi and GRIP

Hey there!
OpenCV is a better and more stable option. Since it's already late in build season, you may not have time to write new code. You should be able to directly port your GRIP code into OpenCV. It will take some time to port but is definitely doable since OpenCV is the backbones for GRIP. Now if you want some code to sample or look at. I would recommend taking a look at Fauge7's TowerTracker. Our team has been able to run it on a Pi. It is Java though and so you have to install the JDK and make it your default JDK in order to install the library properly. Or you can check out Team 2053's TowerTracker C++ port, which is a direct port of Fauge7's code but instead in the faster and more documented, C++.
If you need any help, feel free to PM
Reply With Quote
  #6   Spotlight this post!  
Unread 06-04-2016, 08:26
sysdes sysdes is offline
Engineering Mentor
AKA: Maurice Veldhuis
FRC #4678 (CyberCavs)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Drayton, Ontario
Posts: 9
sysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant futuresysdes has a brilliant future
Re: Help: Raspberry pi and GRIP

Team 4678 was able to use grip on the Rpi 2. To get it working reliably, there were a few key things that needed to be done. We used the Rpi camera because it had almost no lag compared to the USB camera. mjpg-streamer was used to get the stream from the camera. The key here is to use -x 320 -y 240 in the execution of mjpg-streamer to make sure a 320 x 240 image is sent to grip. Sending a 640 x 480 image caused grip to crash and run slow. Also handy for mjpg-streamer was the -rot 90 option which allowed the image to be rotated after we mounted the pi camera at the wrong rotation. When it comes to grip, the 1.3.0 version started every time while the 1.2.0 version started most of the time but was not as reliable. We were able to just copy the 1.3.0 jar file on to the pi as grip.jar and it worked with the grip.project file that we created on the laptop using 1.2.0 and deployed to the pi. mjpg-streamer and grip are started up using systemd. We can provide more details if someone needs them for start on boot. At the competition, in order to work with the FMS, we did need to give the pi a static ip address. It did not seem to be able to use dhcp services to get an address that would allow it to talk to the roborio using network tables. Raspbian Jessie doesn't do static IP like we were used to. It's easiest using the gui through startx then right-click on the network icon to set a static IP. The other method is to edit /etc/dhcpcd.conf. Editing /etc/network/interfaces won't get you to far. We used the static IP 10.46.78.15 and had no problems getting the Rpi to talk to the roborio using the host name roborio-4678-frc.local in the grip configuration.
Reply With Quote
  #7   Spotlight this post!  
Unread 06-04-2016, 15:30
gegozi gegozi is offline
Registered User
no team
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Bellaire, TX
Posts: 46
gegozi is an unknown quantity at this point
Re: Help: Raspberry pi and GRIP

Quote:
Originally Posted by nickbrickmaster View Post
Assuming you are using the NT viewer correctly (in client mode, pointed at the roboRIO) my first guess would be to change the IP of the NT server that GRIP is pointing at to be your roborio's DNS/IP. This is in the tools tab->options menu.
Are you sure that I am using the roboRIO's information? I thought that the raspberry pi doesn't know the existence of the roboRIO and vice versa; I thought that the pi publishes to Network Tables, and the RIO picks it up.

Please correct me if I am wrong.
Reply With Quote
  #8   Spotlight this post!  
Unread 06-04-2016, 15:35
techplex's Avatar
techplex techplex is offline
Blake B
AKA: Blake
FRC #4909 (The Bionics)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2007
Location: Massachusetts
Posts: 94
techplex is just really nicetechplex is just really nicetechplex is just really nicetechplex is just really nice
Re: Help: Raspberry pi and GRIP

Quote:
Originally Posted by gegozi View Post
Are you sure that I am using the roboRIO's information? I thought that the raspberry pi doesn't know the existence of the roboRIO and vice versa; I thought that the pi publishes to Network Tables, and the RIO picks it up.

Please correct me if I am wrong.

Network Tables works in a Client / Server architecture. The RoboRio is the server and other applications operate as clients.
__________________
Blake
Electrical, Programming and Design

Creator FRC Q&A 2017
Mass FRC Team 4909: The Bionics
Maine FRC Team 5122: The RobOTies (2014-2015)
Maine FRC Team 2648: Infinite Loop (2008-2011)
Reply With Quote
  #9   Spotlight this post!  
Unread 06-04-2016, 15:38
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 203
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Help: Raspberry pi and GRIP

Quote:
Originally Posted by gegozi View Post
Are you sure that I am using the roboRIO's information? I thought that the raspberry pi doesn't know the existence of the roboRIO and vice versa; I thought that the pi publishes to Network Tables, and the RIO picks it up.

Please correct me if I am wrong.
I thought that as well too, but you set up the roboRIO as the server and the raspberry pi as the client. Also, I tried using roboRIO-2053-frc.local as the ip to connect to, but that didnt work that often, so I just switched to static IP's everywhere. We had no connection issues at competition.
Reply With Quote
  #10   Spotlight this post!  
Unread 06-04-2016, 18:03
gegozi gegozi is offline
Registered User
no team
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Bellaire, TX
Posts: 46
gegozi is an unknown quantity at this point
Re: Help: Raspberry pi and GRIP

Hello people,
Thank you for your help.
I was trying to test my code, since the roborio is in the bag. How do you think I should test it? Do I need a router?
Reply With Quote
  #11   Spotlight this post!  
Unread 06-04-2016, 18:35
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 203
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Help: Raspberry pi and GRIP

Do you have a spare roboRIO? If so, set that up and get basic code running. If not, then you might be able to set up the network tables viewer as a server and set your pc as the ip on the raspberry pi side. You probably need a switch for this for the connection to work. I've never done it this way. This is my best guess as I've always had a spare robot.
Reply With Quote
  #12   Spotlight this post!  
Unread 06-04-2016, 23:32
gegozi gegozi is offline
Registered User
no team
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Bellaire, TX
Posts: 46
gegozi is an unknown quantity at this point
Re: Help: Raspberry pi and GRIP

I don't have a spare robo rio, so if anyone has done this without a roborio, please tell me how you did it. Thanks.
Reply With Quote
  #13   Spotlight this post!  
Unread 07-04-2016, 09:21
techplex's Avatar
techplex techplex is offline
Blake B
AKA: Blake
FRC #4909 (The Bionics)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2007
Location: Massachusetts
Posts: 94
techplex is just really nicetechplex is just really nicetechplex is just really nicetechplex is just really nice
Re: Help: Raspberry pi and GRIP

You can test Network Tables without a RoboRIO you just need a Network Tables server. Luckily, the Outline Viewer application has the option to run as a Network Tables server.

https://wpilib.screenstepslive.com/s...#OutlineViewer

The outline viewer jar file lives in the wpilib folder in your home directory.
If you are on windows that is C:\Users\<username>\wpilib
__________________
Blake
Electrical, Programming and Design

Creator FRC Q&A 2017
Mass FRC Team 4909: The Bionics
Maine FRC Team 5122: The RobOTies (2014-2015)
Maine FRC Team 2648: Infinite Loop (2008-2011)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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