forked from cra-ros-pkg/robot_localization
-
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.
Port to Dashing: melodic-devel 2.6.3 to current (cra-ros-pkg#530)
* Fixing Euler body-to-world transformations (cherry picked from commit 58bef05) * fix RLE/RLL tests * Enabling the user to override the output child_frame_id (cherry picked from commit f642190) * Add const& to catch values to prevent the error: catching polymorphic type ‘class tf2::TransformException’ by value And ZoneNumber by 0x3fU to prevent error: directive output may be truncated writing between 1 and 11 bytes into a region of size 4 (cherry picked from commit c1963c3) * Rename odomBaseLinkTrans to baseLinkOdomTrans Adhere to the naming convention <fromFrame><toFrame>Trans used for worldBaseLinkTrans and mapOdomTrans. (cherry picked from commit 17d4f10) * Enable build optimisations if no build type configured. The selected build type can have a significant influence on processor usage (tenths of %). As setting a build type is often forgotten by users, from-source builds of robot_localization on resource constraint platforms can run into issues of low update rates, starvation and issues with stability. If a build type is configured (on the ROS buildfarm fi), the added stanzas respect it and do not overwrite it. If nothing is configured, a warning is printed and the CMake-standard `RelWithDebInfo` type is configured. (cherry picked from commit cc93cef) * fix differential init typo, compiler warning * Add broadcast_utm_transform_as_parent_frame (cherry picked from commit e8deb5d) * Fixing title underline (cherry picked from commit da80adf) * Change note about transform publishing (cherry picked from commit 0eecd5f) * Meridian convergence adjustment added to navsat_transform. (cherry picked from commit 2b57df6) * Add missing undocumented params (cherry picked from commit 2585e9f) * Fix bug with tf_prefix (cherry picked from commit 492c494) * Created service for converting to / from lat long (cherry picked from commit fbd3a72) * Fixed linting errors. (cherry picked from commit 46396c0) * Refactored common conversion methods out (cherry picked from commit 1efe3a3) * Remove unused variable utm_odom_tf_yaw_ for clang compatibility (cherry picked from commit 2f0289d) * Mask IMU update vector to ignore position and linear velocity * They are both not contained in sensor_msgs/Imu but so far were still introduced if the param in the config file was set to true (cherry picked from commit 0d32daf) * Warning log output if for invalid IMU config settings (cherry picked from commit e2f75c3) * Set the filtered gps frame_id to base_link This is actually the frame_id of the information, not the 'gps' frame which might not even exist (cherry picked from commit 791953a) * Log initial pose once and continue with debug streams (cherry picked from commit a59e1e5) * Skip the debug log (cherry picked from commit 0e6cf56) * linter * alphabetize cmake srv list Co-authored-by: Tom Moore <[email protected]> Co-authored-by: Matthew Jones <[email protected]> Co-authored-by: thallerod <[email protected]> Co-authored-by: G.A. vd. Hoorn <[email protected]> Co-authored-by: diasdm <[email protected]> Co-authored-by: Pavlo Kolomiiets <[email protected]> Co-authored-by: Charles Brian Quinn <[email protected]> Co-authored-by: oswinso <[email protected]> Co-authored-by: Timon Engelke <[email protected]> Co-authored-by: Jonathan Huber <[email protected]> Co-authored-by: Tim Clephas <[email protected]>
- Loading branch information
1 parent
3c93104
commit 552877a
Showing
15 changed files
with
350 additions
and
117 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
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 |
---|---|---|
|
@@ -204,13 +204,17 @@ static inline char UTMLetterDesignator(double Lat) | |
* East Longitudes are positive, West longitudes are negative. | ||
* North latitudes are positive, South latitudes are negative | ||
* Lat and Long are in fractional degrees | ||
* Meridian convergence is computed as for Spherical Transverse Mercator, | ||
* which gives quite good approximation. | ||
* | ||
* @param[out] gamma meridian convergence at point (degrees). | ||
* | ||
* Written by Chuck Gantz- [email protected] | ||
*/ | ||
static inline void LLtoUTM( | ||
const double Lat, const double Long, | ||
double & UTMNorthing, double & UTMEasting, | ||
std::string & UTMZone) | ||
std::string & UTMZone, double & gamma) | ||
{ | ||
double a = WGS84_A; | ||
double eccSquared = UTM_E2; | ||
|
@@ -253,7 +257,9 @@ static inline void LLtoUTM( | |
|
||
// Compute the UTM Zone from the latitude and longitude | ||
char zone_buf[] = {0, 0, 0, 0}; | ||
snprintf(zone_buf, sizeof(zone_buf), "%d%c", ZoneNumber, | ||
// We &0x3fU to let GCC know the size of ZoneNumber. In this case, it's under | ||
// 63 (6bits) | ||
snprintf(zone_buf, sizeof(zone_buf), "%d%c", ZoneNumber & 0x3fU, | ||
UTMLetterDesignator(Lat)); | ||
UTMZone = std::string(zone_buf); | ||
|
||
|
@@ -290,25 +296,49 @@ static inline void LLtoUTM( | |
(61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * | ||
A * A * A * A * A / 720))); | ||
|
||
gamma = atan(tan(LongRad - LongOriginRad) * sin(LatRad)) * DEGREES_PER_RADIAN; | ||
|
||
if (Lat < 0) { | ||
// 10000000 meter offset for southern hemisphere | ||
UTMNorthing += 10000000.0; | ||
} | ||
} | ||
|
||
/** | ||
* Convert lat/long to UTM coords. Equations from USGS Bulletin 1532 | ||
* | ||
* East Longitudes are positive, West longitudes are negative. | ||
* North latitudes are positive, South latitudes are negative | ||
* Lat and Long are in fractional degrees | ||
* | ||
* Written by Chuck Gantz- [email protected] | ||
*/ | ||
static inline void LLtoUTM( | ||
const double Lat, const double Long, | ||
double & UTMNorthing, double & UTMEasting, | ||
std::string & UTMZone) | ||
{ | ||
double gamma; | ||
LLtoUTM(Lat, Long, UTMNorthing, UTMEasting, UTMZone, gamma); | ||
} | ||
|
||
/** | ||
* Converts UTM coords to lat/long. Equations from USGS Bulletin 1532 | ||
* | ||
* East Longitudes are positive, West longitudes are negative. | ||
* North latitudes are positive, South latitudes are negative | ||
* Lat and Long are in fractional degrees. | ||
* Meridian convergence is computed as for Spherical Transverse Mercator, | ||
* which gives quite good approximation. | ||
* | ||
* @param[out] gamma meridian convergence at point (degrees). | ||
* | ||
* Written by Chuck Gantz- [email protected] | ||
*/ | ||
static inline void UTMtoLL( | ||
const double UTMNorthing, const double UTMEasting, | ||
const std::string & UTMZone, double & Lat, | ||
double & Long) | ||
double & Long, double & gamma) | ||
{ | ||
double k0 = UTM_K0; | ||
double a = WGS84_A; | ||
|
@@ -367,6 +397,25 @@ static inline void UTMtoLL( | |
D * D * D * D * D / 120) / | ||
cos(phi1Rad)); | ||
Long = LongOrigin + Long * DEGREES_PER_RADIAN; | ||
|
||
gamma = atan(tanh(x / (k0 * a)) * tan(y / (k0 * a))) * DEGREES_PER_RADIAN; | ||
} | ||
|
||
/** | ||
* Converts UTM coords to lat/long. Equations from USGS Bulletin 1532 | ||
* | ||
* East Longitudes are positive, West longitudes are negative. | ||
* North latitudes are positive, South latitudes are negative | ||
* Lat and Long are in fractional degrees. | ||
* | ||
* Written by Chuck Gantz- [email protected] | ||
*/ | ||
static inline void UTMtoLL( | ||
const double UTMNorthing, const double UTMEasting, | ||
const std::string & UTMZone, double & Lat, double & Long) | ||
{ | ||
double gamma; | ||
UTMtoLL(UTMNorthing, UTMEasting, UTMZone, Lat, Long, gamma); | ||
} | ||
|
||
} // namespace navsat_conversions | ||
|
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
Oops, something went wrong.