| 5 | namespace sloam |
| 6 | { |
| 7 | SLOAMNode::SLOAMNode(const ros::NodeHandle &nh) : nh_(nh) |
| 8 | { |
| 9 | ROS_DEBUG_STREAM("Defining topics" << std::endl); |
| 10 | |
| 11 | debugMode_ = nh_.param("debug_mode", false); |
| 12 | if (debugMode_) |
| 13 | { |
| 14 | ROS_DEBUG_STREAM("Running SLOAM in Debug Mode" << std::endl); |
| 15 | if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug)) |
| 16 | { |
| 17 | ros::console::notifyLoggerLevelsChanged(); |
| 18 | } |
| 19 | } |
| 20 | else |
| 21 | { |
| 22 | if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info)) |
| 23 | { |
| 24 | ros::console::notifyLoggerLevelsChanged(); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // Debugging Publishers |
| 29 | // pubMapTreeFeatures_ = nh_.advertise<CloudT>("debug/map_tree_features", 1); |
| 30 | pubMapGroundFeatures_ = nh_.advertise<CloudT>("debug/map_ground_features", 1); |
| 31 | pubObsTreeFeatures_ = nh_.advertise<CloudT>("debug/obs_tree_features", 1); |
| 32 | pubObsGroundFeatures_ = nh_.advertise<CloudT>("debug/obs_ground_features", 1); |
| 33 | pubTrajectory_ = nh_.advertise<visualization_msgs::MarkerArray>("debug/trajectory", 1, true); |
| 34 | pubMapTreeModel_ = |
| 35 | nh_.advertise<visualization_msgs::MarkerArray>("map", 1, true); |
| 36 | pubSubmapTreeModel_ = |
| 37 | nh_.advertise<visualization_msgs::MarkerArray>("debug/map_tree_models", 1, true); |
| 38 | pubObsTreeModel_ = |
| 39 | nh_.advertise<visualization_msgs::MarkerArray>("debug/obs_tree_models", 1, true); |
| 40 | pubMapGroundModel_ = nh_.advertise<visualization_msgs::MarkerArray>("debug/map_ground_model", 1); |
| 41 | pubObsGroundModel_ = nh_.advertise<visualization_msgs::MarkerArray>("debug/obs_ground_model", 1); |
| 42 | |
| 43 | // SLOAM publishers |
| 44 | pubObs_ = |
| 45 | nh_.advertise<sloam_msgs::ROSObservation>("observation", 10); |
| 46 | pubMapPose_ = |
| 47 | nh_.advertise<geometry_msgs::PoseStamped>("map_pose", 10); |
| 48 | |
| 49 | // sub_graph_map_ = new obs_sub_type(nh_, "/graph_slam/submap", 20); |
| 50 | |
| 51 | ROS_DEBUG_STREAM("Init params" << std::endl); |
| 52 | firstScan_ = true; |
| 53 | tf_listener_.reset(new tf2_ros::TransformListener(tf_buffer_)); |
| 54 | initParams_(); |
| 55 | } |
| 56 | |
| 57 | void SLOAMNode::initParams_() |
| 58 | { |
nothing calls this directly
no outgoing calls
no test coverage detected