Constructor. Calls setNodeHandle().
| 85 | |
| 86 | // Constructor. Calls setNodeHandle(). |
| 87 | Publisher::Publisher(std::shared_ptr<rclcpp::Node> node) : node_(node), pubTf_(node), image_transport_(node) { |
| 88 | // pubStereoMatched_ = nh_->advertise<sensor_msgs::PointCloud2>("okvis_stereo_matched", 1); // Sharmin |
| 89 | pubKeyframeImageL_ = node_->create_publisher<sensor_msgs::msg::Image>("keyframe_imageL", 10); // Sharmin |
| 90 | pubKeyframePose_ = node_->create_publisher<nav_msgs::msg::Odometry>("keyframe_pose", 10); // Sharmin |
| 91 | pubKeyframePoints_ = node_->create_publisher<sensor_msgs::msg::PointCloud>("keyframe_points", 1); // Sharmin |
| 92 | pubSvinHealth = node_->create_publisher<okvis_ros::msg::SvinHealth>("svin_health", 1); // Sharmin: SVIN health |
| 93 | |
| 94 | pubPointsMatched_ = node_->create_publisher<sensor_msgs::msg::PointCloud2>("okvis_points_matched", 1); |
| 95 | pubPointsUnmatched_ = node_->create_publisher<sensor_msgs::msg::PointCloud2>("okvis_points_unmatched", 1); |
| 96 | pubPointsTransferred_ = node_->create_publisher<sensor_msgs::msg::PointCloud2>("okvis_points_transferred", 1); |
| 97 | pubObometry_ = node_->create_publisher<nav_msgs::msg::Odometry>("okvis_odometry", 1); |
| 98 | pubPath_ = node_->create_publisher<nav_msgs::msg::Path>("okvis_path", 1); |
| 99 | pubTransform_ = node_->create_publisher<geometry_msgs::msg::TransformStamped>("okvis_transform", 1); |
| 100 | pubMesh_ = node_->create_publisher<visualization_msgs::msg::Marker>("okvis_mesh", 0); |
| 101 | // where to get the mesh from |
| 102 | std::string mesh_file; |
| 103 | if (node_->get_parameter("mesh_file", mesh_file)) { |
| 104 | meshMsg_.mesh_resource = "package://okvis_ros/meshes/" + mesh_file; |
| 105 | } else { |
| 106 | LOG(INFO) << "no mesh found for visualisation, set ros param mesh_file, if desired"; |
| 107 | meshMsg_.mesh_resource = ""; |
| 108 | } |
| 109 | |
| 110 | static_tf_published_ = false; |
| 111 | } |
| 112 | |
| 113 | void Publisher::publishKeyframeAsCallback(const okvis::Time& t, |
| 114 | const cv::Mat& imageL, |
nothing calls this directly
no outgoing calls
no test coverage detected