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

Simulated kinect rotation around X [bug?]

asked 2013-01-30 22:37:41 -0500

Ugo gravatar image

updated 2016-10-24 09:00:12 -0500

ngrennan gravatar image

Hi,

In our robot, the Kinect can be mounted on the side of the arm, as shown in the screenshot below. When running the simulation in Fuerte, I found this weird behaviour. As you can observe on the image, the point cloud does not match the robot model (we see a partial image of the hand/arm at the bottom left of the screenshot, which should be on the robot model).

Rotate Kinect

As soon as I rotate the kinect against its X axis (so that the kinect is horizontal as you can see on the second screenshot), then the point cloud and robot model are aligned properly.

Horizontal Kinect

The kinect xacro and dae are the one from the turtlebot. I'm simply attaching them with a rotation:

<joint name="base_camera_joint" type="fixed">
  <origin  xyz="0.01216 0.1713 0.433"
       rpy="-${M_PI/2} ${M_PI/4} -${M_PI/12}" /> 
  <!-- This -pi/2 in origin rpy is the offending parameter -->

  <parent link="shadowarm_trunk"/>
  <child link="camera_link" />
</joint>

The code can be seen on github.

Any help is greatly appreciated!

edit retag flag offensive close merge delete

Comments

Your problem might be that you assume the Kinect tf has the y axis pointing up, but many frames related to cameras actually have the y axis pointing down. Think about it and see if that makes sense!

georgebrindeiro gravatar image georgebrindeiro  ( 2013-01-31 01:08:49 -0500 )edit

I'm using the standard kinect from the turtlebot, the y axis is pointing down (towards the base of the kinect). When rotating so that the kinect is vertical, I rotate the main frame of the kinect, so relative orientations of all the different frames are kept.

Ugo gravatar image Ugo  ( 2013-01-31 20:41:33 -0500 )edit

I'm not sure what is going on (the first image isn't very clear as to where the part is supposed to be) but I still think looking at the coordinate systems is the way to go. You seem to be projecting XYZ coordinates given in a down-facing coordinate frame into an up-facing coordinate frame.

georgebrindeiro gravatar image georgebrindeiro  ( 2013-02-01 00:48:49 -0500 )edit

I annotated the picture to make it hopefully clearer. The point cloud we see is the robot seen through the kinect. The robot is also displayed as the 3d model, so they should be both at the same position (which is what I have when the kinect is horizontal).

Ugo gravatar image Ugo  ( 2013-02-01 01:13:41 -0500 )edit

Sorry, I don't think I can help you. Since I think this problem is more gazebo-related, you should probably ask here: answers.gazebosim.org

georgebrindeiro gravatar image georgebrindeiro  ( 2013-02-01 05:05:39 -0500 )edit

Good point. I'll ask it there. Thanks for your time anyway,.

Ugo gravatar image Ugo  ( 2013-02-03 19:19:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-02-21 21:19:56 -0500

Ugo gravatar image

An answer from David Butterworth which solved my problem! Thanks David.


I found that if you modify the visual/collision mesh to be aligned with your joint origin, then it's okay. Don't do extra translations/rotations of the mesh from within your URDF, because that is broken. The orientation of the sensor data should depend on the Gazebo macro, but there should be only translations in there, with 2 joint rotations for the extra pair of camera frames.

My Gazebo macro is based on the PR2 one, but with the visual/collision meshes fixed and re-scaled as per above. The end result is that any translation/rotation is only done at the head_mount_kinect joint that orientates everything else, and you can successfully pitch the sensor up-down or vertically.

I'm guessing that in your situation, the PointCloud data is actually in the correct place, but because of the bug with the meshes, the visual model is in the wrong place.

edit flag offensive delete link more

Comments

so in the end it was a gazebo bug? good to know you finally got your answer!

georgebrindeiro gravatar image georgebrindeiro  ( 2013-02-22 00:46:59 -0500 )edit

There is a Github issue about this: https://github.com/ros-simulation/gaz...

fvd gravatar image fvd  ( 2018-07-12 05:40:46 -0500 )edit

Question Tools

Stats

Asked: 2013-01-30 22:37:41 -0500

Seen: 2,005 times

Last updated: Feb 21 '13