MAVLinkHILSystemBase.java
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package me.drton.jmavsim;
import me.drton.jmavlib.mavlink.MAVLinkSchema;
import me.drton.jmavsim.vehicle.AbstractVehicle;
/**
* MAVLinkHILSystemBase is the superclass of MAVLinkHILSystem and MAVLinkDisplayOnly. It is a bridge between
* AbstractVehicle and autopilot connected via MAVLink.
* MAVLinkHILSystemBase should have the same sysID as the autopilot, but different componentId.
*/
public abstract class MAVLinkHILSystemBase extends MAVLinkSystem {
protected Simulator simulator;
protected AbstractVehicle vehicle;
/**
* Create MAVLinkHILSimulator, MAVLink system that sends simulated sensors to autopilot and passes controls from
* autopilot to simulator
*
* @param sysId SysId of simulator should be the same as autopilot
* @param componentId ComponentId of simulator should be different from autopilot
* @param vehicle vehicle to connect
*/
public MAVLinkHILSystemBase(MAVLinkSchema schema, int sysId, int componentId, AbstractVehicle vehicle) {
super(schema, sysId, componentId);
this.vehicle = vehicle;
}
public void setSimulator(Simulator simulator) {
this.simulator = simulator;
}
public abstract boolean gotHilActuatorControls();
public abstract void initMavLink();
public abstract void endSim();
}