20 #include <nav_msgs/OccupancyGrid.h> 21 #include "nav_msgs/MapMetaData.h" 22 #include <std_msgs/String.h> 23 #include <std_msgs/Int32.h> 24 #include <nav_msgs/GetMap.h> 25 #include <geometry_msgs/PoseArray.h> 26 #include <geometry_msgs/PoseWithCovarianceStamped.h> 27 #include <sensor_msgs/LaserScan.h> 28 #include <visualization_msgs/MarkerArray.h> 29 #include <visualization_msgs/Marker.h> 31 #include "mrpt_msgs/ObservationRangeBeacon.h" 33 #include <mrpt_bridge/pose.h> 34 #include <mrpt_bridge/map.h> 35 #include <mrpt_bridge/mrpt_log_macros.h> 36 #include <mrpt_bridge/laser_scan.h> 37 #include <mrpt_bridge/beacon.h> 38 #include <mrpt_bridge/time.h> 40 #include <mrpt/obs/CObservationBeaconRanges.h> 123 void odometryForCallback(mrpt::obs::CObservationOdometry::Ptr& odometry,
const std_msgs::Header& msg_header);
164 std::vector<std::pair<mrpt::obs::CActionCollection, mrpt::obs::CSensoryFrame>>
data_;
175 #if MRPT_VERSION >= 0x199 std::string global_frame_id_
/map frame
tf::TransformListener listenerTF_
transform listener
void odometryForCallback(mrpt::obs::CObservationOdometry::Ptr &odometry, const std_msgs::Header &msg_header)
Get the odometry for received observation.
std::vector< ros::Subscriber > sensorSub_
list of sensors topics
mrpt::utils::CTicTac tictac_
The PFslam class provides Rao-Blackwellized Particle filter SLAM from MRPT libraries.
bool rawlogPlay()
Play rawlog file.
std::string rawlog_filename_
name of rawlog file
std::vector< std::pair< mrpt::obs::CActionCollection, mrpt::obs::CSensoryFrame > > data_
void laserCallback(const sensor_msgs::LaserScan &msg)
Callback function for the laser scans.
ros::Publisher beacon_viz_pub_
publishers for map and pose particles
std::string odom_frame_id_
/odom frame
void vizBeacons()
Correct visualization for ro slam.
The PFslamWrapper class provides the ROS wrapper for Rao-Blackwellized Particle filter SLAM from MRPT...
bool getParams(const ros::NodeHandle &nh_p)
Read the parameters from launch file.
ros::Publisher pub_metadata_
float t_exec_
the time which take one SLAM update execution
void publishTF()
Publish tf tree.
void publishMapPose()
Publish beacon or grid map and robot pose.
std::map< std::string, mrpt::poses::CPose3D > beacon_poses_
beacon poses with respect to the map
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.
bool init(ros::NodeHandle &nh)
Initialize publishers subscribers and RBPF slam.
ros::Publisher pub_particles_
void updateSensorPose(const std::string &frame_id)
Update the pose of the sensor with respect to the robot.
void callbackBeacon(const mrpt_msgs::ObservationRangeBeacon &msg)
Callback function for the beacons.
std::string sensor_source_
2D laser scans
double rawlog_play_delay_
delay of replay from rawlog file
bool rawlog_play_
true if rawlog file exists
std::map< std::string, mrpt::poses::CPose3D > laser_poses_
laser scan poses with respect to the map
std::string ini_filename_
name of ini file
ros::Publisher pub_particles_beacons_
tf::TransformBroadcaster tf_broadcaster_
transform broadcaster
std::vector< mrpt::opengl::CEllipsoid::Ptr > viz_beacons_
std::string base_frame_id_
robot frame