Browse Source

Rover: add support for ParametersG2

mission-4.1.18
Peter Barker 8 years ago committed by Randy Mackay
parent
commit
cfee3b6c0e
  1. 16
      APMrover2/Parameters.cpp
  2. 14
      APMrover2/Parameters.h
  3. 1
      APMrover2/Rover.h

16
APMrover2/Parameters.cpp

@ -553,10 +553,24 @@ const AP_Param::Info Rover::var_info[] = { @@ -553,10 +553,24 @@ const AP_Param::Info Rover::var_info[] = {
// @Group: BTN_
// @Path: ../libraries/AP_Button/AP_Button.cpp
GOBJECT(button, "BTN_", AP_Button),
// @Group:
// @Path: Parameters.cpp
GOBJECT(g2, "", ParametersG2),
AP_VAREND
};
/*
2nd group of parameters
*/
const AP_Param::GroupInfo ParametersG2::var_info[] = {
AP_GROUPEND
};
/*
This is a conversion table from old parameter values to new
parameter names. The startup code looks for saved values of the old

14
APMrover2/Parameters.h

@ -85,6 +85,7 @@ public: @@ -85,6 +85,7 @@ public:
k_param_mission, // mission library
k_param_NavEKF2_old, // deprecated
k_param_NavEKF2,
k_param_g2, // 2nd block of parameters
// 140: battery controls
k_param_battery_monitoring = 140, // deprecated, can be deleted
@ -320,4 +321,17 @@ public: @@ -320,4 +321,17 @@ public:
{}
};
/*
2nd block of parameters, to avoid going past 256 top level keys
*/
class ParametersG2 {
public:
ParametersG2(void) { AP_Param::setup_object_defaults(this, var_info); }
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];
};
extern const AP_Param::Info var_info[];

1
APMrover2/Rover.h

@ -109,6 +109,7 @@ private: @@ -109,6 +109,7 @@ private:
// all settable parameters
Parameters g;
ParametersG2 g2;
// main loop scheduler
AP_Scheduler scheduler;

Loading…
Cancel
Save