20 #ifndef INSPECTION_CAMERA_PROJECTION_H_
21 #define INSPECTION_CAMERA_PROJECTION_H_
24 #include <nodelet/nodelet.h>
25 #include <pluginlib/class_list_macros.h>
29 #include <tf2_ros/transform_listener.h>
30 #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
33 #include <ff_common/ff_names.h>
34 #include <msg_conversions/msg_conversions.h>
35 #include <config_reader/config_reader.h>
36 #include <camera/camera_model.h>
37 #include <isaac_util/isaac_names.h>
40 #include <sensor_msgs/PointCloud2.h>
41 #include <sensor_msgs/point_cloud_conversion.h>
44 #include <visualization_msgs/MarkerArray.h>
45 #include <geometry_msgs/PoseArray.h>
48 #include <Eigen/Dense>
58 namespace inspection {
72 CameraView(
const std::string& cam_name,
const camera::CameraParameters& params,
const float f = 2.0,
73 const float n = 0.19,
const geometry_msgs::Transform::ConstPtr cam_transform = NULL);
77 bool GetCamXYFromPoint(
const Eigen::Affine3d robot_pose,
const Eigen::Vector3d point,
int &x,
int &y);
78 bool GetCamXYFromPoint(
const Eigen::Vector3d point,
int &x,
int &y);
81 bool GetPointFromXYD(
const sensor_msgs::PointCloud2 pCloud,
const int u,
const int v, geometry_msgs::Point &point);
84 double GetDistanceFromTarget(
const geometry_msgs::Pose point, std::string depth_cam_name,
85 double size_x,
double size_y);
88 void DrawCameraFrustum(
const geometry_msgs::Pose robot_pose, ros::Publisher &publisher);
96 bool InsideTarget(std::vector<int> vert_x, std::vector<int> vert_y,
int test_x,
int test_y);
101 std::string cam_name_;
102 config_reader::ConfigReader cfg_cam_;
107 tf2_ros::Buffer tf_buffer_;
108 std::shared_ptr<tf2_ros::TransformListener> tf_listener_;
110 Eigen::Affine3d tf_body_to_cam_;
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
120 #endif // INSPECTION_CAMERA_PROJECTION_H_