ethz-asl / cad-percept

Bringing meshes to robotics.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Generalized Lidar Simulator PR #78

Closed drehermarc closed 4 years ago

drehermarc commented 4 years ago

Hi :)

You can find the commit of the discussed generalized lidar simulator in this PR. The parameter SimMarker in the movable_lidar_sim.launch allows for moving the lidar scan around with the interactive marker if set on true, if set on false it will use the ground truth data in the config file of the simulator. Additionally, I have implemented the option to fix the lidar scan on the cad model. This can be switched on by setting the parameter FixLidarScan on true (also in the movable_lidar_sim.launch file). If set on false, it will create a point cloud of the lidar scan, where the lidar sensor is centered in the origin. Both variables are set per default on false in sim_lidar_node.cpp such that there is no change in the behavior for the already existing files.

Best, Marc

hermannsblum commented 4 years ago

Thanks for the effort!

Unfortunately, the changes made the code more complex instead of more simple. I think there is a much leaner solution :)

Please have a look at the following:

drehermarc commented 4 years ago

Thanks for the effort! Unfortunately, the changes made the code more complex instead of more simple. I think there is a much leaner solution :) Please have a look at the following:

you do not have to listen on the marker topic, this is only for rviz for interaction with the marker. right now you are reusing the 'find id in mesh' marker, which is not really made for this job. Please create your own marker node. You could do this even in cpt_utils because this would be a good tool in general. The marker should in principle rather follow the design of the mesh-positioning marker and just continuously publish it's position relative to the 'marker' frame (this is a bit confusing, but the base-coordinate-frame of the cad-model is usually called 'marker' because this was the first time we used markers... There should be parameter change between the lidar simulation and using a constant position. For a constant position, you don't really have to use a config file, you can just use the static transform publisher. Which node to start can be handled purely in roslaunch, so the lidar-simulation node will just have a tf-listener for a specific frame and simulate the lidar at this frame. I don't fully understand the FixLidarScan option. Isn't this the same thing as using the coordinates (0, 0, 0) as input?

Hi Hermann :) Thanks for your feedback. I will change the code according to the first three points and try to make the code simpler. To come back to your question from the last point, FixLidarScan is just a visualization tool that does not move the sampled point cloud but the viewing point of the lidar and then creates a lidar frame. This has the advantage that in the visualization the simulated lidar frame is placed exactly on the mesh, but the lidar is no longer central in the point cloud. If FixLidarScan = false, the lidar is again in the center of the point cloud, as it was. Generally you can say that FixLidarScan moves the Point Cloud in its own coordinate system (true) or not (false). I will also try to make this easier.

gawela commented 4 years ago

Oh, I see that Hermann has basically commented the same. I guess I hadn't reloaded the github page.

drehermarc commented 4 years ago

Oh, I see that Hermann has basically commented the same. I guess I hadn't reloaded the github page.

Hi :), thanks for the feedback. I have uploaded a new version yesterday, the commit is on the generalized_lidar-feature branch but oddly enough does not seem to appear here in the PR. I have now reverted the changes and will try it again, otherwise I will open a new PR.