Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIH - change how LAT and LON is used for Takeoff location #23363

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modules/simulation/simulator_sih/sih.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ void Sih::parameters_updated()
_KDW = _sih_kdw.get();
_H0 = _sih_h0.get();

_LAT0 = (double)_sih_lat0.get() * 1.0e-7;
_LON0 = (double)_sih_lon0.get() * 1.0e-7;
_LAT0 = (double)_sih_lat0.get();
_LON0 = (double)_sih_lon0.get();
_COS_LAT0 = cosl((long double)radians(_LAT0));

_MASS = _sih_mass.get();
Expand Down
4 changes: 2 additions & 2 deletions src/modules/simulation/simulator_sih/sih.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ class Sih : public ModuleBase<Sih>, public ModuleParams
(ParamFloat<px4::params::SIH_L_PITCH>) _sih_l_pitch,
(ParamFloat<px4::params::SIH_KDV>) _sih_kdv,
(ParamFloat<px4::params::SIH_KDW>) _sih_kdw,
(ParamInt<px4::params::SIH_LOC_LAT0>) _sih_lat0,
(ParamInt<px4::params::SIH_LOC_LON0>) _sih_lon0,
(ParamFloat<px4::params::SIH_LOC_LAT0>) _sih_lat0,
(ParamFloat<px4::params::SIH_LOC_LON0>) _sih_lon0,
(ParamFloat<px4::params::SIH_LOC_H0>) _sih_h0,
(ParamFloat<px4::params::SIH_DISTSNSR_MIN>) _sih_distance_snsr_min,
(ParamFloat<px4::params::SIH_DISTSNSR_MAX>) _sih_distance_snsr_max,
Expand Down
16 changes: 7 additions & 9 deletions src/modules/simulation/simulator_sih/sih_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,33 +235,31 @@ PARAM_DEFINE_FLOAT(SIH_KDW, 0.025f);
* Initial geodetic latitude
*
* This value represents the North-South location on Earth where the simulation begins.
* A value of 45 deg should be written 450000000.
*
* LAT0, LON0, H0, MU_X, MU_Y, and MU_Z should ideally be consistent among each others
* to represent a physical ground location on Earth.
*
* @unit deg*1e7
Claudio-Chies marked this conversation as resolved.
Show resolved Hide resolved
* @min -850000000
* @max 850000000
* @min -90
* @max 90
* @group Simulation In Hardware
*/
PARAM_DEFINE_INT32(SIH_LOC_LAT0, 454671160);
PARAM_DEFINE_FLOAT(SIH_LOC_LAT0, 47.397742f);

/**
* Initial geodetic longitude
*
* This value represents the East-West location on Earth where the simulation begins.
* A value of 45 deg should be written 450000000.
*
* LAT0, LON0, H0, MU_X, MU_Y, and MU_Z should ideally be consistent among each others
* to represent a physical ground location on Earth.
*
* @unit deg*1e7
* @min -1800000000
* @max 1800000000
* @unit deg
* @min -180
* @max 180
* @group Simulation In Hardware
*/
PARAM_DEFINE_INT32(SIH_LOC_LON0, -737578370);
PARAM_DEFINE_FLOAT(SIH_LOC_LON0, 8.545594f);

/**
* Initial AMSL ground altitude
Expand Down
Loading