Use collision for labeling pointcloud
Hello, I simulate a box with objects and gather pointcloud data with an realsense D435. Now I try to label my data so that i know whether a point is at a object or not. I spawn a point/sphere and check every point for a collision with any other object. Unfortunately the collision is not always triggered. I observed if for example the cube is moving and the point is at the moment testing this location than the collision triggers but if the cube is not moving and just standing there and the point is testing the location than no event is triggered.
Can someone tell me why and how i can change that?`
Point SDF:
<?xml version='1.0'?>
<sdf version="1.4">
<model name="point">
<static>true</static>
<self_collide>1</self_collide>
<link name="link">
<inertial>
<mass>1.0</mass>
<inertia> <!-- inertias are tricky to compute -->
<!-- http://gazebosim.org/tutorials?tut=inertia&cat=build_robot -->
<ixx>0.0025</ixx> <!-- for a box: ixx = 0.083 * mass * (y*y + z*z) -->
<ixy>0.0</ixy> <!-- for a box: ixy = 0 -->
<ixz>0.0</ixz> <!-- for a box: ixz = 0 -->
<iyy>0.0025</iyy> <!-- for a box: iyy = 0.083 * mass * (x*x + z*z) -->
<iyz>0.0</iyz> <!-- for a box: iyz = 0 -->
<izz>0.0025</izz> <!-- for a box: izz = 0.083 * mass * (x*x + y*y) -->
</inertia>
</inertial>
<collision name="point_collision">
<geometry>
<sphere>
<radius>{r}</radius>
</sphere>
</geometry>
<surface>
<contact>
<collide_without_contact>true</collide_without_contact>
</contact>
</surface>
</collision>
<visual name="visual">
<geometry>
<sphere>
<radius>{r}</radius>
</sphere>
</geometry>
<material><script><name>Gazebo/Yellow</name></script></material>
</visual>
<sensor name='my_contact' type='contact'>
<update_rate>200.0</update_rate>
<always_on>1</always_on>
<contact>
<collision>point_collision</collision>
</contact>
</sensor>
</link>
</model>
</sdf>
Cube/Box SDF:
<?xml version='1.0'?>
<sdf version="1.4">
<model name="MODEL_NAME">
<pose>0 0 0.5 0 0 0</pose>
<static>ISSTATIC</static>
<self_collide>1</self_collide>
<link name="link">
<inertial>
<mass>0.2</mass>
<inertia> <!-- inertias are tricky to compute -->
<!-- http://gazebosim.org/tutorials?tut=inertia&cat=build_robot -->
<ixx>0.083</ixx> <!-- for a box: ixx = 0.083 * mass * (y*y + z*z) -->
<ixy>0.0</ixy> <!-- for a box: ixy = 0 -->
<ixz>0.0</ixz> <!-- for a box: ixz = 0 -->
<iyy>0.083</iyy> <!-- for a box: iyy = 0.083 * mass * (x*x + z*z) -->
<iyz>0.0</iyz> <!-- for a box: iyz = 0 -->
<izz>0.083</izz> <!-- for a box: izz = 0.083 * mass * (x*x + y*y) -->
</inertia>
</inertial>
<collision name="box_collision">
<geometry>
<box>
<size>0.05 0.05 0.05</size>
</box>
</geometry>
<!--<pose>{x} {y} {z} 0 0 0</pose>-->
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.05 0.05 0.05</size>
</box>
</geometry>
<material><script><name>Gazebo/Blue</name></script></material>
</visual>
<!--
<sensor name='my_contact' type='contact'>
<contact>
<collision>box_collision</collision>
</contact>
</sensor>
-->
</link>
</model>
</sdf>