Simulated kinect rotation around X [bug?]
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).
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.
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!
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!
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.
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.
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).
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
Good point. I'll ask it there. Thanks for your time anyway,.