0、整体架构

cartographer---第一篇

 

1、cartographer_ros

  我们先看cartographer_ros 是怎样接入 cartographer的? cartographer_ros  在node_main中调用了cartographer::mapping::CreateMapBuilder(),Node对象构建;然后从cartographer中引进cartographer::mapping::MapBuilderInterface,构建了MapBuilderBridge类,所有方法由MapBuilderBridge转进Ros;如下图

cartographer---第一篇

LaunchSubscribers()通过SensorBridge将imu scan等topic数据转换后,传进map_builder_bridge_进行处理。
int Node::AddTrajectory(const TrajectoryOptions& options) {
  const std::set<cartographer::mapping::TrajectoryBuilderInterface::SensorId>
      expected_sensor_ids = ComputeExpectedSensorIds(options);
  const int trajectory_id =
      map_builder_bridge_.AddTrajectory(expected_sensor_ids, options);
  AddExtrapolator(trajectory_id, options);
  AddSensorSamplers(trajectory_id, options);
  LaunchSubscribers(options, trajectory_id);
  wall_timers_.push_back(node_handle_.createWallTimer(
      ::ros::WallDuration(kTopicMismatchCheckDelaySec),
      &Node::MaybeWarnAboutTopicMismatch, this, /*oneshot=*/true));
  for (const auto& sensor_id : expected_sensor_ids) {
    subscribed_topics_.insert(sensor_id.id);
  }
  return trajectory_id;
}

 

相关文章:

  • 2021-12-16
  • 2022-02-02
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-12-23
  • 2021-04-17
  • 2021-10-13
  • 2021-04-07
  • 2021-09-07
  • 2021-07-24
  • 2022-01-19
相关资源
相似解决方案