ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

kinect problem

asked 2020-04-05 08:32:00 -0500

Carrot12138 gravatar image

updated 2020-04-06 03:08:19 -0500

Hello,I am having a problem when doing the gazebo simulation with a kinect in it.The scene has some problem with a plane formed by the point cloud blocking in the view,which has a big impact on my work.The problem can be seen as follows.

image description

I tried updating my gazebo version and modifying the srdf file of the kinect or changing the gazebo world,but the cloud point plane is still there blocking my view.I'm not sure if it's the problem with the kinect plugin,does anyone meet this problem before?

The launch file is as follows:

<launch>

    <!-- set launch parameters -->
    <arg name="world_name" value="$(find mrobot_gazebo)/worlds/playground.world"/>
    <arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>
    <arg name="headless" default="false"/>
    <arg name="debug" default="false"/>

    <!-- run gazebo environment -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(arg world_name)" />
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="headless" value="$(arg headless)"/>
    </include>

    <!--load robot description parameters -->
    <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find mrobot_gazebo)/urdf/mrobot_with_kinect.urdf.xacro'" />

    <!-- run joint_state_publisher  -->
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node> 

    <!-- run robot_state_publisher -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"  output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>

    <!-- load robot model in gazebo-->
    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
          args="-urdf -model mrobot -param robot_description"/> 

</launch>

the urdf file is as follows:

<?xml version="1.0"?>

<robot name="mrobot" xmlns:xacro="http://www.ros.org/wiki/xacro">

    <xacro:include filename="$(find mrobot_gazebo)/urdf/mrobot_body.urdf.xacro" />
    <xacro:include filename="$(find mrobot_gazebo)/urdf/kinect.xacro" />

    <xacro:property name="kinect_offset_x" value="-0.06" />
    <xacro:property name="kinect_offset_y" value="0" />
    <xacro:property name="kinect_offset_z" value="0.035" />

    <!-- Body of mrobot, with plates, standoffs and Create (including sim sensors) -->
    <mrobot_body/>

    <!-- Attach the Kinect -->
    <joint name="kinect_frame_joint" type="fixed">
        <origin xyz="${kinect_offset_x} ${kinect_offset_y} ${kinect_offset_z}" rpy="0 0 0" />
        <parent link="plate_2_link"/>
        <child link="camera_link"/>
    </joint>
    <xacro:kinect_camera prefix="camera"/>

</robot>

the kinect.xacro file is as follows:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="kinect_camera">

    <xacro:macro name="kinect_camera" params="prefix:=camera">
        <!-- Create kinect reference frame -->
        <!-- Add mesh for kinect -->
        <link name="${prefix}_link">
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <visual>
                <origin xyz="0 0 0" rpy="0 0 ${M_PI/2}"/>
                <geometry>
                    <mesh filename="package://mrobot_description/meshes/kinect.dae" />
                </geometry>
            </visual>
            <collision>
                <geometry>
                    <box size="0 ...
(more)
edit retag flag offensive close merge delete

Comments

I don't know about the others, but here the image isn't loading.

Teo Cardoso gravatar image Teo Cardoso  ( 2020-04-05 12:24:23 -0500 )edit

could you please try refreshing the page,it might help.

Carrot12138 gravatar image Carrot12138  ( 2020-04-05 13:16:43 -0500 )edit

It did not. However, I'm pretty sure you can upload images here.

Teo Cardoso gravatar image Teo Cardoso  ( 2020-04-05 16:31:12 -0500 )edit

I have modified this,sorry i am new to this forum...

Carrot12138 gravatar image Carrot12138  ( 2020-04-05 21:44:18 -0500 )edit

can you upload the launch file you are using (one you use to load the kinect)?

KalanaR gravatar image KalanaR  ( 2020-04-06 00:41:53 -0500 )edit

related files has been listed here,I also tried directly inserting the kinect model in gazebo(The sdf file and plugin tag are downloaded from the official website),the problem is still there.

Carrot12138 gravatar image Carrot12138  ( 2020-04-06 03:12:37 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-04-06 10:44:48 -0500

Try to change the value inside the near tag.

The tag: "clip" is responsible to select the visible range of the camera.

It is possible something in the visual of the gazebo is ahead of the camera.

Try to increase the value of the near tag.

edit flag offensive delete link more

Comments

Thank you for your answer,but I tried changing all of the value of tag,the plane is still there.I have decided to temporarily replace the point cloud with image in my work... still,thanks a lot :)

Carrot12138 gravatar image Carrot12138  ( 2020-04-13 22:45:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-05 08:32:00 -0500

Seen: 435 times

Last updated: Apr 06 '20