使用airsim的仿真输出生成点云--修正

相关链接:

使用airsim的仿真图像输出生成点云

更具体的整个过程记录如下:

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的问题:

3316

 

也不知道最终他们解决了没有。

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

寒墨阁

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值