16 #include "generated/settings.h"
24 #include "generated/flight_plan.h"
26 #include "generated/modules.h"
28 #include <caml/mlvalues.h>
29 #include <caml/memory.h>
47 #if PERIODIC_FREQUENCY != 60
48 #warning "Simple OCaml sim can currently only handle a PERIODIC_FREQUENCY of 60Hz"
51 #if SYS_TIME_FREQUENCY != 120
52 #warning "Simple OCaml sim can currently only handle a SYS_TIME_FREQUENCY of 120Hz"
65 #if USE_GENERATED_AUTOPILOT
71 modules_periodic_task();
87 #if !USE_GENERATED_AUTOPILOT
99 return (t.tv_sec + t.tv_usec / 1e6);
118 ivy_tp.ivy_dl_enabled = Int_val(dl_enabled);
127 for (i = 0; i < COMMANDS_NB; i++) {
128 Store_field(val_commands, i, Val_int(
commands[i]));
131 return Val_int(
commands[COMMAND_THROTTLE]);
136 int n = string_length(s);
137 char *ss = String_val(s);
141 for (i = 0; i < n; i++) {
153 void *b __attribute__((unused)),
154 void *c __attribute__((unused)))
Communication between fbw and ap processes.
value get_commands(value val_commands)
value sim_monitor_task(value unit)
value sim_periodic_task(value unit)
Periodic telemetry system header (includes downlink utility and generated code).
Handling of messages coming from ground and other A/Cs.
value set_datalink_message(value s)
value sim_nav_task(value unit)
void navigation_task(void)
Compute desired_course.
void event_task_fbw(void)
void periodic_task_fbw(void)
uint16_t datalink_nb_msgs
Fixed wing horizontal control.
static void sys_tick_handler(void)
Vertical control for fixed wing vehicles.
value update_bat(value bat)
value update_dl_status(value dl_enabled)
Device independent GPS code (interface)
value sim_sys_time_task(value unit)
needs to be called at SYS_TIME_FREQUENCY
value sim_init(value unit)
Hardware independent code for commands handling.
struct ivy_transport ivy_tp
IVY transport structure.
void electrical_periodic(void)
Core autopilot interface common to all firmwares.
pprz_t commands[COMMANDS_NB]
Storage of intermediate command values.
uint16_t vsupply
supply voltage in decivolts
void autopilot_periodic(void)
AP periodic call.
uint8_t dl_buffer[MSG_SIZE]
void reporting_task(void)
Send a series of initialisation messages followed by a stream of periodic ones.
void monitor_task(void)
monitor stuff run at 1Hz
uint8_t link_fbw_fbw_nb_err
uint8_t inflight_calib_mode
void sensors_task(void)
Run at PERIODIC_FREQUENCY (60Hz if not defined)
struct Electrical electrical
static void DlCheckAndParse(struct link_device *dev, struct transport_tx *trans, uint8_t *buf, bool *msg_available)
Check for new message and parse.
Fixedwing Navigation library.
void adc_buf_channel(void *a, void *b, void *c)
Required by electrical.
AP ( AutoPilot ) process API.