Skip to content

Commit 6b1c917

Browse files
committed
Rover: Add Absolute Encoder Support
This instantiates the absolute encoder driver in rover, for use in the AP_Windvane Driver.
1 parent 2ee3296 commit 6b1c917

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

Rover/Parameters.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,10 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
703703
// @Path: mode_circle.cpp
704704
AP_SUBGROUPINFO(mode_circle, "CIRC", 57, ParametersG2, ModeCircle),
705705

706+
// @Group: AENC
707+
// @Path: ../libraries/AP_AbsoluteEncoder/AP_AbsoluteEncoder.cpp
708+
AP_SUBGROUPINFO(absoluteencoder, "AENC", 58, ParametersG2, AP_AbsoluteEncoder),
709+
706710
AP_GROUPEND
707711
};
708712

@@ -758,6 +762,7 @@ ParametersG2::ParametersG2(void)
758762
#if AP_FOLLOW_ENABLED
759763
follow(),
760764
#endif
765+
absoluteencoder(),
761766
windvane(),
762767
pos_control(attitude_control),
763768
wp_nav(attitude_control, pos_control),

Rover/Parameters.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <AP_Stats/AP_Stats.h>
1616
#include "AP_Torqeedo/AP_Torqeedo.h"
1717
#include <AP_WindVane/AP_WindVane.h>
18+
#include <AP_AbsoluteEncoder/AP_AbsoluteEncoder.h>
1819

1920
#define AP_PARAM_VEHICLE_NAME rover
2021

@@ -392,6 +393,9 @@ class ParametersG2 {
392393
// windvane
393394
AP_WindVane windvane;
394395

396+
// Absolute Encoder
397+
AP_AbsoluteEncoder absoluteencoder;
398+
395399
// mission behave
396400
AP_Int8 mis_done_behave;
397401

Rover/Rover.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = {
8686
#if HAL_PROXIMITY_ENABLED
8787
SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 50, 200, 27),
8888
#endif
89-
SCHED_TASK_CLASS(AP_WindVane, &rover.g2.windvane, update, 20, 100, 30),
89+
SCHED_TASK_CLASS(AP_AbsoluteEncoder, &rover.g2.absoluteencoder, update, 20, 100, 30),
90+
SCHED_TASK_CLASS(AP_WindVane, &rover.g2.windvane, update, 20, 100, 31),
9091
SCHED_TASK(update_wheel_encoder, 50, 200, 36),
9192
SCHED_TASK(update_compass, 10, 200, 39),
9293
SCHED_TASK(update_logging1, 10, 200, 45),

Rover/system.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ void Rover::init_ardupilot()
4242

4343
rssi.init();
4444

45+
g2.absoluteencoder.init();
46+
4547
g2.windvane.init(serial_manager);
4648

4749
// init baro before we start the GCS, so that the CLI baro test works

Rover/wscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def build(bld):
2727
'AP_Torqeedo',
2828
'AC_PrecLand',
2929
'AP_IRLock',
30+
'AP_AbsoluteEncoder',
3031
],
3132
)
3233

0 commit comments

Comments
 (0)