相关链接:
更具体的整个过程记录如下:
1.
打开UE4Editor,打开Blocks仿真环境。
(此时的settings文件内容如下:
{
"SeeDocsAt": "AirSim/settings.md at master · microsoft/AirSim · GitHub",
"SettingsVersion": 1.2,
"SimMode": "Car",
"ViewMode": "SpringArmChase",
"PhysicsEngineName": "FastPhysicsEngine",
"ClockType": "SteppableClock",
"ClockSpeed": 0.61,
"Vehicles": {
"drone_1": {
"VehicleType": "PhysXCar",
"EnableCollisionPassthrogh": false,
"EnableCollisions": true,
"AllowAPIAlways": true,
"RC": {
"RemoteControlID": 0,
"AllowAPIWhenDisconnected": false
},
"Sensors": {
"Imu" : {
"SensorType": 2,
"Enabled": true
}
},
"Cameras": {
"front_center": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 640,
"Height": 480,
"FOV_Degrees": 90,
"TargetGamma": 1.5
},
{
"PublishToRos": 1,
"ImageType": 2,
"Width": 640,
"Height": 480,
"FOV_Degrees": 90,
"TargetGamma": 1.5
}
],
"X": 0, "Y": -0.06, "Z": -2.4,
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
}
},
"X": 0, "Y": 0, "Z": 0,
"Pitch": 0, "Roll": 0, "Yaw": 0
}
},
"SubWindows": [
{"WindowID": 1, "ImageType": 0, "CameraName": "front_center", "Visible": true},
{"WindowID": 2, "ImageType": 2, "CameraName": "front_center", "Visible": true}
]
}
)
打开ros节点:
roslaunch airsim_ros_pkgs airsim_car_with_joy_control.launch
录制rosbag:
rosbag record /airsim_node/drone_1/front_center/DepthPerspective /airsim_node/drone_1/front_center/DepthPerspective/camera_info /tf /tf_static
停止ros节点,停止仿真
2.
打开点云生成节点:
roslaunch image_rec depth_image_to_pcl.launch
(此时的depth_image_to_pcl.launch内容如下:
<launch>
<!--
To distinguish between the cases where the rgb image is
1280x1024 versus 640x480. This affects the pipeline.
-->
<!-- Nodelet manager for this pipeline
<node pkg="nodelet" type="nodelet" args="manager"
name="record_player_manager" output="screen"/>-->
<node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
<!-- Convert it into a point cloud
<node pkg="nodelet" type="nodelet" name="cloudify"
args="load depth_image_proc/point_cloud_xyzrgb standalone_nodelet -no-bond">
<remap from="depth_registered/image_rect" to="/depth_image"/>
<remap from="depth_registered/points" to="camera/depth_registered/points"/>
<remap from="rgb/image_rect_color" to="/color_image"/>
<remap from="rgb/camera_info" to="/color_camera_info"/>
</node> -->
<!---->
<node pkg="nodelet" type="nodelet" name="cloudify"
args="load depth_image_proc/point_cloud_xyz standalone_nodelet --no-bond">
<remap from="points" to="camera/depth_registered/points"/>
<remap from="image_rect" to="/depth_image"/>
<remap from="camera_info" to="/depth_camera_info"/>
</node>
<!--
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 1 centercamera_2_optical/static centercamera_2_optical 100" />
<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 0 0 0 0 1 centercamera_1_optical/static centercamera_1_optical 100" />-->
</launch>
请注意,在此已经把两个static_transform_publisher注释掉了,也就是说,不像20-08-27 使用airsim的仿真输出生成点云的“注意3”所说需要坐标系转换节点,可能是因为rosbag录制了tf和tf_static
打开一个rviz,把points话题显示出来。
播放rosbag文件,remap话题:
rosbag play -l 2021-01-19-11-29-06.bag /airsim_node/drone_1/front_center/DepthPerspective:=/depth_image /airsim_node/drone_1/front_center/DepthPerspective/camera_info:=/depth_camera_info
在rviz里选择一个已有的Fixed Frame,这样就可以看到下图所示:
很明显图像中的点云带有畸变,产生了以下issue的问题:
也不知道最终他们解决了没有。