0
$\begingroup$

Rosanswers logo

Hi everyone, im pretty new to ROS and i still haven't understand every bit of it. So there are still some things which are a bit strange to me. And i want to say sorry in advance for not writing the best english..

What i want to do: Im trying to use a simulated Kinect in VREP as source for a SLAM-Algorithm in ROS.

Systemconfig: I use Fuerte on a Ubuntu 12.04 LTS

Progress: I transfered the Kinect Pointcloud to ROS via a Topic and used the pointcloud_to_laserscan/CloudToScan nodelet to convert it to a fake-laserscan with the following script:

<launch>

 <!-- openni_manager -->
  <node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>
 
  <!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager">
    <param name="max_rate" value="20"/>
    <remap from="cloud_in" to="/vrep/KinectPointCloud"/>
    <remap from="cloud_out" to="/cloud_throttled"/>
  </node>
 
  <!-- fake laser -->
  <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager">
    <param name="output_frame_id" value="/kinect"/> <!-- Question1 -->
    <param name="min_height" value="-0.025"/>
    <param name="max_height" value="0.025"/>
    <remap from="cloud" to="/cloud_throttled"/>
  </node>
</launch>

But if i want to show the laserscan in rviz something strange happens to the pointcloud: (i put some decay on the laserscan to see multiple scans at once)

RVIZ Picture (thank you for the upvote, now i can post the picture)

It seems as the points arent mapped to the "real world". They are "rotating" with the Robot (Kinect). Shouldnt they normally stay at the objectpositions? I really think that the problem is tf-related... The tf-Tree is visible in the rviz screenshot. The /scan Topic (laserscantopic) is transformed via

rosrun tf static_transform_publisher  0 0 0 0 0 0 kinect_visionSensor scan 100

tf echo puts out:

---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1399584596
        nsecs: 289725537
      frame_id: /kinect
    child_frame_id: /kinect_visionSensor
    transform: 
      translation: 
        x: -0.0141000151634
        y: 0.0292500853539
        z: 0.0323894619942
      rotation: 
        x: 3.98174461205e-08
        y: 0.707106751384
        z: 0.707106810989
        w: -5.22563454972e-08
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1399584596
        nsecs: 289725537
      frame_id: /world
    child_frame_id: /kinect
    transform: 
      translation: 
        x: 0.20544680953
        y: -0.454404950142
        z: 0.345994025469
      rotation: 
        x: 4.20090261606e-05
        y: 2.69500965001e-05
        z: -0.479030467743
        w: 0.877798273228
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1399584596
        nsecs: 477231988
      frame_id: /kinect_visionSensor
    child_frame_id: /scan
    transform: 
      translation: 
        x: 0.0
        y: 0.0
        z: 0.0
      rotation: 
        x: 0.0
        y: 0.0
        z: 0.0
        w: 1.0
---

After that Messages there are multiple tf-messages just like the last one. After a few seconds the other two get a update.

Questions:

  1. Im not shure what the "output_frame_id" in the script should be. What should i put there?
  2. Is my tf-tree okey? Im really not that sure about that.
  3. fixed Frame = "/world" is ok for rviz?
  4. Do i need more tf-data from VREP?

I think i missed one little piece in the huge ros-puzzle... ?


Originally posted by julled on ROS Answers with karma: 23 on 2014-05-08

Post score: 2


Original comments

Comment by julled on 2014-05-15:
Anyone got a idea? I think its frame / tf related but i cant find my error. view_frames output: http://i.imgur.com/VvhjkBf.png

Comment by julled on 2014-05-15:
Anyone got a idea? I think the problem is frames / tf related but i cant find the error... view_frames output: http://i.imgur.com/VvhjkBf.png

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think you're mixing up frame_ids and topics. Can you show the output of view_frames? And what is the frame_id of the /scan topic?

What is the transform from world to kinect being published by?

Edit:

Based on your view_frames output.

  1. I believe you should set the output_frame_id to kinect_visionSensor
  2. You tf tree looks like it has an extra link you should not be attaching /scan (That's the topic not the frame_id)
  3. fixed_frame world should be fine
  4. If you want to do SLAM vrep should not be publishing the world link (that is the job of slam) the vehicle's odometry should be publishing a transform from the base_link to the odometric frame. And then the slam will compute the transform from /odom to /world.

Originally posted by tfoote with karma: 58457 on 2014-05-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by julled on 2014-05-15:
Thank you tfoote for your answer!

view_frames output: http://i.imgur.com/VvhjkBf.png

The rostopic echo of /scan reveals that the frameid is /kinect

Comment by julled on 2014-05-15:
Im not sure if i get the other question right, but you mean who does the transform from world to kinect? In Vrep its: simExtROS_enablePublisher('tf',1,simros_strmcmd_get_transform,kinect_visionSensor,kinect,'') simExtROS_enablePublisher('tf',1,simros_strmcmd_get_transform,kinect,-1 ,'') -1 is /world

$\endgroup$

Your Answer

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