Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
as a temporary workaround to get baro simulation in ocaml sim
- Loading branch information
Showing
7 changed files
with
114 additions
and
4 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
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,22 @@ | ||
<!DOCTYPE module SYSTEM "module.dtd"> | ||
|
||
<module name="baro_sim" dir="sensors"> | ||
<doc> | ||
<description> | ||
Simulated barometer. | ||
Sends the BARO_ABS ABI message with gps.hmsl converted to absolute pressure. | ||
</description> | ||
</doc> | ||
|
||
<header> | ||
<file name="baro_sim.h"/> | ||
</header> | ||
<init fun="baro_sim_init()"/> | ||
<periodic fun="baro_sim_periodic()" freq="10."/> | ||
|
||
<makefile target="sim|jsbsim"> | ||
<file name="baro_sim.c"/> | ||
<define name="USE_BARO_BOARD" value="FALSE"/> | ||
</makefile> | ||
|
||
</module> |
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,44 @@ | ||
/* | ||
* Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com> | ||
* | ||
* This file is part of paparazzi. | ||
* | ||
* paparazzi is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* paparazzi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with paparazzi; see the file COPYING. If not, write to | ||
* the Free Software Foundation, 59 Temple Place - Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
/** | ||
* @file baro_sim.c | ||
* | ||
* Simulate barometer pressure measurement using gps.hmsl | ||
*/ | ||
|
||
#include "math/pprz_isa.h" | ||
#include "subsystems/gps.h" | ||
#include "subsystems/abi.h" | ||
|
||
#ifndef BARO_SIM_SENDER_ID | ||
#define BARO_SIM_SENDER_ID 1 | ||
#endif | ||
PRINT_CONFIG_VAR(BARO_SIM_SENDER_ID) | ||
|
||
void baro_sim_init(void) { | ||
|
||
} | ||
|
||
void baro_sim_periodic(void) { | ||
float pressure = pprz_isa_pressure_of_altitude(gps.hmsl / 1000.0); | ||
AbiSendMsgBARO_ABS(BARO_SIM_SENDER_ID, &pressure); | ||
} |
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,37 @@ | ||
/* | ||
* Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com> | ||
* | ||
* This file is part of paparazzi. | ||
* | ||
* paparazzi is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* paparazzi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with paparazzi; see the file COPYING. If not, write to | ||
* the Free Software Foundation, 59 Temple Place - Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
/** | ||
* @file baro_sim.h | ||
* | ||
* Simulate barometer pressure measurement using gps.hmsl | ||
*/ | ||
|
||
#ifndef BARO_SIM_H | ||
#define BARO_SIM_H | ||
|
||
/// new measurement every baro_sim_periodic | ||
#define BARO_SIM_DT BARO_SIM_PERIODIC_PERIOD | ||
|
||
extern void baro_sim_init(void); | ||
extern void baro_sim_periodic(void); | ||
|
||
#endif |
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