blodow / realtime_urdf_filter

ROS package that can filter geometry defined in URDF models from Kinect depth images. Can also preprocess data for the OpenNI tracker, to remove backgrounds, robots etc.
Other
89 stars 46 forks source link

No filtered depth image published #21

Open ruinianxu opened 6 years ago

ruinianxu commented 6 years ago

Hi all,

My question right now is how this package works. As my understanding of filtering mesh, I need to load robot description of the robot model I want it to be filtered and offer tf info between each links of robot such that code knows the current status of robot. Hence, I used rrbot which is a simple robot model that consisted of three links. I loaded rrbot in gazebo and started tf node to publish tf between each link. However when I launched the realtime urdf filter, I found it also tried to start a node of publishing tf for robot. I am not sure whether this means I don't need to load robot in gazebo or any visualizer or simulator but just load robot description to parameter server and open the node of tf. Hence I just commented one out but got nothing published in /output topic.

My final goal is to understand how code reads tf info to filter the robot out of the depth image. Appreciate any help or suggestion in advance.

JimmyDaSilva commented 6 years ago

Hi @ruinianxu, you seem to not be experienced enough with using ROS.

I guess you ran the realtime_urdf_filter.launch launch file. If you open it and read what nodes are run within this launch file, you will see that there is indeed a robot_state_publisher which you apparently already run when starting you gazebo simulation.

I suggest you try to get a better understanding of the launch file, and see if you can modify it to make your program work. If you are stuck, here is the launch file and the params I use: https://github.com/JimmyDaSilva/realtime_urdf_filter/blob/current-settings/launch/filter.launch https://github.com/JimmyDaSilva/realtime_urdf_filter/blob/current-settings/launch/filter_parameters.yaml

As for how the package work, if I understood well, this is how it works: With OpenGL a 3D scene is created with the robot updated inside, we add as well a virtual camera at tf location with the same intrinsics parameters. Then GLSL (GL Shader Language) is used to create the mask image.

ruinianxu commented 6 years ago

Hi @JimmyDaSilva , thank you so much for your reply. I think I didn't explain the problem well. First of all, if I understand correctly, what this package can do is filtering the given urdf out of depth image it reads from the topic. Then, in my opinion, I thought it needs some urdf spawner like gazebo to spawn robot in the simulated world and builds the tf tree to publish tf information. Then the code will read robot urdf and its tf info in and do the filter job. But in the realtime_urdf_filter.launch file, it just starts two nodes related with realtime_urdf_filter, load the robot description to parameter server and start the node of robot_state_publisher. If it doesn't need any simulated environment to spawn robot model, so does it mean robot_state_publisher node will still correctly publish tf info without starting any controllers for robot arm. I think the core problem confuses me is which part of code is responsible for reading tf information. Since I want to understand how it filters the given urdf out and use it in my own work not just directly using his package. Thank you again for your precise time and kind help.

JimmyDaSilva commented 6 years ago

This package takes as inputs:

If you start publishing the tf of your robot with a robot_state_publisher inside a gazebo spawn, or inside a launch file somewhere else does not matter. The nodes in this package do not write the tf, it just reads. But if you run the launch file realtime_urdf_filter.launch as it is, you will start the realtime_urdf_filter AND a robot_state_publisher

If your problem is underestanding how to get the tf transform inside the code, here is a tutorial: http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20listener%20%28C%2B%2B%29

ruinianxu commented 6 years ago

Hi @JimmyDaSilva , thank you for your quick reply. I'll try it by myself first and see what will happen. I'll let you know if I get it work.