Log in

View Full Version : Vision/AxisCamera2010.h


PlaidPillagers
16-02-2010, 18:37
After the update to 4.2, WindRiver can't find the Vision/AxisCamera2010.h file.

Without it I can't use any of my camera code. I tried the work around suggested in other threads by Heydowns, but that didn't change anything.

Could someone help me please?

Thanks,
Matt

oddjob
16-02-2010, 19:19
Try this:


#include "Vision/AxisCamera.h"


At least you'll be able to compile your code. But if you have been reading the threads here, the camera code is apparently broken in the latest software. YMMV.

kennypu
16-02-2010, 19:23
yes, if you use the latest one, its broken without using a patch, if you updated to 4.1 just do what oddjob said.

PlaidPillagers
16-02-2010, 23:20
Thanks, I got that working.

But now, my drivers station is telling me there is no robot code. I rebuilt the code, reimaged (v20 still), rebooted everything, and repeated. No luck. Any ideas?

Alan Anderson
17-02-2010, 00:29
But now, my drivers station is telling me there is no robot code. I rebuilt the code, reimaged (v20 still), rebooted everything, and repeated. No luck. Any ideas?

Each time you reimage, you erase any user code that might be on the cRIO in the process. You have to put your program on the cRIO after loading the v20 image.

Radical Pi
17-02-2010, 00:34
If you are running WPILib 4.1, then any use of the DriverStationLCD class will crash robot code, sending that error. If using 4.2, then use of the AxisCamera class will crash code. I know, it's stupid

jhersh
17-02-2010, 03:08
If you are running WPILib 4.1, then any use of the DriverStationLCD class will crash robot code, sending that error. If using 4.2, then use of the AxisCamera class will crash code. I know, it's stupid

Nothing changed with the camera code between 4.1 and 4.2. 4.2 just recompiled to make a symbol be found. The camera code was pretty much completely rewritten for update 4.1, so expect to retrofit a few things here and there if you were already using it.

-Joe

Zme
17-02-2010, 12:55
if i may make a suggestion, if it is saying an unresolved symbol after the update why not use the FIRSTForge svn to just pull down the .h and .cpp files and put them directly into the project, much simpler than trying to patch a precompiled library in my opinion.

just my two cents though

if someone can't find the needed files i think i could dig them out of my project and put them back to normal, just let me know

Mike Mahar
17-02-2010, 16:09
Nothing changed with the camera code between 4.1 and 4.2. 4.2 just recompiled to make a symbol be found. The camera code was pretty much completely rewritten for update 4.1, so expect to retrofit a few things here and there if you were already using it.

-Joe

Joe,
The 4.2 precompiled WPILIB does not have the camera code in it. I duplicated this from the sources in firstforge. First, I checked out the latest sources, created a workbench project from them and did a build. That build had the DriverStationLCD kLineLength symbol problem. I got around this bug by moving the const declaration out of the DriverStationLCD class into the file scope. Then I did a build of the WPILIB again. The result of that build has the problem with the missing AxisCamera that many people are reporting. Thinking that there might be a problem with the make dependencies, I did a clean of the whole WPILIB project and rebuilt the whole thing. The library that resulted from this build does not have the kLineLength problem nor does it have the AxisCamera problem either.

My guess is that the WPILIB that is in the 4.2 release was built after changing only the DriverStationLCD code and the AxisCamera code was left out. Doing a clean build should resolve the problem.

PlaidPillagers
17-02-2010, 18:18
Okay, so I've isolated my problem. It's the axis camera.
Whenever I download code that uses the camera, the drivers station says "No robot code"

I'm not getting any error messages at all, it just doesn't work.

Has anyone found a work around/patch/other solution? I need to do a lot of coding for my camera still....

P.S. does anyone know if WPI/FIRST is fixing this?

jhersh
17-02-2010, 19:26
P.S. does anyone know if WPI/FIRST is fixing this?

Brad at WPI is looking into this.

jhersh
17-02-2010, 19:27
Has anyone found a work around/patch/other solution? I need to do a lot of coding for my camera still....

A work around was explained in the post before yours.

PlaidPillagers
17-02-2010, 20:33
Joe,
The 4.2 precompiled WPILIB does not have the camera code in it. I duplicated this from the sources in firstforge.

Could anyone go into a bit more detail on how to do this please? Thank you.

Radical Pi
17-02-2010, 21:25
Could anyone go into a bit more detail on how to do this please? Thank you.

Easiest way is to get an account on FirstForge and get the source through svn. Windriver should be able to compile the code for WPILib and you just replace the current executable

BradAMiller
17-02-2010, 21:35
I just rebuilt the library and posted it at:
http://first.wpi.edu/FRC/frccupdates.html

Please give it a try by installing the update and relinking. Let us know if it works.

Sorry for the confusion, I think we hit some limit in the library that's making the build process somewhat unpredictable.

PlaidPillagers
17-02-2010, 22:16
I just rebuilt the library and posted it at:
http://first.wpi.edu/FRC/frccupdates.html

