Public Member Functions | Private Attributes
EKFslamWrapper Class Reference

The EKFslamWrapper class provides the ROS wrapper for EKF SLAM 2d from MRPT libraries. More...

#include <mrpt_ekf_slam_2d_wrapper.h>

Inheritance diagram for EKFslamWrapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void computeEllipseOrientationScale2D (tf::Quaternion &orientation, Eigen::Vector2d &scale, const mrpt::math::CMatrixDouble covariance)
 compute the orientation and scale of covariance ellipsoids
 EKFslamWrapper ()
 constructor
void get_param ()
 read the parameters from launch file
void init ()
 initialize publishers subscribers and EKF 2d slam
bool is_file_exists (const std::string &name)
 check the existance of the file
void landmarkCallback (const mrpt_msgs::ObservationRangeBearing &_msg)
 callback function for the landmarks
void makeRightHanded (Eigen::Matrix2d &eigenvectors, Eigen::Vector2d &eigenvalues)
 compute the correct orientation and scale of covariance ellipsoids (make sure that we output covariance ellipsoids for right handed system of coordinates)
void odometryForCallback (CObservationOdometry::Ptr &_odometry, const std_msgs::Header &_msg_header)
 get the odometry for received observation
void publishTF ()
 publish tf tree
bool rawlogPlay ()
 play rawlog file
void updateSensorPose (std::string _frame_id)
 update the pose of the sensor with respect to the robot
void viz_dataAssociation ()
 visualize the data associations for the landmarks observed by robot at the each step
void viz_state ()
 visualize the covariance ellipsoids for robot and landmarks
bool waitForTransform (mrpt::poses::CPose3D &des, const std::string &target_frame, const std::string &source_frame, const ros::Time &time, const ros::Duration &timeout, const ros::Duration &polling_sleep_duration=ros::Duration(0.01))
 wait for transform between odometry frame and the robot frame
 ~EKFslamWrapper ()
 destructor

Private Attributes

std::string base_frame_id
 robot frame
ros::Publisher data_association_viz_pub_
double ellipse_scale_
 Scale of covariance ellipses.
std::string global_frame_id
 /map frame
std::string ini_filename
 name of ini file
std::map< std::string,
mrpt::poses::CPose3D > 
landmark_poses_
 landmark poses with respect to the map
tf::TransformListener listenerTF_
 transform listener
ros::NodeHandle n_
 Node handler.
std::string odom_frame_id
 /odom frame
std::string rawlog_filename
 name of rawlog file
bool rawlog_play_
 true if rawlog file exists
double rawlog_play_delay
 delay of replay from rawlog file
std::string sensor_source
 2D laser scans
std::vector< ros::SubscribersensorSub_
 list of sensors topics
ros::Publisher state_viz_pub_
 publishers
float t_exec
 the time which take one SLAM update execution
tf::TransformBroadcaster tf_broadcaster_
 transform broadcaster
CTicTac tictac
 timer for SLAM performance evaluation

Detailed Description

The EKFslamWrapper class provides the ROS wrapper for EKF SLAM 2d from MRPT libraries.

Definition at line 64 of file mrpt_ekf_slam_2d_wrapper.h.


Constructor & Destructor Documentation

constructor

Definition at line 11 of file mrpt_ekf_slam_2d_wrapper.cpp.

destructor

Definition at line 15 of file mrpt_ekf_slam_2d_wrapper.cpp.


Member Function Documentation

void EKFslamWrapper::computeEllipseOrientationScale2D ( tf::Quaternion orientation,
Eigen::Vector2d &  scale,
const mrpt::math::CMatrixDouble  covariance 
)

compute the orientation and scale of covariance ellipsoids

Parameters:
orientationthe orientation of the ellipsoid in Quaternions
scalethe vector of the eigen values for calculating the size of the ellipse
covariancecovariance matrix for current landmarks or robot pose

Definition at line 255 of file mrpt_ekf_slam_2d_wrapper.cpp.

read the parameters from launch file

Definition at line 21 of file mrpt_ekf_slam_2d_wrapper.cpp.

initialize publishers subscribers and EKF 2d slam

Create subscribers///

Definition at line 47 of file mrpt_ekf_slam_2d_wrapper.cpp.

bool EKFslamWrapper::is_file_exists ( const std::string &  name)

check the existance of the file

Returns:
true if file exists

Definition at line 16 of file mrpt_ekf_slam_2d_wrapper.cpp.

callback function for the landmarks

Given the landmarks wait for odometry, create the pair of action and observation, implement one SLAM update, publish map and pose.

Parameters:
_msgthe landmark message

Definition at line 148 of file mrpt_ekf_slam_2d_wrapper.cpp.

void EKFslamWrapper::makeRightHanded ( Eigen::Matrix2d &  eigenvectors,
Eigen::Vector2d &  eigenvalues 
)

