ADVRHumanoids / iit-centauro-ros-pkg

2 stars 0 forks source link

Modeling of D435I camera slows down simulation #11

Closed IoannisDadiotis closed 3 years ago

IoannisDadiotis commented 3 years ago

Hi @liesrock, @aled96 . Trying to use the model of centauro with the cameras I came across another issue. When launching gazebo only (no xbot2, no cartesio) I am getting very low real time factor, in particular I get real time factor 0.18 (in contrast I get 0.3 when using the model with no cameras under the same laptop and computational resources). I don't know if such a reduction makes sense but I traced the model's xacro files to see what is the exact parameter that causes this.

I found that in the file centauro_base.urdf.xacro the following lines of code for the Intel D435I is the reason.

<xacro:if value="${ADD_INTEL_D435I}">
        <xacro:include filename="$(find realsense_gazebo_description)/urdf/_d435i.urdf.xacro" />

       <!-- <xacro:sensor_d435i parent="torso_2" name="d435i_camera" topics_ns="d435i_camera" 
                            enable_pointCloud="true" align_depth="true">
            <origin xyz="0.13 0 0.03" rpy="0 0.25 0"/> 
        </xacro:sensor_d435i>-->

        <xacro:sensor_d435i parent="pelvis" name="D435i_camera" topics_ns="D435i/D435i_camera"
                      enable_pointCloud="true" align_depth="true"
                      unite_imu_method="false"

                      visualize="true"

                      accel_fps="300"
                      gyro_fps="300"

                      depth_width="1280"
                      depth_height="720"
                      depth_fps="90"

                      infra_width="1280"
                      infra_height="720"
                      infra_fps="90"

                      color_width="1280"
                      color_height="720"
                      color_fps="30">

            <origin xyz="0.219831 0 -0.0613293" rpy="0.0 0.5585052 0.0"/>
        </xacro:sensor_d435i>  
    </xacro:if>

I, also, tried reducing the *_fps (in the above code) but that does not change anything. Probably, this reduction come from the realsense_gazebo_description package. Do you have think that such reduction in real time factor from this camera is reasonable? If not, maybe we could engage the maintainer of the above package and get suggestions about what can be the issue and further checks we can do. (FYI @alaurenzi )

aled96 commented 3 years ago

Hi, The D435i is a depth camera, so it is possible that the gazebo plugin slows down the entire simulation.. Up to now, we are not using this camera, so we may try to disable it in the model.

On my laptop, without the D435i (but with T265 and Velodyne) I have a real-time factor of 0.37, while with all the 3 cameras is 0.32.

If you want to try to remove the D435i you have simply to set to "false" the xacro property "ADD_INTEL_D435I" in iit-centauro-ros-pkg/centauro_urdf/urdf/config/centauro.urdf.xacro

IoannisDadiotis commented 3 years ago

I see @aled96 . In my case the difference is bigger, I have 0.28-0.3 with only T265 and Velodyne (similar to no camera at all).

aled96 commented 3 years ago

Ok great, I think that for now we can use this configuration ! Eventually if we will have the need to integrate also the D435i we will check if it is possible to increase the rtf in some way