多物理场仿真 Chrono(3.4) 雷达传感器模型

为方便查阅,此文是原网站文档翻译,如有侵权,请与本人联系。
官网


在chrono::sensor::ChLidarSensor中,合成数据是通过基于GPU的光线跟踪生成的。通过利用NVIDIA Optix Library提供的硬件加速支持和无头渲染功能。对于每个激光雷达光束,都会跟踪一组对该激光雷达光束进行采样的光线。样本数量以及光束发散角由用户设置。激光雷达的整个帧/扫描在单个渲染步骤中进行处理。为了说明扫描过程中光线的时间差,使用了关键帧和运动模糊技术。有了这些关键帧,扫描中的每个光束都会在特定时间跟踪场景,再现物体和激光雷达的运动。激光雷达光束返回的强度基于漫反射。

Creating a Lidar

auto lidar = chrono_types::make_shared<ChLidarSensor>(
                   parent_body,             // body lidar is attached to
                   update_rate,             // scanning rate in Hz
                   offset_pose,             // offset pose
                   horizontal_samples,      // number of horizontal samples
                   vertical_channels,       // number of vertical channels
                   horizontal_fov,          // horizontal field of view
                   max_vert_angle,          // high vertical extent
                   min_vert_angle,          // low vertical extent
                   max_distance,            // maximum range
                   beam_shape,              // set the beam shape to rectangular or elliptical
                   sample_radius,           // configures the number of samples to use per beam
                   vert_divergence_angle,   // vertical beam divergence angle
                   hori_divergence_angle,   // horizontal beam divergence angle
                   return_mode,             // return mode for the lidar when multiple samples used
                   clip_near                // near clipping distance to ensure housing geometry not seen
                   );               
lidar->SetName("Lidar Sensor");
lidar->SetLag(lag);
lidar->SetCollectionWindow(collection_time); // typically time to spin 360 degrees

Lidar Filter Graph

// Access lidar data in raw format (range and intensity)
lidar->PushFilter(chrono_types::make_shared<ChFilterDIAccess>());
 
// Generate point cloud from raw data
lidar->PushFilter(chrono_types::make_shared<ChFilterPCfromDepth>());
 
// Add noise based on angle, angle, range, intensity
lidar->PushFilter(chrono_types::make_shared<ChFilterLidarNoiseXYZI>(0.01f, 0.001f, 0.001f, 0.01f));
 
// Access lidar data in point cloud format
lidar->PushFilter(chrono_types::make_shared<ChFilterXYZIAccess>());
 
// visualize point cloud (<height, width, zoom, name> of visual window)
lidar->PushFilter(chrono_types::make_shared<ChFilterVisualizePointCloud>(640, 480, 2, "Lidar Point Cloud"));
 
// Add sensor to manager
manager->AddSensor(lidar);

Lidar Data Access

UserXYZIBufferPtr xyzi_ptr;
while () {
    xyzi_ptr=lidar->GetMostRecentBuffer<UserXYZIBufferPtr>();
    if(xyzi_ptr->Buffer) {
        // Retrieve and print the first point in the point cloud
        PixelXYZI first_point= xyzi_ptr->Buffer[0];
        std::cout<<"First Point: [ "<<unsigned(first_point.x) <<", "<<
        unsigned(first_point.y) <<", “ <<unsigned(first_point.z) <<", "<<
        unsigned(first_point.intensity) <<" ]"<<std::endl;
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值