|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: PID controller with camera.
It looks like you are using the wrong shared pointer, both Robot and RobotMap they have a shared pointer named visionAlignPID. It looks like the one in Robot does not contain a pointer, while in RobotMap you set the visionAlignPID shared pointer to a PIDController.
I think you should change Code:
Robot::visionAlignPID.get()->Enable(); Code:
RobotMap::visionAlignPID.get()->Enable(); |
|
#2
|
||||
|
||||
|
Re: PID controller with camera.
Alright, it doesn't instantly crash now, but when I call PIDWrite() it crashes. Am I inheriting the PIDSource wrong?
|
|
#3
|
||||
|
||||
|
Re: PID controller with camera.
It looks like you're using a system that centers itself in the pixel. Jared Russel has talked before about why this isn't a good idea, but the general complaint is that a camera has too high of a latency (even when plugged in via USB or equivalent) to be used in a PID loop. Instead of calculating the offset from the center, try and calculate values that might help you align. The distance, azimuth, and altitude are values that you might be most concerned about.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|