Ravens Robotics FRC 2015
Public Member Functions | Private Attributes | List of all members
Camera Class Reference

#include <Camera.h>

Inheritance diagram for Camera:
RobotComponent

Public Member Functions

 Camera ()
 
virtual ~Camera ()
 
virtual void ComponentInit ()
 
virtual void Sense ()
 
virtual void DoWork ()
 
- Public Member Functions inherited from RobotComponent
 RobotComponent ()
 
virtual ~RobotComponent ()
 

Private Attributes

Joystick * m_Stick
 joystick controller More...
 
Servo * m_Camera
 camera servo instance More...
 
float m_CameraServoPosition
 current camera servo position More...
 
uint32_t m_CameraMove
 command value received More...
 

Detailed Description

The Camera RobotComponent provides control of the camera servo.

No functioning of the camera itself is controlled by this component.

Buttons 3 and 4 on the Auxiliary controller are mapped to servo up and down, respetively.

Upon initialization, the camera is moved to its starting position, defined by kCameraFirstPos.

Range of motion is contained between kMaxCameraServoPosition and temp=kMinCameraServoPosition.

Definition at line 29 of file Camera.h.

Constructor & Destructor Documentation

Camera::Camera ( )

Definition at line 13 of file Camera.cpp.

References m_Camera, m_CameraMove, m_CameraServoPosition, and m_Stick.

Camera::~Camera ( )
virtual

Definition at line 21 of file Camera.cpp.

References m_Camera, and m_Stick.

Member Function Documentation

void Camera::ComponentInit ( )
virtual

Called once, to perform initialization that isn't appropriate for constructor.

Camera servo is moved to its starting position, kCameraFirstPos.

Reimplemented from RobotComponent.

Definition at line 30 of file Camera.cpp.

References kStickChannel, m_Camera, m_CameraServoPosition, and m_Stick.

Referenced by Robot::RobotInit().

void Camera::DoWork ( )
virtual

Component-specific worker function. Move camera servo according to last info from Sense(). Range of motion is contained between kMaxCameraServoPosition and temp=kMinCameraServoPosition. Report operation to SmartDashboard.

Reimplemented from RobotComponent.

Definition at line 57 of file Camera.cpp.

References m_Camera, m_CameraMove, and m_CameraServoPosition.

Referenced by Robot::TeleopPeriodic().

void Camera::Sense ( )
virtual

Component-specific sensory input collector. Joystick buttons are read, and stored for use by DoWork().

Reimplemented from RobotComponent.

Definition at line 44 of file Camera.cpp.

References m_CameraMove, and m_Stick.

Referenced by Robot::TeleopPeriodic().

Member Data Documentation

Servo* Camera::m_Camera
private

camera servo instance

Definition at line 58 of file Camera.h.

Referenced by Camera(), ComponentInit(), DoWork(), and ~Camera().

uint32_t Camera::m_CameraMove
private

command value received

Definition at line 61 of file Camera.h.

Referenced by Camera(), DoWork(), and Sense().

float Camera::m_CameraServoPosition
private

current camera servo position

Definition at line 60 of file Camera.h.

Referenced by Camera(), ComponentInit(), and DoWork().

Joystick* Camera::m_Stick
private

joystick controller

Definition at line 57 of file Camera.h.

Referenced by Camera(), ComponentInit(), Sense(), and ~Camera().


The documentation for this class was generated from the following files: