Skip to content

Commit

Permalink
Rover: Add Absolute Encoder Support
Browse files Browse the repository at this point in the history
This instantiates the absolute encoder driver in rover, for use in the AP_Windvane Driver.
  • Loading branch information
DavidIngraham committed Dec 11, 2023
1 parent 649a7fe commit 3b066e2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Rover/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,10 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Path: mode_circle.cpp
AP_SUBGROUPINFO(mode_circle, "CIRC", 57, ParametersG2, ModeCircle),

// @Group: AENC
// @Path: ../libraries/AP_AbsoluteEncoder/AP_AbsoluteEncoder.cpp
AP_SUBGROUPINFO(absoluteencoder, "AENC", 58, ParametersG2, AP_AbsoluteEncoder),

AP_GROUPEND
};

Expand Down Expand Up @@ -758,6 +762,7 @@ ParametersG2::ParametersG2(void)
#if AP_FOLLOW_ENABLED
follow(),
#endif
absoluteencoder(),
windvane(),
pos_control(attitude_control),
wp_nav(attitude_control, pos_control),
Expand Down
4 changes: 4 additions & 0 deletions Rover/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <AP_Stats/AP_Stats.h>
#include "AP_Torqeedo/AP_Torqeedo.h"
#include <AP_WindVane/AP_WindVane.h>
#include <AP_AbsoluteEncoder/AP_AbsoluteEncoder.h>

#define AP_PARAM_VEHICLE_NAME rover

Expand Down Expand Up @@ -392,6 +393,9 @@ class ParametersG2 {
// windvane
AP_WindVane windvane;

// Absolute Encoder
AP_AbsoluteEncoder absoluteencoder;

// mission behave
AP_Int8 mis_done_behave;

Expand Down
3 changes: 2 additions & 1 deletion Rover/Rover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = {
#if HAL_PROXIMITY_ENABLED
SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 50, 200, 27),
#endif
SCHED_TASK_CLASS(AP_WindVane, &rover.g2.windvane, update, 20, 100, 30),
SCHED_TASK_CLASS(AP_AbsoluteEncoder, &rover.g2.absoluteencoder, update, 20, 100, 30),
SCHED_TASK_CLASS(AP_WindVane, &rover.g2.windvane, update, 20, 100, 31),
SCHED_TASK(update_wheel_encoder, 50, 200, 36),
SCHED_TASK(update_compass, 10, 200, 39),
SCHED_TASK(update_logging1, 10, 200, 45),
Expand Down
2 changes: 2 additions & 0 deletions Rover/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void Rover::init_ardupilot()

rssi.init();

g2.absoluteencoder.init();

g2.windvane.init(serial_manager);

// init baro before we start the GCS, so that the CLI baro test works
Expand Down
1 change: 1 addition & 0 deletions Rover/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def build(bld):
'AP_Torqeedo',
'AC_PrecLand',
'AP_IRLock',
'AP_AbsoluteEncoder',
],
)

Expand Down

0 comments on commit 3b066e2

Please sign in to comment.