mrpt_icp_slam_2d_wrapper.cpp
Go to the documentation of this file.
1 /*
2  * File: mrpt_icp_slam_2d_wrapper.cpp
3  * Author: Vladislav Tananaev
4  *
5  */
6 
8 #include <mrpt/version.h>
9 #if MRPT_VERSION >= 0x150
10 #include <mrpt_bridge/utils.h>
11 #endif
12 
13 #if MRPT_VERSION >= 0x199
14 #include <mrpt/serialization/CArchive.h>
15 #endif
16 
17 #include <mrpt/maps/COccupancyGridMap2D.h>
18 #include <mrpt/maps/CSimplePointsMap.h>
21 
23  rawlog_play_ = false;
24  stamp = ros::Time(0);
25  // Default parameters for 3D window
27  SHOW_PROGRESS_3D_REAL_TIME_DELAY_MS = 0; // this parameter is not used
28  SHOW_LASER_SCANS_3D = true;
30  isObsBasedRawlog = true;
31 }
33  try {
34  std::string sOutMap = "mrpt_icpslam_";
36  mrpt::system::timestampToParts(now(), parts, true);
37  sOutMap += format("%04u-%02u-%02u_%02uh%02um%02us",
38  (unsigned int)parts.year, (unsigned int)parts.month,
39  (unsigned int)parts.day, (unsigned int)parts.hour,
40  (unsigned int)parts.minute, (unsigned int)parts.second);
41  sOutMap += ".simplemap";
42 
43  sOutMap = mrpt::system::fileNameStripInvalidChars(sOutMap);
44  ROS_INFO("Saving built map to `%s`", sOutMap.c_str());
46  } catch (std::exception &e) {
47  ROS_ERROR("Exception: %s", e.what());
48  }
49 }
50 bool ICPslamWrapper::is_file_exists(const std::string &name) {
51  std::ifstream f(name.c_str());
52  return f.good();
53 }
54 
56  CConfigFile iniFile(ini_filename);
57 
58  mapBuilder.ICP_options.loadFromConfigFile(iniFile, "MappingApplication");
61 
62 #if MRPT_VERSION < 0x150
63  mapBuilder.options.verbose = true;
64 #else
65  log4cxx::LoggerPtr ros_logger =
66  log4cxx::Logger::getLogger(ROSCONSOLE_DEFAULT_NAME);
67  mapBuilder.setVerbosityLevel(
68  mrpt_bridge::rosLoggerLvlToMRPTLoggerLvl(ros_logger->getLevel()));
69  mapBuilder.logging_enable_console_output = false;
70 #if MRPT_VERSION < 0x199
71  mapBuilder.logRegisterCallback(static_cast<output_logger_callback_t>(
73 #else
74  mapBuilder.logRegisterCallback(static_cast<output_logger_callback_t>(
76 #endif
77 #endif
79  iniFile.read_string("MappingApplication", "alwaysInsertByClass", ""));
80 
83 
84  // parameters for mrpt3D window
86  iniFile.read_bool("MappingApplication", "CAMERA_3DSCENE_FOLLOWS_ROBOT",
87  true, /*Force existence:*/ true);
89  "MappingApplication");
91  "MappingApplication");
93  "MappingApplication");
94 }
95 
97  ROS_INFO("READ PARAM FROM LAUNCH FILE");
98  n_.param<double>("rawlog_play_delay", rawlog_play_delay, 0.1);
99  ROS_INFO("rawlog_play_delay: %f", rawlog_play_delay);
100 
101  n_.getParam("rawlog_filename", rawlog_filename);
102  ROS_INFO("rawlog_filename: %s", rawlog_filename.c_str());
103 
104  n_.getParam("ini_filename", ini_filename);
105  ROS_INFO("ini_filename: %s", ini_filename.c_str());
106 
107  n_.param<std::string>("global_frame_id", global_frame_id, "map");
108  ROS_INFO("global_frame_id: %s", global_frame_id.c_str());
109 
110  n_.param<std::string>("odom_frame_id", odom_frame_id, "odom");
111  ROS_INFO("odom_frame_id: %s", odom_frame_id.c_str());
112 
113  n_.param<std::string>("base_frame_id", base_frame_id, "base_link");
114  ROS_INFO("base_frame_id: %s", base_frame_id.c_str());
115 
116  n_.param<std::string>("sensor_source", sensor_source, "scan");
117  ROS_INFO("sensor_source: %s", sensor_source.c_str());
118 
119  n_.param("trajectory_update_rate", trajectory_update_rate, 10.0);
120  ROS_INFO("trajectory_update_rate: %f", trajectory_update_rate);
121 
122  n_.param("trajectory_publish_rate", trajectory_publish_rate, 5.0);
123  ROS_INFO("trajectory_publish_rate: %f", trajectory_publish_rate);
124 }
126 #if MRPT_HAS_WXWIDGETS
129  "pf-localization - The MRPT project", 1000, 600);
130  win3D_->setCameraZoom(20);
131  win3D_->setCameraAzimuthDeg(-45);
132  }
133 
134 #endif
135 }
136 
138  // Create 3D window if requested (the code is copied from
139  // ../mrpt/apps/icp-slam/icp-slam_main.cpp):
141  // get currently builded map
143 
144  lst_current_laser_scans.clear();
145 
146  CPose3D robotPose;
147  mapBuilder.getCurrentPoseEstimation()->getMean(robotPose);
148  COpenGLScene::Ptr scene = COpenGLScene::Create();
149 
150  COpenGLViewport::Ptr view = scene->getViewport("main");
151 
152  COpenGLViewport::Ptr view_map = scene->createViewport("mini-map");
153  view_map->setBorderSize(2);
154  view_map->setViewportPosition(0.01, 0.01, 0.35, 0.35);
155  view_map->setTransparent(false);
156 
157  {
158  mrpt::opengl::CCamera &cam = view_map->getCamera();
159  cam.setAzimuthDegrees(-90);
160  cam.setElevationDegrees(90);
161  cam.setPointingAt(robotPose);
162  cam.setZoomDistance(20);
163  cam.setOrthogonal();
164  }
165 
166  // The ground:
167  mrpt::opengl::CGridPlaneXY::Ptr groundPlane =
168  mrpt::opengl::CGridPlaneXY::Create(-200, 200, -200, 200, 0, 5);
169  groundPlane->setColor(0.4, 0.4, 0.4);
170  view->insert(groundPlane);
171  view_map->insert(CRenderizable::Ptr(groundPlane)); // A copy
172 
173  // The camera pointing to the current robot pose:
175  scene->enableFollowCamera(true);
176 
177  mrpt::opengl::CCamera &cam = view_map->getCamera();
178  cam.setAzimuthDegrees(-45);
179  cam.setElevationDegrees(45);
180  cam.setPointingAt(robotPose);
181  }
182 
183  // The maps:
184  {
185  opengl::CSetOfObjects::Ptr obj = opengl::CSetOfObjects::Create();
187  view->insert(obj);
188 
189  // now, only the point map in another OpenGL view:
190 
191  // publish map
192  CSimplePointsMap *pm = nullptr;
193 #if MRPT_VERSION >= 0x199
194  if (metric_map_->countMapsByClass<CSimplePointsMap>())
195  pm = metric_map_->mapByClass<CSimplePointsMap>().get();
196 #else
198  pm = metric_map_->m_pointsMaps[0].get();
199 #endif
200 
201  opengl::CSetOfObjects::Ptr ptsMap = opengl::CSetOfObjects::Create();
202  if (pm) {
203  pm->getAs3DObject(ptsMap);
204  view_map->insert(ptsMap);
205  }
206  }
207 
208  // Draw the robot path:
209  CPose3DPDF::Ptr posePDF = mapBuilder.getCurrentPoseEstimation();
210  CPose3D curRobotPose;
211  posePDF->getMean(curRobotPose);
212  {
213  opengl::CSetOfObjects::Ptr obj = opengl::stock_objects::RobotPioneer();
214  obj->setPose(curRobotPose);
215  view->insert(obj);
216  }
217  {
218  opengl::CSetOfObjects::Ptr obj = opengl::stock_objects::RobotPioneer();
219  obj->setPose(curRobotPose);
220  view_map->insert(obj);
221  }
222 
223  opengl::COpenGLScene::Ptr &ptrScene = win3D_->get3DSceneAndLock();
224  ptrScene = scene;
225 
226  win3D_->unlockAccess3DScene();
227 
228  // Move camera:
229  win3D_->setCameraPointingToPoint(curRobotPose.x(), curRobotPose.y(),
230  curRobotPose.z());
231 
232  // Update:
233  win3D_->forceRepaint();
234 
235  // Build list of scans:
236  if (SHOW_LASER_SCANS_3D) {
237  // Rawlog in "Observation-only" format:
238  if (isObsBasedRawlog) {
239 #if MRPT_VERSION >= 0x199
240  if (IS_CLASS(*observation, CObservation2DRangeScan))
241 #else
242  if (IS_CLASS(observation, CObservation2DRangeScan))
243 #endif
244  {
245  lst_current_laser_scans.push_back(
247  }
248  } else {
249  // Rawlog in the Actions-SF format:
250  for (size_t i = 0;; i++) {
251  CObservation2DRangeScan::Ptr new_obs =
252  observations->getObservationByClass<CObservation2DRangeScan>(i);
253  if (!new_obs)
254  break; // There're no more scans
255  else
256  lst_current_laser_scans.push_back(new_obs);
257  }
258  }
259  }
260 
261  // Draw laser scanners in 3D:
262  if (SHOW_LASER_SCANS_3D) {
263  for (size_t i = 0; i < lst_current_laser_scans.size(); i++) {
264  // Create opengl object and load scan data from the scan observation:
265  opengl::CPlanarLaserScan::Ptr obj = opengl::CPlanarLaserScan::Create();
266  obj->setScan(*lst_current_laser_scans[i]);
267  obj->setPose(curRobotPose);
268  obj->setSurfaceColor(1.0f, 0.0f, 0.0f, 0.5f);
269  // inser into the scene:
270  view->insert(obj);
271  }
272  }
273  }
274 }
276  // get parameters from ini file
278  ROS_ERROR_STREAM("CAN'T READ INI FILE");
279  return;
280  }
282  // read rawlog file if it exists
284  ROS_WARN_STREAM("PLAY FROM RAWLOG FILE: " << rawlog_filename.c_str());
285  rawlog_play_ = true;
286  }
287 
289  // publish grid map
290  pub_map_ = n_.advertise<nav_msgs::OccupancyGrid>("map", 1, true);
291  pub_metadata_ = n_.advertise<nav_msgs::MapMetaData>("map_metadata", 1, true);
292  // publish point map
294  n_.advertise<sensor_msgs::PointCloud>("PointCloudMap", 1, true);
295 
296  trajectory_pub_ = n_.advertise<nav_msgs::Path>("trajectory", 1, true);
297 
298  // robot pose
299  pub_pose_ = n_.advertise<geometry_msgs::PoseStamped>("robot_pose", 1);
300 
304 
308 
309  // read sensor topics
310  std::vector<std::string> lstSources;
311  mrpt::system::tokenize(sensor_source, " ,\t\n", lstSources);
312  ROS_ASSERT_MSG(!lstSources.empty(),
313  "*Fatal*: At least one sensor source must be provided in "
314  "~sensor_sources (e.g. "
315  "\"scan\" or \"beacon\")");
316 
318  sensorSub_.resize(lstSources.size());
319  for (size_t i = 0; i < lstSources.size(); i++) {
320  if (lstSources[i].find("scan") != std::string::npos) {
321  sensorSub_[i] =
322  n_.subscribe(lstSources[i], 1, &ICPslamWrapper::laserCallback, this);
323  } else {
324  std::cout << "Sensor topics should be 2d laser scans which inlude in the "
325  "name the word scan "
326  << "\n";
327  }
328  }
329 
330  init3Dwindow();
331 }
332 
334 #if MRPT_VERSION >= 0x130
335  using namespace mrpt::maps;
336  using namespace mrpt::obs;
337 #else
338  using namespace mrpt::slam;
339 #endif
340  CObservation2DRangeScan::Ptr laser = CObservation2DRangeScan::Create();
341  if (laser_poses_.find(_msg.header.frame_id) == laser_poses_.end()) {
342  updateSensorPose(_msg.header.frame_id);
343  } else {
344  mrpt::poses::CPose3D pose = laser_poses_[_msg.header.frame_id];
345  mrpt_bridge::convert(_msg, laser_poses_[_msg.header.frame_id], *laser);
346  // CObservation::Ptr obs = CObservation::Ptr(laser);
347  observation = CObservation::Ptr(laser);
348  stamp = ros::Time(0);
349  tictac.Tic();
351  t_exec = tictac.Tac();
352  ROS_INFO("Map building executed in %.03fms", 1000.0f * t_exec);
353 
354  run3Dwindow();
355  publishTF();
356  publishMapPose();
357  }
358 }
360  // get currently builded map
362 
363  // publish map
364  COccupancyGridMap2D *grid = nullptr;
365  CSimplePointsMap *pm = nullptr;
366 #if MRPT_VERSION >= 0x199
367  if (metric_map_->countMapsByClass<COccupancyGridMap2D>())
368  grid = metric_map_->mapByClass<COccupancyGridMap2D>().get();
369  if (metric_map_->countMapsByClass<CSimplePointsMap>())
370  pm = metric_map_->mapByClass<CSimplePointsMap>().get();
371 #else
372  if (metric_map_->m_gridMaps.size())
373  grid = metric_map_->m_gridMaps[0].get();
375  pm = metric_map_->m_pointsMaps[0].get();
376 #endif
377 
378  if (grid) {
380  // if we have new map for current sensor update it
381  mrpt_bridge::convert(*grid, _msg);
382  pub_map_.publish(_msg);
383  pub_metadata_.publish(_msg.info);
384  }
385  if (pm) {
386  sensor_msgs::PointCloud _msg;
388  header.stamp = ros::Time(0);
389  header.frame_id = global_frame_id;
390  // if we have new map for current sensor update it
391  mrpt_bridge::point_cloud::mrpt2ros(*pm, header, _msg);
393  }
394 
395  CPose3D robotPose;
396  mapBuilder.getCurrentPoseEstimation()->getMean(robotPose);
397 
398  // publish pose
399  // geometry_msgs::PoseStamped pose;
400  pose.header.frame_id = global_frame_id;
401 
402  // the pose
403  pose.pose.position.x = robotPose.x();
404  pose.pose.position.y = robotPose.y();
405  pose.pose.position.z = 0.0;
406  pose.pose.orientation = tf::createQuaternionMsgFromYaw(robotPose.yaw());
407 
409 }
410 void ICPslamWrapper::updateSensorPose(std::string _frame_id) {
411  CPose3D pose;
413  try {
415  transform);
416 
417  tf::Vector3 translation = transform.getOrigin();
418  tf::Quaternion quat = transform.getRotation();
419  pose.x() = translation.x();
420  pose.y() = translation.y();
421  pose.z() = translation.z();
422  tf::Matrix3x3 Rsrc(quat);
423  CMatrixDouble33 Rdes;
424  for (int c = 0; c < 3; c++)
425  for (int r = 0; r < 3; r++)
426  Rdes(r, c) = Rsrc.getRow(r)[c];
427  pose.setRotationMatrix(Rdes);
428  laser_poses_[_frame_id] = pose;
429  } catch (tf::TransformException ex) {
430  ROS_ERROR("%s", ex.what());
431  ros::Duration(1.0).sleep();
432  }
433 }
435  if (rawlog_play_ == false) {
436  return false;
437  } else {
438  size_t rawlogEntry = 0;
439 #if MRPT_VERSION >= 0x199
440  CFileGZInputStream rawlog_stream(rawlog_filename);
441  auto rawlogFile = mrpt::serialization::archiveFrom(rawlog_stream);
442 #else
444 #endif
445  CActionCollection::Ptr action;
446 
447  for (;;) {
448  if (ros::ok()) {
449  if (!CRawlog::getActionObservationPairOrObservation(
450  rawlogFile, action, observations, observation, rawlogEntry)) {
451  break; // file EOF
452  }
454  // Execute:
455  // ----------------------------------------
456  tictac.Tic();
457  if (isObsBasedRawlog)
459  else
461  t_exec = tictac.Tac();
462  ROS_INFO("Map building executed in %.03fms", 1000.0f * t_exec);
463 
465 
467 
468  CPose3D robotPose;
469  mapBuilder.getCurrentPoseEstimation()->getMean(robotPose);
470 
471  // publish map
472  COccupancyGridMap2D *grid = nullptr;
473  CSimplePointsMap *pm = nullptr;
474 #if MRPT_VERSION >= 0x199
475  if (metric_map_->countMapsByClass<COccupancyGridMap2D>())
476  grid = metric_map_->mapByClass<COccupancyGridMap2D>().get();
477  if (metric_map_->countMapsByClass<CSimplePointsMap>())
478  pm = metric_map_->mapByClass<CSimplePointsMap>().get();
479 #else
480  if (metric_map_->m_gridMaps.size())
481  grid = metric_map_->m_gridMaps[0].get();
483  pm = metric_map_->m_pointsMaps[0].get();
484 #endif
485 
486  if (grid) {
488 
489  // if we have new map for current sensor update it
490  mrpt_bridge::convert(*grid, _msg);
491  pub_map_.publish(_msg);
492  pub_metadata_.publish(_msg.info);
493  }
494 
495  if (pm) {
496  sensor_msgs::PointCloud _msg;
498  header.stamp = ros::Time(0);
499  header.frame_id = global_frame_id;
500  // if we have new map for current sensor update it
501  mrpt_bridge::point_cloud::mrpt2ros(*pm, header, _msg);
503  // pub_metadata_.publish(_msg.info)
504  }
505 
506  // publish pose
507  // geometry_msgs::PoseStamped pose;
508  pose.header.frame_id = global_frame_id;
509 
510  // the pose
511  pose.pose.position.x = robotPose.x();
512  pose.pose.position.y = robotPose.y();
513  pose.pose.position.z = 0.0;
514  pose.pose.orientation = tf::createQuaternionMsgFromYaw(robotPose.yaw());
515 
517  }
518 
519  run3Dwindow();
520  ros::spinOnce();
521  }
522 
523  // if there is mrpt_gui it will wait until push any key in order to close
524  // the window
525  if (win3D_)
526  win3D_->waitForKey();
527 
528  return true;
529  }
530 }
531 
533  // Most of this code was copy and pase from ros::amcl
534  mrpt::poses::CPose3D robotPoseTF;
535  mapBuilder.getCurrentPoseEstimation()->getMean(robotPoseTF);
536 
537  stamp = ros::Time(0);
538  tf::Stamped<tf::Pose> odom_to_map;
539  tf::Transform tmp_tf;
540  mrpt_bridge::convert(robotPoseTF, tmp_tf);
541 
542  try {
543  tf::Stamped<tf::Pose> tmp_tf_stamped(tmp_tf.inverse(), stamp,
544  base_frame_id);
545  listenerTF_.transformPose(odom_frame_id, tmp_tf_stamped, odom_to_map);
546  } catch (tf::TransformException) {
547  ROS_INFO("Failed to subtract global_frame (%s) from odom_frame (%s)",
548  global_frame_id.c_str(), odom_frame_id.c_str());
549  return;
550  }
551 
552  tf::Transform latest_tf_ =
554  tf::Point(odom_to_map.getOrigin()));
555 
556  tf::StampedTransform tmp_tf_stamped(latest_tf_.inverse(), stamp,
558 
559  tf_broadcaster_.sendTransform(tmp_tf_stamped);
560 }
561 
563  const ros::TimerEvent &event) {
564  ROS_DEBUG("update trajectory");
565  path.header.frame_id = global_frame_id;
566  path.header.stamp = ros::Time(0);
567  path.poses.push_back(pose);
568 }
569 
571  const ros::TimerEvent &event) {
572  ROS_DEBUG("publish trajectory");
574 }
void publishTrajectoryTimerCallback(const ros::TimerEvent &event)
the callback for publish trajectory
void BASE_IMPEXP timestampToParts(TTimeStamp t, TTimeParts &p, bool localTime=false)
void saveCurrentMapToFile(const std::string &fileName, bool compressGZ=true) const
void setOrthogonal(bool v=true)
mrpt::gui::CDisplayWindow3D::Ptr win3D_
MRPT window.
void updateTrajectoryTimerCallback(const ros::TimerEvent &event)
the callback for update trajectory
const mrpt::maps::CMultiMetricMap * getCurrentlyBuiltMetricMap() const MRPT_OVERRIDE
void publish(const boost::shared_ptr< M > &message) const
const CMultiMetricMap * metric_map_
receive map after iteration of SLAM to metric map
void get_param()
read the parameters from launch file
nav_msgs::Path path
trajectory path
std::string odom_frame_id
/odom frame
CSensoryFrame::Ptr observations
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
const GLfloat * c
static CDisplayWindow3DPtr Create(const std::string &windowCaption, unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300)
size_t rawlogEntry
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMapPtr, TListMaps > m_pointsMaps
std::string read_string(const std::string &section, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
bool sleep() const
void init()
initialize publishers subscribers and icp slam
mrpt::system::TTimeStamp now()
bool is_file_exists(const std::string &name)
check the existance of the file
void laserCallback(const sensor_msgs::LaserScan &_msg)
callback function for the laser scans
void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) MRPT_OVERRIDE
bool rawlog_play_
true if rawlog file exists
float t_exec
the time which take one SLAM update execution
geometry_msgs::PoseStamped pose
the robot pose
void publishMapPose()
publish point and/or grid map and robot pose
scene
void setAzimuthDegrees(float ang)
double rawlog_play_delay
delay of replay from rawlog file
std::vector< ros::Subscriber > sensorSub_
list of sensors topics
mrpt::utils::CListOfClasses alwaysInsertByClass
void updateSensorPose(std::string _frame_id)
update the pose of the sensor with respect to the robot
GLuint GLenum GLenum transform
ros::Publisher pub_point_cloud_
publishers for map and pose particles
TFSIMD_FORCE_INLINE const Vector3 & getRow(int i) const
CICP::TConfigParams ICP_params
mrpt::poses::CPose3DPDFPtr getCurrentPoseEstimation() const MRPT_OVERRIDE
bool mrpt2ros(const mrpt::maps::CSimplePointsMap &obj, const std_msgs::Header &msg_header, sensor_msgs::PointCloud &msg)
tf::TransformBroadcaster tf_broadcaster_
transform broadcaster
TFSIMD_FORCE_INLINE const tfScalar & x() const
bool read_bool(const std::string &section, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
tf::TransformListener listenerTF_
transform listener
nv_oem6_header_t header
CMetricMapBuilderICP mapBuilder
icp slam class
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
TFSIMD_FORCE_INLINE const tfScalar & z() const
double yaw() const
void processActionObservation(mrpt::obs::CActionCollection &action, mrpt::obs::CSensoryFrame &in_SF) MRPT_OVERRIDE
GLhandleARB obj
#define ROS_INFO(...)
CTicTac tictac
timer for SLAM performance evaluation
GLuint const GLchar * name
bool param(const std::string &param_name, T &param_val, const T &default_val) const
CConfigFile * iniFile
#define ROS_ASSERT_MSG(cond,...)
VerbosityLevel rosLoggerLvlToMRPTLoggerLvl(log4cxx::LevelPtr lvl)
static CGridPlaneXYPtr Create(float xMin, float xMax, float yMin, float yMax, float z=0, float frequency=1, float lineWidth=1.3f, bool antiAliasing=true)
ROSCPP_DECL bool ok()
TFSIMD_FORCE_INLINE const tfScalar & y() const
void sendTransform(const StampedTransform &transform)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
std::string ini_filename
name of ini file
Transform inverse() const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::NodeHandle n_
Node Handle.
std::string BASE_IMPEXP fileNameStripInvalidChars(const std::string &filename, const char replacement_to_invalid_chars= '_')
void setPointingAt(float x, float y, float z)
#define ROS_WARN_STREAM(args)
bool rawlogPlay()
play rawlog file
CObservation::Ptr observation
TFSIMD_FORCE_INLINE Vector3 & getOrigin()
void lookupTransform(const std::string &target_frame, const std::string &source_frame, const ros::Time &time, StampedTransform &transform) const
std::string global_frame_id
/map frame
action
ros::Time stamp
timestamp for observations
void convert(const ros::Time &src, mrpt::system::TTimeStamp &des)
const_iterator find(const KEY &key) const
ros::Timer publish_trajectory_timer
timer for publish trajectory
void run3Dwindow()
run 3D window update from mrpt lib
void initialize(const mrpt::maps::CSimpleMap &initialMap=mrpt::maps::CSimpleMap(), mrpt::poses::CPosePDF *x0=NULL) MRPT_OVERRIDE
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)
void mrptToROSLoggerCallback(const std::string &msg, const VerbosityLevel level, const std::string &loggerName, const mrpt::system::TTimeStamp timestamp)
void transformPose(const std::string &target_frame, const geometry_msgs::PoseStamped &stamped_in, geometry_msgs::PoseStamped &stamped_out) const
void fromString(const std::string &s)
Quaternion getRotation() const
GLdouble GLdouble GLdouble r
bool getParam(const std::string &key, std::string &s) const
ros::Publisher trajectory_pub_
trajectory publisher
void read_iniFile(std::string ini_filename)
read ini file
ProxyFilterContainerByClass< mrpt::maps::COccupancyGridMap2DPtr, TListMaps > m_gridMaps
double trajectory_update_rate
trajectory update rate(Hz)
#define ROS_ERROR_STREAM(args)
std::string rawlog_filename
name of rawlog file
std::string base_frame_id
robot frame
void init3Dwindow()
init 3D window from mrpt lib
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
#define IS_CLASS(ptrObj, class_name)
ROSCPP_DECL void spinOnce()
std::map< std::string, mrpt::poses::CPose3D > laser_poses_
laser scan poses with respect to the map
void BASE_IMPEXP tokenize(const std::string &inString, const std::string &inDelimiters, std::deque< std::string > &outTokens, bool skipBlankTokens=true) MRPT_NO_THROWS
void mrptToROSLoggerCallback_mrpt_15(const std::string &msg, const VerbosityLevel level, const std::string &loggerName, const mrpt::system::TTimeStamp timestamp, void *userParam)
double trajectory_publish_rate
trajectory publish rate(Hz)
#define ROS_ERROR(...)
#define ROSCONSOLE_DEFAULT_NAME
ros::Timer update_trajector_timer
timer for update trajectory
void setZoomDistance(float z)
void processObservation(const mrpt::obs::CObservationPtr &obs)
void publishTF()
publis tf tree
std::string sensor_source
2D laser scans
std::vector< CObservation2DRangeScan::Ptr > lst_current_laser_scans
void setRotationMatrix(const mrpt::math::CMatrixDouble33 &ROT)
ros::Publisher pub_metadata_
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble f
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) MRPT_OVERRIDE
#define ROS_DEBUG(...)
void setElevationDegrees(float ang)


mrpt_icp_slam_2d
Author(s): Jose Luis Blanco Claraco, Vladislav Tananaev
autogenerated on Sat May 2 2020 03:44:29