over_pt.cpp

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1194442938015&lmt=1194190197&format=336x280_as&output=html&correlator=1194442937843&url=file%3A%2F%2F%2FC%3A%2FDocuments%2520and%2520Settings%2Flhh1%2F%E6%A1%8C%E9%9D%A2%2FCLanguage.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=583001034.1194442938&ga_sid=1194442938&ga_hid=1942779085&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency"> #include <iostream.h>

int somef(int a);
int somef(int a, int b);

void main(void)
  {
  int (*fp)(int a);   // pointer to int xxx(int)

  fp = somef;         // points to somef(int)
  cout << fp(5);
  }

int somef(int a)
  {
  return a;
  }

int somef(int a, int b)
  {
  return a*b;
  }


void Preprocess::hesai_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) { pl_surf.clear(); pl_corn.clear(); pl_full.clear(); pcl::PointCloud<hesai_ros::Point> pl_orig; pcl::fromROSMsg(*msg, pl_orig); int plsize = pl_orig.points.size(); if (plsize == 0) return; pl_surf.reserve(plsize); double begin_time = msg->header.stamp.toSec(); if(feature_enabled) { for (int i = 0; i < N_SCANS; i++) { pl_buff[i].clear(); pl_buff[i].reserve(plsize); } } for (int i = 0; i < plsize; i++) { PointType added_pt; added_pt.normal_x = 0; added_pt.normal_y = 0; added_pt.normal_z = 0; int layer = pl_orig.points[i].ring; if (layer >= N_SCANS) continue; added_pt.x = pl_orig.points[i].x; added_pt.y = pl_orig.points[i].y; added_pt.z = pl_orig.points[i].z; added_pt.intensity = pl_orig.points[i].intensity; added_pt.curvature = (pl_orig.points[i].timestamp - begin_time) * time_unit_scale; if(feature_enabled) { pl_buff[layer].points.push_back(added_pt); } else { if (i % point_filter_num == 0) { if(added_pt.x*added_pt.x+added_pt.y*added_pt.y+added_pt.z*added_pt.z > (blind * blind)) { pl_surf.points.push_back(added_pt); } } } } } 这是我fastlio2中处理雷达数据的函数,这是其中hesai_ros namespace hesai_ros { struct EIGEN_ALIGN16 Point { PCL_ADD_POINT4D; float intensity; double timestamp; uint16_t ring; EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; } // namespace hesai_ros POINT_CLOUD_REGISTER_POINT_STRUCT(hesai_ros::Point, (float, x, x) (float, y, y) (float, z, z) (float, intensity, intensity) (double, timestamp, timestamp) (std::uint16_t, ring, ring) ) 下面是发出端的数据结构 struct PointXYZIT { PCL_ADD_POINT4D float intensity; double timestamp; uint16_t ring; EIGEN_MAKE_ALIGNED_OPERATOR_NEW } EIGEN_ALIGN16; POINT_CLOUD_REGISTER_POINT_STRUCT( PointXYZIT, (float, x, x) (float, y, y) (float, z, z) (float, intensity, intensity) (double, timestamp, timestamp) (std::uint16_t, ring, ring) ) 下面是雷达发布话题的情况 hao@hao-ubuntu:~/ROS_SDK_2.1.0_jt16_0120$ rostopic echo -n 1 /lidar_points/fields - name: "x" offset: 0 datatype: 7 count: 1 - name: "y" offset: 4 datatype: 7 count: 1 - name: "z" offset: 8 datatype: 7 count: 1 - name: "intensity" offset: 12 datatype: 7 count: 1 - name: "ring" offset: 16 datatype: 4 count: 1 --- hao@hao-ubuntu:~/ROS_SDK_2.1.0_jt16_0120$ rostopic echo -n 1 /lidar_points/header seq: 186 stamp: secs: 0 nsecs: 0 frame_id: "hesai_lidar" --- 两边哪里还不匹配,会报错 hao@hao-ubuntu:~/livox$ roslaunch fast_lio mapping_hesai.launch ... logging to /home/hao/.ros/log/c5ff68e8-4750-11f0-aff3-5f57413891f7/roslaunch-hao-ubuntu-6731.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt WARNING: disk usage in log directory [/home/hao/.ros/log] is over 1GB. It's recommended that you use the 'rosclean' command. started roslaunch server http://hao-ubuntu:40741/ SUMMARY ======== PARAMETERS * /common/imu_topic: /lidar_imu * /common/lid_topic: /lidar_points * /common/time_offset_lidar_to_imu: 0.0 * /common/time_sync_en: False * /cube_side_length: 1000.0 * /feature_extract_enable: False * /filter_size_map: 0.3 * /filter_size_surf: 0.3 * /mapping/acc_cov: 0.3 * /mapping/b_acc_cov: 0.001 * /mapping/b_gyr_cov: 0.001 * /mapping/det_range: 100.0 * /mapping/extrinsic_R: [0, -1, 0, -1, 0,... * /mapping/extrinsic_T: [-0.001, -0.00855... * /mapping/extrinsic_est_en: True * /mapping/fov_degree: 180 * /mapping/gyr_cov: 0.3 * /max_iteration: 5 * /pcd_save/interval: -1 * /pcd_save/pcd_save_en: False * /point_filter_num: 1 * /preprocess/blind: 0.5 * /preprocess/lidar_type: 4 * /preprocess/scan_line: 16 * /preprocess/scan_rate: 10 * /preprocess/timestamp_unit: 0 * /publish/dense_publish_en: True * /publish/path_en: True * /publish/scan_bodyframe_pub_en: True * /publish/scan_publish_en: True * /rosdistro: noetic * /rosversion: 1.17.0 * /runtime_pos_log_enable: False * /use_sim_time: False NODES / laserMapping (fast_lio/fastlio_mapping) orientation_fix (tf/static_transform_publisher) rviz (rviz/rviz) ROS_MASTER_URI=http://localhost:11311 process[laserMapping-1]: started with pid [6748] process[orientation_fix-2]: started with pid [6749] process[rviz-3]: started with pid [6750] Multi thread started p_pre->lidar_type 4 ~~~~/home/hao/livox/src/fast_lio_hesai/ file opened Failed to find match for field 'timestamp'. Failed to find match for field 'timestamp'. [ WARN] [1749707491.138653256]: No point, skip this scan__1!
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值