Skip to content

Commit

Permalink
Merge pull request ros-drivers#31 from CaptKrasno/gravity
Browse files Browse the repository at this point in the history
redefined g according to the spec
  • Loading branch information
nathanmillermicrostrain authored Feb 17, 2021
2 parents c10cea7 + e9d62a0 commit 33cc4a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ros_mscl/include/ros_mscl/microstrain_3dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
#define SECS_PER_WEEK (60L*60*24*7)
#define UTC_GPS_EPOCH_DUR (315964800)

#define USTRAIN_G 9.80665 // from section 5.1.1 in https://www.microstrain.com/sites/default/files/3dm-gx5-25_dcp_manual_8500-0065_reference_document.pdf

//Macro to cause Sleep call to behave as it does for windows
#define Sleep(x) usleep(x*1000.0)

Expand Down
6 changes: 3 additions & 3 deletions ros_mscl/src/microstrain_3dm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,15 +1419,15 @@ void Microstrain::parse_imu_packet(const mscl::MipDataPacket &packet)
// Stuff into ROS message - acceleration in m/s^2
if(point.qualifier() == mscl::MipTypes::CH_X)
{
m_imu_msg.linear_acceleration.x = 9.81 * point.as_float();
m_imu_msg.linear_acceleration.x = USTRAIN_G * point.as_float();
}
else if(point.qualifier() == mscl::MipTypes::CH_Y)
{
m_imu_msg.linear_acceleration.y = 9.81 * point.as_float();
m_imu_msg.linear_acceleration.y = USTRAIN_G * point.as_float();
}
else if(point.qualifier() == mscl::MipTypes::CH_Z)
{
m_imu_msg.linear_acceleration.z = 9.81 * point.as_float();
m_imu_msg.linear_acceleration.z = USTRAIN_G * point.as_float();
}
}break;

Expand Down

0 comments on commit 33cc4a0

Please sign in to comment.