APM:Libraries
AP_IRLock_SITL.h
Go to the documentation of this file.
1 /*
2  * AP_IRLock_SITL.h
3  *
4  * Created on: June 09, 2016
5  * Author: Ian Chen
6  */
7 #pragma once
8 
10 #if CONFIG_HAL_BOARD == HAL_BOARD_SITL
11 #include "IRLock.h"
12 
13 class AP_IRLock_SITL : public IRLock
14 {
15 public:
17 
18  // init - initialize sensor library
19  void init(int8_t bus) override;
20 
21  // retrieve latest sensor data - returns true if new data is available
22  bool update() override;
23 
24 private:
25 
26  /*
27  reply packet sent from simulator to ArduPilot
28  */
29  struct irlock_packet {
30  uint64_t timestamp; // in miliseconds
31  uint16_t num_targets;
32  float pos_x;
33  float pos_y;
34  float size_x;
35  float size_y;
36  };
37 
38  uint32_t _last_timestamp;
39  SocketAPM sock;
40 };
41 #endif // CONFIG_HAL_BOARD
SocketAPM sock
bool update() override
Definition: IRLock.h:26
void init(int8_t bus) override
uint32_t _last_timestamp