Go to Post You enjoy your pepperoni pizza, I'll enjoy my cheese and peppers, and we can both agree that people that like pineapple on their pizza, while strange... are completely entitled to their opinions. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
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 01-02-2011, 12:13
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Anyone successful with camera in RobotPy?

With either RobotPy 2011.2 or the latest source from the repository, I am having problems getting off square one with the camera. Just calling the GetInstance() method of AxisCamera silently reboots the cRIO.

Has anyone had success with this? I have the M1011 model camera, and the C++ 2010ImageDemo runs flawlessly. But the PyResult is nasty.

I'm really just looking here to set my expectations, for example, if someone has been successful then how does their setup differ from mine. But it is also helpful for me to know if noone else gets it either.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2011, 11:50
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Well, OK... I'll take that as a "No."
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2011, 21:28
CastleBravo CastleBravo is offline
Registered User
FRC #0294 (Beach Cities Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Redondo Beach/127.0.0.1
Posts: 15
CastleBravo is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

We have the camera running with Python, although Peter had to add more of nivision to RobotPy so our code could run, and do more than simply display output to the driverstation. The only thing is NI Vision Assistant doesn't export code in Python, which makes it a bit trickier.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2011, 23:41
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Great, that's good to hear, that you've gotten that far, too. We had been having trouble just doing GetInstance()!

In fact, about an hour ago, I think we discovered the problem we were having. To work with the M1011 in C++, we had had to make some small modifications to the Vision portion of WPILib. What I did not fully realize until today, was RobotPy has its own copy of the WPILib source, which of course was not patched. Once that was also patched, presto, success!

The feed to the driver station, and to some of the nivision code I had waiting, worked fine. Now on to tuning...
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2011, 00:50
CastleBravo CastleBravo is offline
Registered User
FRC #0294 (Beach Cities Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Redondo Beach/127.0.0.1
Posts: 15
CastleBravo is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

If you need more help with it, I can ask Peter directly. He has been very busy, so I doubt he will be on CD much in the near future.
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2011, 09:24
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Anyone successful with camera in RobotPy?

Quote:
Originally Posted by BotnEyedJoe View Post
In fact, about an hour ago, I think we discovered the problem we were having. To work with the M1011 in C++, we had had to make some small modifications to the Vision portion of WPILib. What I did not fully realize until today, was RobotPy has its own copy of the WPILib source, which of course was not patched. Once that was also patched, presto, success!
I'm sure the wpilib maintainers would appreciate your patch http://firstforge.wpi.edu/sf/tracker....wpilib_c_bugs
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2011, 12:50
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Yes, agreed; I just need to sift through the actual changes made while investigating the problem, and determine which are significant and which are not...
Reply With Quote
  #8   Spotlight this post!  
Unread 06-02-2011, 23:19
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Quote:
Originally Posted by Joe Ross View Post
I'm sure the wpilib maintainers would appreciate your patch http://firstforge.wpi.edu/sf/tracker....wpilib_c_bugs
I have submitted artifact 1330 in the WPILib project in FIRST Forge (follow the link Joe Ross kindly gave to get there). The artifact includes a proposed fix to the relevant parts of WPILib, in the attachment. The proposed fix has been tested with the M1011 model camera in the 2010ImageDemo (the vision demo supplied with the C++ environment) and also in RobotPy (based on the latest code in the repository, but it should also work in 2011.2).
Reply With Quote
  #9   Spotlight this post!  
Unread 08-02-2011, 04:09
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Anyone successful with camera in RobotPy?

Quote:
Originally Posted by BotnEyedJoe View Post
I have submitted artifact 1330 in the WPILib project in FIRST Forge (follow the link Joe Ross kindly gave to get there). The artifact includes a proposed fix to the relevant parts of WPILib, in the attachment. The proposed fix has been tested with the M1011 model camera in the 2010ImageDemo (the vision demo supplied with the C++ environment) and also in RobotPy (based on the latest code in the repository, but it should also work in 2011.2).
Have you also tested it with the Axis 206 camera that many teams have? We would prefer not to break the other camera to make the new one work.

