mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
Rover: added AP_Button support
This commit is contained in:
parent
cb5ca713a9
commit
fd0f31dc44
@ -79,6 +79,7 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = {
|
|||||||
SCHED_TASK(frsky_telemetry_send, 5, 100),
|
SCHED_TASK(frsky_telemetry_send, 5, 100),
|
||||||
#endif
|
#endif
|
||||||
SCHED_TASK(dataflash_periodic, 50, 300),
|
SCHED_TASK(dataflash_periodic, 50, 300),
|
||||||
|
SCHED_TASK(button_update, 5, 100),
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -552,6 +552,10 @@ const AP_Param::Info Rover::var_info[] = {
|
|||||||
// @Path: ../libraries/AP_Notify/AP_Notify.cpp
|
// @Path: ../libraries/AP_Notify/AP_Notify.cpp
|
||||||
GOBJECT(notify, "NTF_", AP_Notify),
|
GOBJECT(notify, "NTF_", AP_Notify),
|
||||||
|
|
||||||
|
// @Group: BTN_
|
||||||
|
// @Path: ../libraries/AP_Button/AP_Button.cpp
|
||||||
|
GOBJECT(button, "BTN_", AP_Button),
|
||||||
|
|
||||||
AP_VAREND
|
AP_VAREND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -195,6 +195,7 @@ public:
|
|||||||
k_param_steerController,
|
k_param_steerController,
|
||||||
k_param_barometer,
|
k_param_barometer,
|
||||||
k_param_notify,
|
k_param_notify,
|
||||||
|
k_param_button,
|
||||||
|
|
||||||
k_param_DataFlash = 253, // Logging Group
|
k_param_DataFlash = 253, // Logging Group
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
#include <AP_BattMonitor/AP_BattMonitor.h> // Battery monitor library
|
#include <AP_BattMonitor/AP_BattMonitor.h> // Battery monitor library
|
||||||
#include <AP_OpticalFlow/AP_OpticalFlow.h> // Optical Flow library
|
#include <AP_OpticalFlow/AP_OpticalFlow.h> // Optical Flow library
|
||||||
#include <AP_RSSI/AP_RSSI.h> // RSSI Library
|
#include <AP_RSSI/AP_RSSI.h> // RSSI Library
|
||||||
|
#include <AP_Button/AP_Button.h>
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -134,6 +135,7 @@ private:
|
|||||||
Compass compass;
|
Compass compass;
|
||||||
AP_InertialSensor ins;
|
AP_InertialSensor ins;
|
||||||
RangeFinder sonar { serial_manager };
|
RangeFinder sonar { serial_manager };
|
||||||
|
AP_Button button;
|
||||||
|
|
||||||
// flight modes convenience array
|
// flight modes convenience array
|
||||||
AP_Int8 *modes;
|
AP_Int8 *modes;
|
||||||
@ -454,6 +456,7 @@ private:
|
|||||||
void reset_control_switch();
|
void reset_control_switch();
|
||||||
void read_trim_switch();
|
void read_trim_switch();
|
||||||
void update_events(void);
|
void update_events(void);
|
||||||
|
void button_update(void);
|
||||||
void navigate();
|
void navigate();
|
||||||
void set_control_channels(void);
|
void set_control_channels(void);
|
||||||
void init_rc_in();
|
void init_rc_in();
|
||||||
|
@ -119,3 +119,11 @@ void Rover::read_sonars(void)
|
|||||||
obstacle.turn_angle = 0;
|
obstacle.turn_angle = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
update AP_Button
|
||||||
|
*/
|
||||||
|
void Rover::button_update(void)
|
||||||
|
{
|
||||||
|
button.update();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user