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

Wrong laserscan "mapping" in rvis

asked 2014-05-08 12:01:44 -0500

julled gravatar image

updated 2014-05-09 10:57:29 -0500

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... ?

edit retag flag offensive close merge delete

Comments

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

julled gravatar image julled  ( 2014-05-15 12:22:41 -0500 )edit

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

julled gravatar image julled  ( 2014-05-15 12:23:50 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-05-09 12:58:45 -0500

tfoote gravatar image

updated 2014-05-15 12:59:55 -0500

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.

edit flag offensive delete link more

Comments

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

julled gravatar image julled  ( 2014-05-15 05:15:26 -0500 )edit

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

julled gravatar image julled  ( 2014-05-15 05:17:56 -0500 )edit
0

answered 2014-05-09 12:01:08 -0500

130s gravatar image

This looks similar to the bug that's been discussed here, which was introduced from ver 1.10.15 (on Hydro I guess. RViz' versioning scheme seems to have changed between Groovy and Hydro). You might want to try building from source 1.10.14 or older version, say up to this commit to work around the issue until the ticket is closed with a fix and the new version to be released.

This email helps you for how to source build RViz.

edit flag offensive delete link more

Comments

Thank you Isaac! I am running 1.8.17 rviz. Do you think it could be a frame related problem like tfoote thinks?

julled gravatar image julled  ( 2014-05-15 05:27:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-08 12:01:44 -0500

Seen: 1,196 times

Last updated: May 15 '14