forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracker: minimal support for inheritting from RC_Channel
- Loading branch information
1 parent
1ba0901
commit f79b4b5
Showing
6 changed files
with
119 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#include "Tracker.h" | ||
|
||
#include "RC_Channel.h" | ||
|
||
const AP_Param::GroupInfo RC_Channels::var_info[] = { | ||
// @Group: 1_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[0], "1_", 1, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 2_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[1], "2_", 2, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 3_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[2], "3_", 3, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 4_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[3], "4_", 4, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 5_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[4], "5_", 5, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 6_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[5], "6_", 6, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 7_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[6], "7_", 7, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 8_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[7], "8_", 8, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 9_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[8], "9_", 9, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 10_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[9], "10_", 10, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 11_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[10], "11_", 11, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 12_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[11], "12_", 12, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 13_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[12], "13_", 13, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 14_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[13], "14_", 14, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 15_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[14], "15_", 15, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
// @Group: 16_ | ||
// @Path: RC_Channel.cpp | ||
AP_SUBGROUPINFO(obj_channels[15], "16_", 16, RC_Channels_Tracker, RC_Channel_Tracker), | ||
|
||
AP_GROUPEND | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <RC_Channel/RC_Channel.h> | ||
|
||
class RC_Channel_Tracker : public RC_Channel | ||
{ | ||
|
||
public: | ||
|
||
protected: | ||
|
||
private: | ||
|
||
}; | ||
|
||
class RC_Channels_Tracker : public RC_Channels | ||
{ | ||
public: | ||
|
||
RC_Channel_Tracker obj_channels[NUM_RC_CHANNELS]; | ||
RC_Channel_Tracker *channel(const uint8_t chan) override { | ||
if (chan > NUM_RC_CHANNELS) { | ||
return nullptr; | ||
} | ||
return &obj_channels[chan]; | ||
} | ||
|
||
protected: | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* dummy methods to avoid having to link against AP_Camera */ | ||
|
||
#include <AP_Camera/AP_Camera.h> | ||
|
||
namespace AP { | ||
AP_Camera *camera() { | ||
return nullptr; | ||
} | ||
}; | ||
|
||
void AP_Camera::take_picture() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
void Tracker::read_radio() | ||
{ | ||
RC_Channels::read_input(); | ||
rc().read_input(); | ||
} |