0
$\begingroup$

Rosanswers logo

I'm using a Kinect in my project. I was able to open the image obtained by it in Rviz, however the image that appears in the viewer looks on an axis that I want to change.

Apparently the image reproduction is in the Z plane, as if the kinect was installed in the X plane. image description http://i68.tinypic.com/xdb21d.png

I used the commands:

roslaunch openni_launch openni.launch

rosrun rviz rviz

Can anyone help me which file should I find to change the playback position of the kinect image?


Originally posted by Thadeu Brito on ROS Answers with karma: 15 on 2017-06-30

Post score: 1


Original comments

Comment by velveteenrobot on 2017-06-30:
Can you add more information about your setup? Do you just want to be able to view the point clouds differently in RViz or do you want to actually change the orientation of the point cloud?

Comment by velveteenrobot on 2017-06-30:
If you just want to view the point cloud differently, you may be able to get what you want just by changing the Global Options->Fixed Frame in Rviz.

Comment by velveteenrobot on 2017-06-30:
If you want to transform the point cloud to a new frame then you can look at the pcl_ros API for transforming point clouds.

Comment by Thadeu Brito on 2017-07-02:
Thank you for the tips. The image is currently appearing on the YZ plane. I would like to get the image in the XY plane. However changing to Fixed Frame, this does not happen.

Comment by velveteenrobot on 2017-07-02:
Do you just want to view the point cloud differently in Rviz then? What is the current Fixed Frame in your Rviz? What are the other possible options? You could also just change your viewpoint in the Views Panel

Comment by Thadeu Brito on 2017-07-03:
I am using the Camera Link option in the Fixed Frame.

Comment by Thadeu Brito on 2017-07-03:
My frame settings are default to openni_launch. I just did: I connected the kinect to my computer; I used the commands: rosrun rviz rviz and roslaunch openni_launch openni.launch; I put the fixed fram in camera link; I added PointCloud2 and I marked the topic as / camera / depth_registered / points

Comment by Thadeu Brito on 2017-07-03:
And now I want to change the point cloud plan. Even if I change the Fixed Frame, the point cloud does not change place. And I would not like to change the view in Rviz.

Comment by Thadeu Brito on 2017-07-03:
I found a point cloud image as an example (Link)

link text

Comment by Thadeu Brito on 2017-07-03:
I would like to have a superior view of the point cloud. As if the camera was over my head.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It sounds like to do what you want, you need to know the desired pose of your viewpoint relative to the current pose of your Kinect (at least approximately depending on how accurate you want this transformation to be). What you want to do is create a new frame that is offset from the camera_link in such a way that it gives the "above" viewpoint of the point cloud that you are looking for. I would recommend trying to estimate where you would want the viewpoint to be and figuring out the offset between that and your current camera_link. Then you could run the following on the command line:

rosrun tf static_transform_publisher x y z yaw pitch roll camera_link new_frame_id 10

This creates a TF frame using the static_transform_publisher. The "x y z yaw pitch roll" arguments are the amounts in each of those dimensions that your desired frame is from your camera_link frame. More details are at that link. It's hard for me to guess at an approximate transform from the image in your question but if you update with an image that has the TF frames shown I might be able to be more specific. Maybe try something like:

rosrun tf static_transform_publisher 0 0 2.0 0 -3.14/4 3.14 camera_link new_frame_id 10

Then change your Fixed Frame in Rviz to the "new_frame_id" and see if you get something similar to the viewpoint you want. If so, then you can take the next step if necessary and transform your point cloud into that frame so that when you access it programmatically it will have the values you want. You can do this using the pcl_ros API.


Originally posted by velveteenrobot with karma: 136 on 2017-07-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Thadeu Brito on 2017-07-04:
Thank you very much for your attention! It worked!

Comment by Dongdong on 2018-11-19:
I have a problem after following this method. After rosrun, the point cloud cannot show up.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.