AP_Proximity: Use SITL singleton

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2018-06-15 16:26:02 -03:00 committed by Francisco Ferreira
parent 653784479e
commit 50613c3800
1 changed files with 2 additions and 2 deletions

View File

@ -30,9 +30,9 @@ extern const AP_HAL::HAL& hal;
*/ */
AP_Proximity_SITL::AP_Proximity_SITL(AP_Proximity &_frontend, AP_Proximity_SITL::AP_Proximity_SITL(AP_Proximity &_frontend,
AP_Proximity::Proximity_State &_state): AP_Proximity::Proximity_State &_state):
AP_Proximity_Backend(_frontend, _state) AP_Proximity_Backend(_frontend, _state),
sitl(AP::sitl())
{ {
sitl = (SITL::SITL *)AP_Param::find_object("SIM_");
ap_var_type ptype; ap_var_type ptype;
fence_count = (AP_Int8 *)AP_Param::find("FENCE_TOTAL", &ptype); fence_count = (AP_Int8 *)AP_Param::find("FENCE_TOTAL", &ptype);
if (fence_count == nullptr || ptype != AP_PARAM_INT8) { if (fence_count == nullptr || ptype != AP_PARAM_INT8) {