Open YUKINA-3252 opened 8 months ago
このPRの変更を入れる前(depth_registration
がfalse
の時)は、以下のようなコマンドで最小限の画像を記録したrosbagを
rosbag record -b 0 /tf /tf_static /head_camera/rgb/camera_info /head_camera/rgb/image_raw/compressed /head_camera/depth/camera_info /head_camera/depth/image_raw/compressedDepth -O test.bag
以下のようなlaunch(もしくはこの一部を抜き出した処理)で再生することで、実機と同じ画像・点群を作ることができました。
<launch>
<arg name="rosbag_filename" />
<arg name="depth_registration" value="false" />
<param name="/use_sim_time" value="true" />
<node name="rosbag_play"
pkg="rosbag" type="play"
args="$(arg rosbag_filename) --clock --loop">
</node>
<group ns="/head_camera/rgb">
<node name="republish"
pkg="image_transport" type="republish"
args="compressed raw">
<remap from="in" to="image_raw" />
<remap from="out" to="image_raw" />
</node>
</group>
<group ns="/head_camera/depth">
<node name="republish"
pkg="image_transport" type="republish"
args="compressedDepth raw">
<remap from="in" to="image_raw" />
<remap from="out" to="image_raw" />
</node>
</group>
<include file="$(find openni2_launch)/launch/openni2.launch">
<arg name="load_driver" value="false" />
<arg name="camera" value="head_camera" />
<arg name="depth_registration" value="$(arg depth_registration)" />
<arg name="publish_tf" value="false" />
</include>
</launch>
しかし、このPRの変更を入れると、上記rosbag+launchで作られる画像・点群は実機とは少しずれたものになります。
これは、実機ではdepth_registration
がtrue
の画像・点群が作られるのに対し、上記rosbag+launchではdepth_registration
がfalse
のものしか作れないためです。
launchの引数にdepth_registration:=true
を与えても、処理に必要な画像の一部が記録されていないため全ての画像・点群を作ることはできません。
このため、このPRの変更を入れた場合、rosbagを記録・再生する際には以下のどれかを選択する必要があります。
depth_registration:=true
の処理に必要な全ての画像を記録する@Affonso-Gui @MiyabiTane @samejima00 のコードを確認したところ、もともと全部3の手法を取っており、かつ、このPRを入れてもhttps://gitlab.jsk.imi.i.u-tokyo.ac.jp/affonso/detic_ros/-/merge_requests/1 を入れれば問題ない記録・再生の仕方となっているように見えるので、大丈夫だと思われます。 @YUKINA-3252 のデモについては確認中です。
HIRO頭部のprime senseカメラにおいて、点群の三次元位置情報と色情報がずれていたり、RGB画像とdepth画像の位置情報がずれているといった問題があったので、openni2.launch(https://github.com/ros-drivers/openni2_launch/blob/797cc0b4b765e0701ad8b33872c530732d9d0b23/launch/openni2.launch#L27 )のdepth_registrationの値をfalseからtrueへ変更しました。
(変更前)
(変更後)
変更後は机の端の点群がより合う(変更前は床面の黒色が変更後よりずれて表れてしまっている)ようになりました。