lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.26k stars 778 forks source link

How to use multiple Lidars in the single vehicle. #75

Closed wsp50317 closed 5 years ago

wsp50317 commented 5 years ago

I tried to directly copy the Lidar and run, but the copied one would be stuck in the original position(It can't move with the vehicle). And It also failed to pass data to Autoware. Is there any methods to use multi Lidars?

moenasrallah commented 5 years ago

I think the problem you are having is that the Lidar is not a child object to the Car object. Observe this relationship and drag the new copied Lidar to be like this in the hierarchy.

image

This will then move the lidar accordingly with the vehicle since it is now technically attached.

As for the Autoware part, I'm not sure.

martins-mozeiko commented 5 years ago

@wsp50317 For new lidar to be able to communicate to ROS it needs to be added to Needs Bridge list of vehicle object. See following link that explains how to duplicate camera sensor: https://github.com/lgsvl/simulator/issues/68#issuecomment-454171107

wsp50317 commented 5 years ago

@moenasrallah Sorry that I didn't explain exactly. I have set parent and child, and the Lidars can move with vehicle. But the clone one's red point cloud would stuck in the start point in the unity scene.

@martins-mozeiko Thank you! It solve my problem. Although the above problem have not be solved, ROS works normally.

martins-mozeiko commented 5 years ago

@wsp50317 You are right. Visualization in simulator does not work correctly when multiple lidars are added to vehicle. We will fix this.

martins-mozeiko commented 5 years ago

Visualization is fixed with e669702 commit.