compute the correct orientation and scale of covariance ellipsoids (make sure that we output covariance ellipsoids for right handed system of coordinates)

Parameters:
eigenvectorsthe 2x2 matrix of eigenvectors
eigenvaluesthe 2d vector of eigen values

Definition at line 231 of file mrpt_ekf_slam_2d_wrapper.cpp.

void EKFslamWrapper::odometryForCallback ( CObservationOdometry::Ptr &  _odometry,
const std_msgs::Header _msg_header 
)

get the odometry for received observation

Parameters:
_odometryodometry for received observation
_msg_headertimestamp of the observation

Definition at line 90 of file mrpt_ekf_slam_2d_wrapper.cpp.

publish tf tree

Definition at line 441 of file mrpt_ekf_slam_2d_wrapper.cpp.

play rawlog file

Returns:
true if rawlog file exists and played

Definition at line 187 of file mrpt_ekf_slam_2d_wrapper.cpp.

void EKFslamWrapper::updateSensorPose ( std::string  _frame_id)

update the pose of the sensor with respect to the robot

Parameters:
frame_idthe frame of the sensors

Definition at line 105 of file mrpt_ekf_slam_2d_wrapper.cpp.

visualize the data associations for the landmarks observed by robot at the each step

Definition at line 298 of file mrpt_ekf_slam_2d_wrapper.cpp.

visualize the covariance ellipsoids for robot and landmarks

Definition at line 358 of file mrpt_ekf_slam_2d_wrapper.cpp.

bool EKFslamWrapper::waitForTransform ( mrpt::poses::CPose3D &  des,
const std::string &  target_frame,
const std::string &  source_frame,
const ros::Time time,
const ros::Duration timeout,
const ros::Duration polling_sleep_duration = ros::Duration(0.01) 
)

wait for transform between odometry frame and the robot frame

Parameters:
desposition of the robot with respect to odometry frame
target_framethe odometry tf frame
source_framethe robot tf frame
timetimestamp of the observation for which we want to retrieve the position of the robot
timeouttimeout for odometry waiting
polling_sleep_durationtimeout for transform wait
Returns:
true if there is transform from odometry to the robot

Definition at line 130 of file mrpt_ekf_slam_2d_wrapper.cpp.


Member Data Documentation

std::string EKFslamWrapper::base_frame_id [private]

robot frame

Definition at line 178 of file mrpt_ekf_slam_2d_wrapper.h.

Definition at line 188 of file mrpt_ekf_slam_2d_wrapper.h.

Scale of covariance ellipses.

Definition at line 170 of file mrpt_ekf_slam_2d_wrapper.h.

std::string EKFslamWrapper::global_frame_id [private]

/map frame

Definition at line 176 of file mrpt_ekf_slam_2d_wrapper.h.

std::string EKFslamWrapper::ini_filename [private]

name of ini file

Definition at line 175 of file mrpt_ekf_slam_2d_wrapper.h.

std::map<std::string, mrpt::poses::CPose3D> EKFslamWrapper::landmark_poses_ [private]

landmark poses with respect to the map

Definition at line 183 of file mrpt_ekf_slam_2d_wrapper.h.

transform listener

Definition at line 189 of file mrpt_ekf_slam_2d_wrapper.h.

Node handler.

Definition at line 168 of file mrpt_ekf_slam_2d_wrapper.h.

std::string EKFslamWrapper::odom_frame_id [private]

/odom frame

Definition at line 177 of file mrpt_ekf_slam_2d_wrapper.h.

std::string EKFslamWrapper::rawlog_filename [private]

name of rawlog file

Definition at line 174 of file mrpt_ekf_slam_2d_wrapper.h.

true if rawlog file exists

Definition at line 171 of file mrpt_ekf_slam_2d_wrapper.h.

delay of replay from rawlog file

Definition at line 169 of file mrpt_ekf_slam_2d_wrapper.h.

std::string EKFslamWrapper::sensor_source [private]

2D laser scans

Definition at line 181 of file mrpt_ekf_slam_2d_wrapper.h.

list of sensors topics

Definition at line 173 of file mrpt_ekf_slam_2d_wrapper.h.

publishers

Definition at line 188 of file mrpt_ekf_slam_2d_wrapper.h.

float EKFslamWrapper::t_exec [private]

the time which take one SLAM update execution

Definition at line 186 of file mrpt_ekf_slam_2d_wrapper.h.

transform broadcaster

Definition at line 190 of file mrpt_ekf_slam_2d_wrapper.h.

CTicTac EKFslamWrapper::tictac [private]

timer for SLAM performance evaluation

Definition at line 185 of file mrpt_ekf_slam_2d_wrapper.h.


The documentation for this class was generated from the following files:


mrpt_ekf_slam_2d
Author(s): Jose Luis, Vladislav Tananaev
autogenerated on Thu Jun 6 2019 21:40:15