Skip to content

Commit

Permalink
refactor: review member and method's access
Browse files Browse the repository at this point in the history
Signed-off-by: Taekjin LEE <[email protected]>
  • Loading branch information
technolojin committed Dec 27, 2024
1 parent a01f84f commit 18bf3d0
Showing 1 changed file with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,12 @@ class FusionNode : public rclcpp::Node
explicit FusionNode(
const std::string & node_name, const rclcpp::NodeOptions & options, int queue_size);

protected:
private:
// Common process methods
void cameraInfoCallback(
const sensor_msgs::msg::CameraInfo::ConstSharedPtr input_camera_info_msg,
const std::size_t camera_id);
// callback for main subscription
void subCallback(const typename Msg3D::ConstSharedPtr input_msg);
// callback for roi subscription
void roiCallback(const typename Msg2D::ConstSharedPtr input_roi_msg, const std::size_t roi_i);

// callback for timer
void timer_callback();
void setPeriod(const int64_t new_period);
Expand All @@ -115,6 +112,29 @@ class FusionNode : public rclcpp::Node
return true;
}

// camera projection
float approx_grid_cell_w_size_;
float approx_grid_cell_h_size_;

// timer
rclcpp::TimerBase::SharedPtr timer_;
double timeout_ms_{};
double match_threshold_ms_{};

std::vector<typename rclcpp::Subscription<Msg2D>::SharedPtr> rois_subs_;
std::vector<rclcpp::Subscription<sensor_msgs::msg::CameraInfo>::SharedPtr> camera_info_subs_;

// cache for fusion
int64_t cached_det3d_msg_timestamp_;
typename Msg3D::SharedPtr cached_det3d_msg_ptr_;
std::mutex mutex_cached_msgs_;

protected:
// callback for main subscription
void subCallback(const typename Msg3D::ConstSharedPtr input_msg);
// callback for roi subscription
void roiCallback(const typename Msg2D::ConstSharedPtr input_roi_msg, const std::size_t roi_i);

// Custom process methods
virtual void preprocess(Msg3D & output_msg);
virtual void fuseOnSingleImage(
Expand All @@ -131,24 +151,8 @@ class FusionNode : public rclcpp::Node
// 2d detection management
std::vector<Det2dStatus<Msg2D>> det2d_list_;

// camera projection
float approx_grid_cell_w_size_;
float approx_grid_cell_h_size_;

// timer
rclcpp::TimerBase::SharedPtr timer_;
double timeout_ms_{};
double match_threshold_ms_{};

/** \brief A vector of subscriber. */
typename rclcpp::Subscription<Msg3D>::SharedPtr sub_;
std::vector<typename rclcpp::Subscription<Msg2D>::SharedPtr> rois_subs_;
std::vector<rclcpp::Subscription<sensor_msgs::msg::CameraInfo>::SharedPtr> camera_info_subs_;

// cache for fusion
int64_t cached_det3d_msg_timestamp_;
typename Msg3D::SharedPtr cached_det3d_msg_ptr_;
std::mutex mutex_cached_msgs_;

// parameters for out_of_scope filter
float filter_scope_min_x_;
Expand Down

0 comments on commit 18bf3d0

Please sign in to comment.