PX4 / PX4-SITL_gazebo-classic

Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.
http://dev.px4.io/simulation-gazebo.html
378 stars 795 forks source link

Cannot get data of cameras when simulating multiple iris drone #991

Open longvucao opened 1 year ago

longvucao commented 1 year ago

Hi, I am trying to simulate multiple iris drone and want to get its camera at the same time. When I worked with a drone, I added the following code to the end of the iris.sdf file to get the camera: 4

Then I used the file mavros_posix_sitl.launch and it got the image I wanted (you can see it in the picture) 1 2

However when I use the file multi_uav_mavros_sitl.launch to simulate multiple drones (still using the edited iris.sdf file) the desired topic appears but I can't get the image (you can see the difference here picture below) 3

So do you have any ideas to solve this problem? I really appreciate your help)

JohnTGZ commented 1 year ago

You need to find a way to namespace all the different camera topics being published so that they are distinct from each other? i.e. not publishing to the same camera topic.

Babylonehy commented 1 year ago

Use group namesapce when you spawn your model into gazebo. You have to make sure your depth camera have .