|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Well, OK... I'll take that as a "No."
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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... |
|
#5
|
|||
|
|||
|
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.
|
|
#6
|
||||||
|
||||||
|
Re: Anyone successful with camera in RobotPy?
Quote:
|
|
#7
|
|||
|
|||
|
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...
|
|
#8
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Quote:
|
|
#9
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Quote:
Thanks, -Joe |
|
#10
|
|||
|
|||
|
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.
|
|
#11
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Hey guys, how do you replace the .cpp files in Windriver (the patch that is on FirstForge)?
|
|
#12
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Quote:
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. |
|
#13
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Quote:
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 |
|
#14
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
Quote:
Please let me know if you encounter any problems. |
|
#15
|
|||
|
|||
|
Re: Anyone successful with camera in RobotPy?
2 Questions.
1) My team just wants video feed from the camera back to the driver station. Can I do this without the default RobotPy or do I have to apply all of the fixes discussed in this thread and build from source? 2) I'm not sure which camera we have. I recognize it from the picture in the KoP list, but the description says: "Camera, Axis M1011 206 color camera..." So, is it the M1011 or the 206? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|