|
PiImageStreamer
|
#include <CameraController.h>


Public Member Functions | |
| CameraController (AbstractImageTransmitter &transmitter, int azimuthPinNumber, int elevationPinNumber, std::string threadName, uint32_t taskRate) | |
| virtual | ~CameraController () |
| void | taskMethod () |
| void | setElevation (int elevation) |
| void | setRotation (int rotation) |
| virtual void | startChildTasks () |
| virtual void | stopChildTasks () |
Public Member Functions inherited from SWE4211RPi::PeriodicTask | |
| PeriodicTask (std::string threadName, uint32_t period, int priority=1) | |
| virtual | ~PeriodicTask () |
| virtual void | setTaskPeriod (uint32_t period) final |
| virtual uint32_t | getTaskPeriod () final |
| void | run () final |
| virtual void | printInformation () |
| virtual double | getCPUUsageInfo () |
| virtual void | resetThreadDiagnostics () |
Public Member Functions inherited from SWE4211RPi::RunnableClass | |
| RunnableClass (std::string threadName, int priority=0) | |
| virtual | ~RunnableClass () |
| virtual pid_t | getThreadID () |
| virtual void | start () final |
| virtual void | setPriority (int priority) final |
| virtual int | getPriority () final |
| virtual bool | isShutdown () final |
| virtual bool | isStarted () final |
| virtual void | stopThreadExecution () |
| virtual void | waitForShutdown () |
Private Attributes | |
| int | elevation = 0 |
| std::atomic_int | desiredElevation = {0} |
| int | rotation = 0 |
| std::atomic_int | desiredRotation = {0} |
| AbstractImageTransmitter & | myTransmitter |
| PulsedGPIOPin * | azimuthPin |
| PulsedGPIOPin * | elevationPin |
Additional Inherited Members | |
Static Public Member Functions inherited from SWE4211RPi::RunnableClass | |
| static void | printThreads () |
| static void | resetAllThreadInformation () |
Protected Member Functions inherited from SWE4211RPi::PeriodicTask | |
| virtual void | startChildRunnables () final |
| virtual void | stopChildRunnables () final |
Protected Attributes inherited from SWE4211RPi::PeriodicTask | |
| uint32_t | taskPeriod = 100000 |
Protected Attributes inherited from SWE4211RPi::RunnableClass | |
| std::thread * | myThread = NULL |
| pthread_t | executingThread = 0 |
| pid_t | myOSThreadID = 0 |
| std::string | myName |
| std::atomic< bool > | keepGoing {true} |
| std::atomic< bool > | runCompleted {false} |
| std::atomic< bool > | runStarted {false} |
| int | priority = -1 |
Static Protected Attributes inherited from SWE4211RPi::RunnableClass | |
| static std::list< RunnableClass * > | runningThreads |
This class controls the camera's servos and the image transmitter's destination.
| CameraController::CameraController | ( | AbstractImageTransmitter & | transmitter, |
| int | azimuthPinNumber, | ||
| int | elevationPinNumber, | ||
| std::string | threadName, | ||
| uint32_t | taskRate | ||
| ) |
This will construct a new camera controller, creating the pins that drive the servos.
| transmitter | This is the image transmitter whose destination is to be controlled. |
| azimuthPinNumber | This is the GPIO pin number for the azimuth (rotation) servo. |
| elevationPinNumber | This is the GPIO pin number for the elevation servo. |
| threadName | This is the name of the thread that is to execute. |
| taskRate | This is the period for the task, given in microseconds. |

|
virtual |
This is the destructor for the class. It deletes the servo pins.
| void CameraController::setElevation | ( | int | elevation | ) |
This method will set the elevation that the camera is to move to. Values outside of -45 to 90 degrees are ignored.
| elevation | This is the desired elevation, in degrees. |

| void CameraController::setRotation | ( | int | rotation | ) |
This method will set the rotation (azimuth) that the camera is to move to. Values outside of -90 to 90 degrees are ignored.
| rotation | This is the desired rotation, in degrees. |

|
virtual |
This method will start up any runnable objects which are contained within this class, which are the servo pins. If there are no other objects that are runnable, there is no need to override this method. However, if a child class contains an instance of a runnable object, then this method must be overridden in the derived class.
Reimplemented from SWE4211RPi::PeriodicTask.

|
virtual |
This method will stop any runnable objects which are contained within this class, which are the servo pins.
Reimplemented from SWE4211RPi::PeriodicTask.

|
virtual |
This is the task method for the class. It will process any queued messages, then move the servos toward their desired positions.
Implements SWE4211RPi::PeriodicTask.

|
private |
This is the pin that drives the azimuth (rotation) servo.
|
private |
This is the elevation the camera is moving toward, in degrees (-45 to 90). It is atomic as it may be set from another thread.
|
private |
This is the rotation the camera is moving toward, in degrees (-90 to 90). It is atomic as it may be set from another thread.
|
private |
This is the current elevation of the camera, in degrees.
|
private |
This is the pin that drives the elevation servo.
|
private |
This is the image transmitter whose destination is updated when a client connects or disconnects.
|
private |
This is the current rotation (azimuth) of the camera, in degrees.