Thanks,
-Joe
Reply With Quote
  #10   Spotlight this post!  
Unread 08-02-2011, 11:29
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

We have not tested with the Axis 206. We don't have one. Hopefully, "someone" out there with one can pick up this change, and try it? Otherwise, I have a [somewhat lower-priority] item on my To-Do list, to try to locate ["borrow"] one for comparison testing... Sorry this answer isn't more helpful.
Reply With Quote
  #11   Spotlight this post!  
Unread 09-02-2011, 17:59
newkidd-sagar newkidd-sagar is offline
Registered User
FRC #1241
 
Join Date: Jan 2010
Location: Mississauga
Posts: 13
newkidd-sagar is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Hey guys, how do you replace the .cpp files in Windriver (the patch that is on FirstForge)?
Reply With Quote
  #12   Spotlight this post!  
Unread 09-02-2011, 21:06
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Quote:
Originally Posted by newkidd-sagar View Post
Hey guys, how do you replace the .cpp files in Windriver (the patch that is on FirstForge)?
Realize, please, that what you ask for is complicated, so please do not attempt this if you are not confident of the steps involved. Ask for help if you need it. <Insert strong disclaimers here>

This is probably all written somewhere semi-officially; I looked for such a reference with no success (surprising!) Anywhere, here goes...

Obtain the source for WPILib: This should be nothing more than un-zipping the WPILib<blahblah>rev2259.zip found in the C:/WindRiver/WPILib folder.

Import the WPILib project into Workbench: In Workbench, File -> Import... -> Existing Projects into Workspace (under General) -> Next -> Select "Select Root Directory" -> Browse... to where you un-zipped the source and click OK. "WPILib" should show up in the Projects box, make sure it is checked. You can also uncheck "Copy projects into workspace" if you want to build WPILib where you un-zipped it, or check this to copy it all into your WindRiver workspace tree. Click Finish.

The build process automatically calls a Subversion program to embed the software version into the compiled code. If you don't use Subversion, you'll need to modify the build process in one place: Right-click on your new WPILib project in the Project Explorer, and select Properties -> Build Properties -> the Build Tools tab -> select Build Tool: -> C++ Compiler, and in the Command: window, modify the part of the command that reads -D'SVN_REV="$(shell svnversion -n ..)"' so that the part inside the double quotes is a version string you want to see when your robot boots up. Then click Apply and OK to close the Properties dialog.

Build WPILib.a: Right-click on the WPILib project, and select Rebuild Project... -> Go take a break, and when you come back look in the file folder PPC603gnu\WPILib\Debug under your WPILib project. There should be a WPILib.a there. This is the library you want to link your robot code to. The original, official WPILib.a resides in WindRiver\vxworks-6.3\target\lib, and this is where your robot code project expects to find WPILib by default. If you replace the official WPILib.a, you want to do so in a careful, calculated, reasoned, and fully backed up manner.

Notice we have not *changed* WPILib yet, we merely built the official release ourselves. Link your robot code against your library, and prove that it works as well as the official version. Trust me, do not hurry this step.

Once you have established a working baseline WPILib, now proceed to attempt modifications. Get the .zip you mentioned from FIRST Forge, unzip the three files there into their corresponding places in your WPILib source tree. Repeat the "Build WPILib.a" step from above.

Link this new modified library with your robot code, and see if the camera is working better now. Make sure everything else you need works too. Report any problems back here and on the FIRST Forge artifact, thanks.
Reply With Quote
  #13   Spotlight this post!  
Unread 10-02-2011, 14:54
newkidd-sagar newkidd-sagar is offline
Registered User
FRC #1241
 
Join Date: Jan 2010
Location: Mississauga
Posts: 13
newkidd-sagar is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Quote:
Originally Posted by BotnEyedJoe View Post
Realize, please, that what you ask for is complicated, so please do not attempt this if you are not confident of the steps involved. Ask for help if you need it. <Insert strong disclaimers here>