Please give it a try by installing the update and relinking. Let us know if it works.

Sorry for the confusion, I think we hit some limit in the library that's making the build process somewhat unpredictable.

Downloaded and installed. I rebuilt and downloaded my project, and these three lines still crash my code ("No robot code"):
AxisCamera &camera = AxisCamera::GetInstance();
camera.WriteResolution(AxisCameraParams::kResoluti on_160x120);
camera.WriteBrightness(0);

Any further suggestions?

Zme
17-02-2010, 23:38
attach a console to it so you can watch the boot progress, what error is it giving?

PlaidPillagers
17-02-2010, 23:43
attach a console to it so you can watch the boot progress, what error is it giving?

Could you walk me through attaching a console?

Zme
17-02-2010, 23:50
couple of ways to do it, one is flip the console out dip switch on the crio and attach to the serial port through a null modem to a computer that is running some console program (terminal.exe works or there is one built into windriver) second is to open up a net console, right click on the remote host in windriver (after connecting to it) then go to target tools and finally target console, a dialog box should pop up just hit ok,

i don't know how well the target console will work to watch the crio boot though, might connect to late, there is another way to do it but i don't know it so someone else will have to help you out with that
best of luck
Zme

misko
18-02-2010, 00:31
I just rebuilt the library and posted it at:
http://first.wpi.edu/FRC/frccupdates.html

Please give it a try by installing the update and relinking. Let us know if it works.

Sorry for the confusion, I think we hit some limit in the library that's making the build process somewhat unpredictable.

Thanks. Downloaded and installed. It fixes the unresolved problems with the previous version. I'm not having the issues plaid is having. Plaid, perhaps confirm that your crio is running the v20 code by checking the version under the drive station diagnostics tab?

PlaidPillagers
18-02-2010, 10:51
I reinstalled all of the updates, and that helped. The camera code works now, and everything is considerably better.

There is a significant lag time on the camera to the DS display however. Is that normal?

Zme
18-02-2010, 11:31
to a point yes, how much lag are you talking?

PlaidPillagers
18-02-2010, 11:53
At its worst roughly from a second and a half to two seconds. In general though about half that.

Zme
18-02-2010, 12:00
a half second i believe is the spec for the updated code for everything
try lowering the resolution, making sure the driverstation is not having its processing power strangled by windows power management, connect it via ethernet to the router, remove the live readout graphs from the dashboard if you have not already done so.

other than that i don't know what to tell you
good luck

Greg McKaskle
19-02-2010, 08:27
All good advice, but from my testing, the charts on the dashboard do not add much load. I saw no difference with or without the charts.

Another thing that will help is to limit the FPS of the camera to what you need rather than telling it to go full 30fps.

Greg McKaskle

Zme
19-02-2010, 08:49
we saw, (or thought we saw at least) a significant difference with and with out them, haven't run any tests though so can't say for sure

PlaidPillagers
19-02-2010, 16:46
My camera code has gone back to crashing my robot.
Doing this will build and download:
AxisCamera *camera;
and this builds but does the same "no robot code" thing on the drivers station:
AxisCamera &camera = AxisCamera::GetInstance();

I reimaged our crio (v20) and redownloaded the code. No help. I reinstalled workbench update 4.3, remiaged the crio, and redownloaded code. Still nothing.

It was working yesterday morning and it doesn't work now but I'm convinced it's a library problem.

byteit101
19-02-2010, 18:44
try rebuilding (right click project>Rebuild) It often solves some of our problems

PlaidPillagers
19-02-2010, 22:52
try rebuilding (right click project>Rebuild) It often solves some of our problems

I've tried that already.

The situation has gotten worse, the Drivers Station LCD now also puts the robot in the same situation... help!

SuperBK
20-02-2010, 00:08
I tried to add the minimum camera code to the simple template to get camera to the dashboard. It builds, but when i download it it doesn't run because a symbol is missing: AxisCamera::GetInstance();

My includes are
#include "WPILib.h"
#include "Vision/AxisCamera.h"
#include "Vision/HSLImage.h"

My code calls:
AxisCamera &camera = AxisCamera::GetInstance();
HSLImage image;
camera.GetImage(&image);


Are those right?

You you have to call GetImage to get it to display on the dashboard?

Has anybody had any luck with the updated wplib?

Brian

misko
20-02-2010, 00:48
I tried to add the minimum camera code to the simple template to get camera to the dashboard. It builds, but when i download it it doesn't run because a symbol is missing: AxisCamera::GetInstance();

My includes are
#include "WPILib.h"
#include "Vision/AxisCamera.h"
#include "Vision/HSLImage.h"

My code calls:
AxisCamera &camera = AxisCamera::GetInstance();
HSLImage image;
camera.GetImage(&image);


Are those right?

You you have to call GetImage to get it to display on the dashboard?

Has anybody had any luck with the updated wplib?

Brian


Sounds like you have the version 4.2 of WPILib loaded. Load WPILib version 4.3, relink and download the new version.