32 const std::string& odomFrameId,
const std::string& baseFrameId)
36 m_odomFrameId(odomFrameId), m_baseFrameId(baseFrameId),
37 m_firstOdometryReceived(false)
63 ROS_WARN(
"Parameter motion_noise/x is no longer used, use variances motion_noise/[xx|xy|xt] instead");
66 ROS_WARN(
"Parameter motion_noise/y is no longer used, use variances motion_noise/[yx|yy|yt] instead");
68 if (nh->
hasParam(
"motion_noise/yaw"))
69 ROS_WARN(
"Parameter motion_noise/yaw is no longer used, use variances motion_noise/[tx|ty|tt] instead");
95 Eigen::Vector3d motion2D_sq, motion_variance;
99 motion2D_sq(2) = yaw * yaw;
131 for (
unsigned i=0; i < particles.size(); ++i){
148 std::string errorString;
150 maxDuration = maxTime - t;
153 for (
unsigned i=0; i < particles.size(); ++i){
157 if (duration > maxDuration)
158 duration = maxDuration;
163 ROS_WARN(
"Could not lookup temporal odomTransform");
179 Eigen::Vector3d odomPose2D;
198 ROS_WARN(
"Looking up OdomTransform that is %f ms older than the last odomPose!",
221 ROS_WARN(
"Trying to store an OdomPose that is older or equal than the current in the MotionModel, ignoring!");
240 ROS_WARN(
"Failed to compute odom pose, skipping scan (%s)", e.what());
257 ROS_WARN(
"Failed to lookup local transform (%s)", e.what());
static tf::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw)
void storeOdomPose(const tf::Stamped< tf::Pose > &odomPose)
store odomPose as m_lastOdomPose to compute future odom transforms
tf::Transform odomTransformNoise(const tf::Transform &odomTransform)
double m_odomNoisePitch
std.dev param of noise in pitch (depending on distance traveled)
boost::uniform_real UniformDistributionT
bool lookupLocalTransform(const std::string &targetFrame, const ros::Time &t, tf::StampedTransform &localTransform) const
lookup the local target frame in the base frame (local transform)
boost::mt19937 EngineT
Boost RNG engine:
tf::TransformListener * m_tfListener
Eigen::Matrix3d m_odomCalibration2D
systematic calibration parameters for odometry drift
NormalGeneratorT m_rngNormal
double m_odomNoiseZ
std.dev param of noise in Z (depending on distance traveled)
bool m_firstOdometryReceived
static double getYaw(const Quaternion &bt_q)
bool getLastOdomPose(tf::Stamped< tf::Pose > &lastOdomPose) const
bool lookupOdomPose(const ros::Time &t, tf::Stamped< tf::Pose > &odomPose) const
look up the odom pose at a certain time through tf
TFSIMD_FORCE_INLINE const tfScalar & getY() const
TFSIMD_FORCE_INLINE const tfScalar & getZ() const
static tf::Quaternion createIdentityQuaternion()
UniformGeneratorT m_rngUniform
Eigen::Matrix3d m_odomNoise2D
variance parameters for calibrated odometry noise
TFSIMD_FORCE_INLINE const tfScalar & x() const
boost::normal_distribution NormalDistributionT
Boost RNG distribution:
tf::Transform computeOdomTransform(const tf::Transform currentPose) const
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
tf::Transform calibrateOdometry(const tf::Transform &odomTransform) const
std::string m_baseFrameId
#define ROS_INFO_STREAM(args)
bool lookupOdomTransform(const ros::Time &t, tf::Transform &odomTransform) const
looks up the odometry pose at time t and then calls computeOdomTransform()
bool applyOdomTransformTemporal(Particles &particles, const ros::Time &t, double dt)
TFSIMD_FORCE_INLINE const tfScalar & getX() const
std::string m_odomFrameId
bool hasParam(const std::string &key) const
std::vector< Particle > Particles
double m_odomNoiseRoll
std.dev param of noise in roll (depending on distance traveled)
void applyOdomTransform(Particles &particles, const tf::Transform &odomTransform)
apply odomTransform to all particles (with random noise and calibration)
tf::Stamped< tf::Pose > m_lastOdomPose
TFSIMD_FORCE_INLINE tfScalar length() const