CARMA C++
Drive.h
Go to the documentation of this file.
1 
9 #ifndef CARMA_ANTENNA_OVRO_CANBUS_DRIVE_H
10 #define CARMA_ANTENNA_OVRO_CANBUS_DRIVE_H
11 
13 #include "carma/monitor/OvroSubsystem.h"
14 
15 namespace carma {
16 
17 namespace services {
18  class Angle;
19  class Table;
20 } // End namespace services
21 
22 namespace antenna {
23 namespace ovro {
24 
34  public:
35 
44  explicit Drive( carma::canbus::CanOutput & canOutput,
45  carma::monitor::OvroSubsystem & monitorSubsys,
46  unsigned short antNo,
47  const std::string confFilename =
48  "antenna/ovro/drive.conf" );
49 
53  virtual ~Drive( );
54 
61  void setAzElDriveRates( double azRateInRadPerS,
62  double elRateInRadPerS,
63  const carma::services::Angle & elevation );
64 
70  void stop( );
71 
83  double mjd;
84  bool azOverlapDetected;
85  };
86 
94 
95 
100  bool getControllerOvertemp() const;
101 
105  bool isDriveEnabled( ) const;
106 
115  bool isAtHwLimit( ) const;
116 
120  bool isInEngineeringMode( ) const;
121 
126  OFF, // Off (disabled)
127  REMOTE_CONTROL, // Computer control
128  LOCAL_CONTROL // Handpaddle control
129  };
130 
131  BaseSwitchState getBaseSwitchState( ) const;
132 
137 
142 
147  void processMsg( carma::canbus::msgType messageId,
148  ::std::vector< carma::canbus::byteType > & data,
149  bool sim );
150 
156 
163  void setRawDriveVoltages( float azRawVolts, float elRawVolts );
164 
169  void setEngineeringMode( bool enable );
170 
178  void updateConfDataFromFile( );
179 
186  void writeMonitorData( );
187 
188  protected:
189 
190  private:
191 
192  void enableDrives( bool enable );
193 
194  void setDriveVoltages( float azVolts, float elVolts );
195 
196  void setMaxVoltage( float azMaxVolts, float elMaxVolts );
197 
198  void initialize( ); // Issued in response to an initReq
199 
200  void updateFrameData( );
201 
202  void processBlankingFramePacket1( carma::canbus::DataVector & data );
203  void processBlankingFramePacket2( carma::canbus::DataVector & data );
204  void processBlankingFramePacket3( carma::canbus::DataVector & data );
205  void processBlankingFramePacket4( carma::canbus::DataVector & data );
206  void processBlankingFramePacket5( carma::canbus::DataVector & data );
207  void processBlankingFramePacket6( carma::canbus::DataVector & data );
208  void processBlankingFramePacket7( carma::canbus::DataVector & data );
209 
210  carma::canbus::Message simulateBlankingFramePacket1( );
211  carma::canbus::Message simulateBlankingFramePacket2( );
212  carma::canbus::Message simulateBlankingFramePacket3( );
213  carma::canbus::Message simulateBlankingFramePacket4( );
214  carma::canbus::Message simulateBlankingFramePacket5( );
215  carma::canbus::Message simulateBlankingFramePacket6( );
216  carma::canbus::Message simulateBlankingFramePacket7( );
217 
218  carma::monitor::OvroSubsystem & mon_;
219  carma::monitor::OvroSubsystem::DriveModule & driveMon_;
220  carma::monitor::OvroSubsystem::Limit & limitMon_;
221  carma::monitor::OvroSubsystem::Track & trackMon_;
222  carma::monitor::AntennaCommon & comMon_;
223 
224  const unsigned short antNo_;
225  const ::std::string configFilename_;
226 
227  struct SimInfo;
228  struct Shared;
229  std::auto_ptr< Shared > shared_;
230  std::auto_ptr< carma::services::Table > table_;
231 
232  }; // class Drive
233 
234 }}} // namespace carma::antenna::ovro
235 #endif
TimestampedAzOverlapState getAzOverlapState() const
Retrieve boolean indicating if azimuth is in the overlap region.
bool isInEngineeringMode() const
Is module in engineering mode?
::std::map< ::carma::canbus::msgType,::std::string > MsgIdInfoMap
Alias for an ::std::map containing a string description of a message id, keyed by the described carma...
Definition: Device.h:30
Class to encapsulate a CAN message.
Definition: Message.h:21
carma::canbus::MsgIdInfoMap getSlowMonitors() const
Get map of slow monitor points processed by this class.
XacDevice canbus::device class implementation.
Definition: XacDevice.h:37
bool isDriveEnabled() const
Retrieve boolean indicating if drive is enabled.
void processMsg(carma::canbus::msgType messageId,::std::vector< carma::canbus::byteType > &data, bool sim)
Process CAN message.
Drive(carma::canbus::CanOutput &canOutput, carma::monitor::OvroSubsystem &monitorSubsys, unsigned short antNo, const std::string confFilename="antenna/ovro/drive.conf")
Constructor.
void setEngineeringMode(bool enable)
Set engineering mode.
void setAzElDriveRates(double azRateInRadPerS, double elRateInRadPerS, const carma::services::Angle &elevation)
Set azimuth and elevation drive rates.
void writeMonitorData()
Write monitor data.
carma::canbus::Message simulateMsg(carma::canbus::msgType messageId)
Simulate CAN message.
Simple ASCII Table format, fully memory based.
Definition: Table.h:126
::std::vector< ::carma::canbus::byteType > DataVector
Alias for CAN data.
Definition: Types.h:72
The Angle class can represent any angle in any units.
Definition: Angle.h:38
10-m Antenna Drive Module CAN Implementation (API No.
Definition: Drive.h:33
void setRawDriveVoltages(float azRawVolts, float elRawVolts)
Set raw drive voltages for engineering purposes.
carma::canbus::devices::XacDevice class declaration.
bool getControllerOvertemp() const
Retrieve boolean indicating if any of the three drive controllers shows an overtemp fault...
carma::canbus::MsgIdInfoMap getHalfSecMonitors() const
Get map of half second monitor points processed by this class.
void updateConfDataFromFile()
Update configuration parameters from conf file.
bool isAtHwLimit() const
Retrieve boolean indicating if drive is at a hw limit.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69
CanOutput interface.
Definition: CanOutput.h:26
virtual ~Drive()
Destructor.
BaseSwitchState
Enum describing base switch state.
Definition: Drive.h:125
void stop()
Stop the drives This is just a shortcut for enabling the drives followed by seting the drive rates to...