![]() |
How To Implement Axis Camera In Iterative Robot
Hi,
I am trying to implement the AxisCamera class into our Iterative Robot method, but unfortunately, the AixsCamera class has a difficult time initializing properly. We currently have: Code:
...Code:
AxisCamera &camera = AxisCamera::GetInstance();I am pretty novice to all this allocation and stuff, so I would love to have any sort of feedback! Thanks! -Masoug |
Re: How To Implement Axis Camera In Iterative Robot
Do you have it just like that? or do you have the variable declared up top?
class yourRobotClass: public iterativebot { AxisCamera &camera;//declare here public: yourRobotClass()://constructor camera(AxisCamera::GetInstance())//init here { } |
Re: How To Implement Axis Camera In Iterative Robot
Thanks for the quick reply!
Um, we had it like that. Quote:
Code:
AxisCamera* camera;Sorry, I am not that familiar with C++ pointers and addresses... Can you also explain your code a little more clearly? E.G. Code:
camera(AxisCamera::GetInstance());Thanks! -Masoug |
Re: How To Implement Axis Camera In Iterative Robot
constructors are public (in every program I've seen)
The & makes the variable camera a reference. A reference is similar to a pointer, however once it it set it cannot be changed, and it acts like a non-pointer variable after being set (Use the . operator to access funtions instead of -> ) The camera(AxisCamera::GetInstance()); sets the camera reference to the global AxisCamera object. From that point on if you want to do something like get an image the code is camera.GetImage(imageVar); |
Re: How To Implement Axis Camera In Iterative Robot
Quote:
.net has quite a few classes that don't have public constructors (like Graphics) |
Re: How To Implement Axis Camera In Iterative Robot
Thanks!
Now it compiles, but I have a few questions: Quote:
Code:
function() : another_thing(){}How does that exactly work? -Masoug |
Re: How To Implement Axis Camera In Iterative Robot
No inheritance here. another_thing is a variable defined somewhere else. It gets set with the value in the parentheses when the function is called.
|
Re: How To Implement Axis Camera In Iterative Robot
Quote:
Code:
camera = AxisCamera::GetInstance()I heard about "initialization list", but what/why is this a case to use it? What about AxisCamera class that it has to bee initialized as a reference? Thanks! -Masoug |
Re: How To Implement Axis Camera In Iterative Robot
Quote:
The GetInstance returns a reference, so it has to be a reference or a pointer |
Re: How To Implement Axis Camera In Iterative Robot
We still have the same problem, when I implement it in the method:
Code:
class yourRobotClass: public iterativebotCode:
Relocation value does not fit in 24 bits.Thanks! -Masoug |
Re: How To Implement Axis Camera In Iterative Robot
Quote:
|
Re: How To Implement Axis Camera In Iterative Robot
I checked and "-mlongcall" was already there and the cRIO still complains about "Relocation value does not fit in 24 bits."
Is there any other thing we can do? Thanks! -Masoug |
| All times are GMT -5. The time now is 12:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi