Ask Your Question
0

point cloud in wrong position relative to robot

asked 2019-07-27 02:18:24 -0500

logan.ydid gravatar image

updated 2019-07-28 19:35:34 -0500

Hello fellow roboticists,

I have been trying to get a kinect sensor working on my urdf model in gazebo. i have successfully attached the sensor thanks to my previous question here. My only issue is that the data is being shown in the wrong place in Rviz. There, the point cloud that should be displayed as being in front of the robot is being displayed above it and rotated about the z axis. How shoud i go about fixing this?

Here is an image of what is happening (left is in Gazebo and the right is in Rviz): image description

and here is my urdf model that i am using:

<?xml version="1.0"?>
<robot name="tortoisebot">

  <link name="base_link">
    <visual>
      <geometry>
        <box size="0.6 0.3 0.3"/>
      </geometry>
      <material name="silver">
        <color rgba="0.75 0.75 0.75 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <box size="0.6 0.3 0.3"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="1.0"/>
      <inertia ixx="0.015" iyy="0.0375" izz="0.0375" ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <link name="front_caster">
    <visual>
      <geometry>
        <box size="0.1 0.1 0.3"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.1 0.1 0.3"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.00083" iyy="0.00083" izz="0.000167" ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <joint name="front_caster_joint" type="continuous">
    <axis xyz="0 0 1"/>
    <parent link="base_link"/>
    <child link="front_caster"/>
    <origin rpy="0 0 0" xyz="0.3 0 0"/>
  </joint>

  <link name="front_wheel">
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.035"/>
      </geometry>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.05" radius="0.035"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="5.1458e-5" iyy="5.1458e-5" izz="6.125e-5" ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <joint name="front_wheel_joint" type="continuous">
    <axis xyz="0 0 1"/>
    <parent link="front_caster"/>
    <child link="front_wheel"/>
    <origin rpy="-1.5708 0 0" xyz="0.05 0 -.15"/>
  </joint>

  <link name="right_wheel">
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.035"/>
      </geometry>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.05" radius="0.035"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="5.1458e-5" iyy="5.1458e-5" izz="6.125e-5" ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <joint name="right_wheel_joint" type="continuous">
    <axis xyz="0 0 1"/>
    <parent link="base_link"/>
    <child link="right_wheel"/>
    <origin rpy="-1.5708 0 0" xyz="-0.2825 -0.125 -.15"/>
  </joint>

  <link name="left_wheel ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-07-29 08:01:45 -0500

MCornelis gravatar image

The static frame of the kinect camera is pretty weird indeed. You basically give the solution to your problem in your question "the point cloud that should be displayed as being in front of the robot is being displayed above it and rotated about the z axis". Simply figure out the correct quaternion transformation you need and apply it to the kinect topic. You can do this by creating another intermediate topic and adding an additional static frame in your launchfile. This problem stems from the fact that the rviz frame does not match the kinects own frame. So for visualizing the kinect model correctly in gazebo and rviz you need 1 transform, but to transform the data you need another.

edit flag offensive delete link more

Comments

I had to do this for a project a while back, I currently do not have access to the repository in which I worked at the time. If I can find how exactly I did it back then, I'll come back to you (I'll edit the answer above). In the meantime I hope this answer helps you in the right direction.

MCornelis gravatar imageMCornelis ( 2019-07-29 08:05:20 -0500 )edit

Im sorry, would you mind elaborating a bit more i found out how to create another static frame in the launch file <node pkg="tf" type="static_transform_publisher" name="laser" args="0 0 0 x y z hokuyo_link kinect_cloud 100"/> but i dont know how to create a new topic such that the data from the old topic gets remapped using the new frame. Thank you!

logan.ydid gravatar imagelogan.ydid ( 2019-08-09 00:02:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-07-27 02:18:24 -0500

Seen: 46 times

Last updated: Jul 29