12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #pragma once
- #include <AP_HAL/utility/Socket.h>
- #include "SIM_Aircraft.h"
- namespace SITL {
- class CRRCSim : public Aircraft {
- public:
- CRRCSim(const char *frame_str);
-
- void update(const struct sitl_input &input) override;
-
- static Aircraft *create(const char *frame_str) {
- return new CRRCSim(frame_str);
- }
- private:
-
- struct servo_packet {
- float roll_rate;
- float pitch_rate;
- float throttle;
- float yaw_rate;
- float col_pitch;
- };
-
- struct fdm_packet {
- double timestamp;
- double latitude, longitude;
- double altitude;
- double heading;
- double speedN, speedE, speedD;
- double xAccel, yAccel, zAccel;
- double rollRate, pitchRate, yawRate;
- double roll, pitch, yaw;
- double airspeed;
- };
- void send_servos_heli(const struct sitl_input &input);
- void send_servos_fixed_wing(const struct sitl_input &input);
- void recv_fdm(const struct sitl_input &input);
- void send_servos(const struct sitl_input &input);
- bool heli_servos;
- double last_timestamp;
- SocketAPM sock;
- };
- }
|