This is probably all written somewhere semi-officially; I looked for such a reference with no success (surprising!) Anywhere, here goes...

Obtain the source for WPILib: This should be nothing more than un-zipping the WPILib<blahblah>rev2259.zip found in the C:/WindRiver/WPILib folder.

Import the WPILib project into Workbench: In Workbench, File -> Import... -> Existing Projects into Workspace (under General) -> Next -> Select "Select Root Directory" -> Browse... to where you un-zipped the source and click OK. "WPILib" should show up in the Projects box, make sure it is checked. You can also uncheck "Copy projects into workspace" if you want to build WPILib where you un-zipped it, or check this to copy it all into your WindRiver workspace tree. Click Finish.

The build process automatically calls a Subversion program to embed the software version into the compiled code. If you don't use Subversion, you'll need to modify the build process in one place: Right-click on your new WPILib project in the Project Explorer, and select Properties -> Build Properties -> the Build Tools tab -> select Build Tool: -> C++ Compiler, and in the Command: window, modify the part of the command that reads -D'SVN_REV="$(shell svnversion -n ..)"' so that the part inside the double quotes is a version string you want to see when your robot boots up. Then click Apply and OK to close the Properties dialog.

Build WPILib.a: Right-click on the WPILib project, and select Rebuild Project... -> Go take a break, and when you come back look in the file folder PPC603gnu\WPILib\Debug under your WPILib project. There should be a WPILib.a there. This is the library you want to link your robot code to. The original, official WPILib.a resides in WindRiver\vxworks-6.3\target\lib, and this is where your robot code project expects to find WPILib by default. If you replace the official WPILib.a, you want to do so in a careful, calculated, reasoned, and fully backed up manner.

Notice we have not *changed* WPILib yet, we merely built the official release ourselves. Link your robot code against your library, and prove that it works as well as the official version. Trust me, do not hurry this step.

Once you have established a working baseline WPILib, now proceed to attempt modifications. Get the .zip you mentioned from FIRST Forge, unzip the three files there into their corresponding places in your WPILib source tree. Repeat the "Build WPILib.a" step from above.

Link this new modified library with your robot code, and see if the camera is working better now. Make sure everything else you need works too. Report any problems back here and on the FIRST Forge artifact, thanks.
Thank you for such an in depth reply.

Just one thing I had doubts about was the -D'SVN_REV="$(shell svnversion -n ..)"' part. Could you clarify this a little bit. Where exactly do I put anything and what should I put ? Thank you for your help once again, I really appreciate it.

Last edited by newkidd-sagar : 10-02-2011 at 17:26. Reason: Ok never mind i figured that step out. Now I just need to know how to link my robot with the WPILib that I created
Reply With Quote
  #14   Spotlight this post!  
Unread 10-02-2011, 17:39
BotnEyedJoe BotnEyedJoe is offline
Mentor
AKA: Joe Hurler
no team
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Rosemont, PA
Posts: 29
BotnEyedJoe is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

By default, robot projects look to link against WPILib.a in the directory I gave under "Build WPILib.a". If you replace the standard WPILib.a installed there with yours, all your robot projects [the next time you link them] will begin to use your new library. BUT SAVE THE OLD LIBRARY FIRST! And label it, put it somewhere safe, for later when something goes wrong with your robot code and you want to rule out that the problem is in *your* version of the library.
Reply With Quote
  #15   Spotlight this post!  
Unread 10-02-2011, 19:11
newkidd-sagar newkidd-sagar is offline
Registered User
FRC #1241
 
Join Date: Jan 2010
Location: Mississauga
Posts: 13
newkidd-sagar is an unknown quantity at this point
Re: Anyone successful with camera in RobotPy?

Alright I got it working, and the camera works great now. I'm very pleased and thank you for your great instructions on building a custom WPILibrary. That should be documented. Thanks a lot once again!
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 12:30.

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